CountriesNow at https://countriesnow.space/api/v0.1 serves country reference data: capitals, cities, states, flags, currencies, and populations.
None — no key, no signup. Every example runs as-is.
Full reference: https://documenter.getpostman.com/view/1134062/T1LJjU52
curl https://countriesnow.space/api/v0.1/countries/capital
{
"error": false,
"msg": "countries and capitals retrieved",
"data": [
{
"name": "Afghanistan",
"capital": "Kabul",
"iso2": "AF",
"iso3": "AFG"
},
{
"name": "Aland Islands",
"capital": "Mariehamn",
"iso2": "AX",
"iso3": "ALA"
}
]
}
A POST with the country in the body.
curl -X POST https://countriesnow.space/api/v0.1/countries/cities \
-H "Content-Type: application/json" \
-d '{"country": "iceland"}'
{
"error": false,
"msg": "cities in Iceland retrieved",
"data": [
"Akranes",
"Akureyri"
]
}