> For the complete documentation index, see [llms.txt](https://martins-victor.gitbook.io/country-and-cities/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://martins-victor.gitbook.io/country-and-cities/readme.md).

# CountriesNow API

[![CountriesNow](https://circleci.com/gh/MartinsOnuoha/countriesNowAPI.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs)

> A curation of Countries data including (dial codes, states, cities, currencies, capitals etc) served over a REST API so you don't have to have them locally in your applications. This means lighter application sizes as you wouldn't have to install another package to use geo data. Please note that this doesn't guarantee complete or correct data, feel free to raise issues where necessary.

![CleanShot 2022-03-17 at 9 19 17@2x](https://user-images.githubusercontent.com/29035007/158766598-c0a9cde5-8c15-4e9e-b7c7-5fbf3fc18666.png)

## USAGE

> The API does not require any form of Authentication or token.

```javascript
const BASE_URL = 'https://countriesnow.space/api/v0.1/countries'

let getCountries = async () => {
  const response = await fetch(`${BASE_URL}`).then(response => response.json())
  const { data } = response

  data.forEach((country) => {
    console.log(country) // {"country": "Afghanistan", "cities": [ "Herat", "Kabul", "Kandahar", "Molah", ...]}
  })
}
```

The API does not require any form of Authentication or token.

* Read Docs on: [Postman](https://documenter.getpostman.com/view/1134062/T1LJjU52?version=latest)
* Try it out on: [Swagger](https://countriesnow.space/swagger-docs)
* Check out Example Applications: [Here](https://github.com/MartinsOnuoha/countriesNow-Demo-Apps)

***

## Local Setup

```
git clone https://github.com/YourName/countriesNowAPI.git
```

### Change directory

```
cd countriesNowAPI
```

### Install packages

```
npm i
```

### Start Project

```
npm start
```

### Run test

```
npm run integration:test
```

## Contribution

> Please read the contribution guide [here](https://github.com/MartinsOnuoha/countriesNowAPI/blob/master/docs/contributing.md)

Feel free to support and keep the API running

[![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png)](https://www.buymeacoffee.com/martinsvicF)

✨ All thanks to [this gist](https://gist.github.com/keeguon/2310008), [datahub](https://pkgstore.datahub.io/core/), and [this repository](https://github.com/dr5hn/countries-states-cities-database) for the data curated.
