africaAPI

Data Domains

Countries

Read country metadata for all 54 African countries.

List Countries

GET/v1/countries

Returns metadata for African countries. The full list is returned by default — pagination is optional.

Includes filtering by region and sorting by name, area, or region. Use the sort parameter with a - prefix for descending order.

paginateboolean
Set true to enable paginated results
pageinteger
Page number (≥ 1)
per_pageinteger
Items per page (1–100)
regionstring
Filter by region alias: north, south, east, west, central
sortstring
Sort field: name, area, region — prefix with - for descending
Request
curl "https://api.africa-api.com/v1/countries?region=west&sort=-area"
Response
{
  "data": [
    {
      "id": "sn",
      "name": "Senegal",
      "official_name": "Republic of Senegal",
      "capital": "Dakar",
      "region": "West Africa",
      "subregion": "Western Africa",
      "area_km2": 196722,
      "currencies": ["XOF"],
      "languages": ["fra"],
      "flag": "🇸🇳"
    }
  ],
  "meta": {
    "total": 16,
    "page": 1,
    "per_page": 16,
    "total_pages": 1
  }
}

Get Country by Code

GET/v1/countries/{country_code}

Returns detailed metadata for a single country by its ISO 3166-1 alpha-2 code.

country_codestringrequired
ISO 3166-1 alpha-2 code, e.g. ng, ke, za
Request
curl "https://api.africa-api.com/v1/countries/ng"
Response
{
  "data": {
    "id": "ng",
    "name": "Nigeria",
    "official_name": "Federal Republic of Nigeria",
    "capital": "Abuja",
    "region": "West Africa",
    "subregion": "Western Africa",
    "area_km2": 923768,
    "iso3": "NGA",
    "timezone": "Africa/Lagos",
    "calling_code": "+234",
    "flag": "🇳🇬",
    "coordinates": {
      "latitude": 9.082,
      "longitude": 8.6753
    },
    "borders": ["bj", "cm", "ne", "td"],
    "currencies": [
      {
        "code": "NGN",
        "name": "Nigerian naira",
        "symbol": "₦"
      }
    ],
    "languages": [
      {
        "code": "eng",
        "name": "English"
      }
    ]
  }
}

Caching

List responses include ETag and Cache-Control: public, max-age=300 headers. Send If-None-Match to receive 304 Not Modified when data is unchanged.

On this page