How to hit the CountriesNow API

CountriesNow at https://countriesnow.space/api/v0.1 serves country reference data: capitals, cities, states, flags, currencies, and populations.

Authentication

None — no key, no signup. Every example runs as-is.

Full reference: https://documenter.getpostman.com/view/1134062/T1LJjU52

Capitals

curl https://countriesnow.space/api/v0.1/countries/capital
Run in PostTaco
Example response (trimmed)
{
  "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"
    }
  ]
}

Cities in a country

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"}'
Run in PostTaco
Example response (trimmed)
{
  "error": false,
  "msg": "cities in Iceland retrieved",
  "data": [
    "Akranes",
    "Akureyri"
  ]
}