Skip to content

Commit

Permalink
Merge pull request #327 from abckhush/master
Browse files Browse the repository at this point in the history
added Countries API
  • Loading branch information
Kritika30032002 committed Aug 5, 2024
2 parents c6e40b1 + fa98427 commit 20ed6c4
Show file tree
Hide file tree
Showing 5 changed files with 5,387 additions and 0 deletions.
81 changes: 81 additions & 0 deletions New_APIs/Countries_API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Countries & Cities API

## Description
This API provides detailed information about countries and their cities. You can retrieve data such as capital, language, currency, latitude, longitude, continent, and neighboring countries. Additionally, you can filter countries by language or currency, find neighboring countries of a specific country, and list all countries in a specific continent.

## Features
1. Retrieve information about countries, including language, currency, latitude, longitude, continent, and neighboring countries.
2. Filter countries by language or currency.
3. Find neighboring countries of a specific country.
4. List all countries in a specific continent.

## Requirements
- Node.js
- MongoDB
- Postman

## Installation
1. Clone the Repository:

```bash
git clone <repository-url>
cd <repository-directory>
```

2.Install Dependencies:

```bash
npm install
```

3. Setup MongoDB:
- Ensure MongoDB is installed and running on your local machine or a remote server.
- Create a new database and collection for storing country data.

4. Start the Server:

```bash
node server.js
```

## API Endpoints:

1. Get All Countries:

```http
GET /api/countries
```

2. Get Country by Name:

```http
GET /api/countries/:name
```

3. Get Countries by Language:

```http
GET /api/countries/language/:language
```

4. Get Countries by Currency:

```http
GET /api/countries/currency/:currency
```

5. Get Neighboring Countries:

```http
GET /api/countries/:name/neighbors
```

6. Get Countries by Continent:

```http
GET /api/countries/continent/:continent
```

## Notes
- Ensure server is running at 5000.
- Use Postman or similar tools to test and interact with the API endpoints.
Loading

0 comments on commit 20ed6c4

Please sign in to comment.