Reference
Geographies
Traverse continent, region, country, and other geography records exposed by Africa API.
List Geographies
GET
/v1/geographiesReturns geography records from the hierarchy backing the public platform.
typestringFilter by geography type such as
continent, region, subregion, or countryparent_keystringReturn children of a geography key
country_codestringFilter to one country-backed geography
qstringCase-insensitive search against geography names
limitintegerMaximum rows to return (1-500)
curl "https://api.africa-api.com/v1/geographies?type=country&limit=3" \
-H "Authorization: Bearer $AFRICA_API_KEY"{
"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.
curl "https://api.africa-api.com/v1/geographies/country:ke" \
-H "Authorization: Bearer $AFRICA_API_KEY"{
"data": {
"key": "country:ke",
"type": "country",
"code": "ke",
"name": "Kenya",
"parent_key": "subregion:eastern-africa",
"country_code": "ke",
"latitude": -0.0236,
"longitude": 37.9062
}
}