africaAPI

Reference

Geographies

Traverse continent, region, country, and other geography records exposed by Africa API.

List Geographies

GET/v1/geographies

Returns geography records from the hierarchy backing the public platform.

typestring
Filter by geography type such as continent, region, subregion, or country
parent_keystring
Return children of a geography key
country_codestring
Filter to one country-backed geography
qstring
Case-insensitive search against geography names
limitinteger
Maximum rows to return (1-500)
Request
curl "https://api.africa-api.com/v1/geographies?type=country&limit=3" \
  -H "Authorization: Bearer $AFRICA_API_KEY"
Response
{
  "data": [
    {
      "key": "country:dz",
      "type": "country",
      "code": "dz",
      "name": "Algeria",
      "parent_key": "subregion:northern-africa",
      "country_code": "dz",
      "latitude": 28,
      "longitude": 3
    }
  ]
}

Get Geography Detail

GET/v1/geographies/{geography_key}

Returns one geography record by key.

Request
curl "https://api.africa-api.com/v1/geographies/country:ke" \
  -H "Authorization: Bearer $AFRICA_API_KEY"
Response
{
  "data": {
    "key": "country:ke",
    "type": "country",
    "code": "ke",
    "name": "Kenya",
    "parent_key": "subregion:eastern-africa",
    "country_code": "ke",
    "latitude": -0.0236,
    "longitude": 37.9062
  }
}

On this page