Reference
Indicators
Discover available metrics, inspect coverage, and request country rankings from Africa API.
List Indicators
GET
/v1/indicatorsLists indicator definitions available through the public API.
categorystringFilter by metric category such as demographics, economy, infrastructure, health, education, or markets
sourcestringFilter to a specific source code such as
world_bank_wdi, who_gho, or unesco_uishas_databooleanReturn only indicators that currently have observations
curl "https://api.africa-api.com/v1/indicators?category=health&has_data=true" \
-H "Authorization: Bearer $AFRICA_API_KEY"{
"data": [
{
"key": "maternal_mortality_ratio",
"name": "Maternal Mortality Ratio",
"category": "health",
"unit": "per_100k_live_births",
"frequency": "annual",
"has_data": true
},
{
"key": "under_five_mortality_rate",
"name": "Under-Five Mortality Rate",
"category": "health",
"unit": "per_1000_live_births",
"frequency": "annual",
"has_data": true
}
]
}Education indicators are now available through the same endpoint. For example:
curl "https://api.africa-api.com/v1/indicators?category=education&has_data=true" \
-H "Authorization: Bearer $AFRICA_API_KEY"Get Indicator Detail
GET
/v1/indicators/{metric_key}Returns indicator metadata, source list, and coverage ranges.
curl "https://api.africa-api.com/v1/indicators/median_age_years" \
-H "Authorization: Bearer $AFRICA_API_KEY"{
"data": {
"key": "median_age_years",
"name": "Median Age",
"description": "Median age of the total population, in years.",
"category": "demographics",
"unit": "years",
"frequency": "annual",
"sources": ["un_wpp"],
"coverage": {
"countries": 54,
"min_year": 1950,
"max_year": 2026
}
}
}Get Indicator Rankings
GET
/v1/indicators/{metric_key}/rankingsReturns a cross-country ranking for one metric and year.
yearintegerrequiredTarget year
sourcestringPin the ranking to one source
limitintegerMaximum items to return (1-100)
orderstringdesc for highest-first, asc for lowest-firstcurl "https://api.africa-api.com/v1/indicators/gdp_current_usd/rankings" \
-G \
-d "year=2024" \
-d "limit=5" \
-H "Authorization: Bearer $AFRICA_API_KEY"{
"data": {
"indicator": {
"key": "gdp_current_usd",
"name": "GDP (Current USD)",
"unit": "usd"
},
"year": 2024,
"rankings": [
{
"rank": 1,
"country_code": "ng",
"country_name": "Nigeria",
"value": 363845000000,
"source": "world_bank_wdi"
},
{
"rank": 2,
"country_code": "za",
"country_name": "South Africa",
"value": 337512000000,
"source": "world_bank_wdi"
}
]
}
}