CountriesNowAPI
CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
Install / Use
/learn @MartinsOnuoha/CountriesNowAPIREADME
CountriesNow API
<img width="1594" alt="CleanShot 2022-03-17 at 9 19 17@2x" src="https://user-images.githubusercontent.com/29035007/158766598-c0a9cde5-8c15-4e9e-b7c7-5fbf3fc18666.png">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.
USAGE
The API does not require any form of Authentication or token.
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.
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
Feel free to support and keep the API running
<a href="https://www.buymeacoffee.com/martinsvicF" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
✨ All thanks to this gist, datahub, and this repository for the data curated.
