Reference
Data
Query canonical indicator observations across countries, years, categories, and sources.
Canonical Observation Endpoint
GET
/v1/data/v1/data is the canonical read layer for country-level observations.
Use it for:
- latest country metrics
- time-series queries
- multi-country comparisons
- category-wide slices
- source-specific reads
Common category values now include:
demographicseconomyinfrastructurehealtheducation
country_codestringOne country code
country_codesstringComma-separated country codes
metric_keystringOne metric key
metric_keysstringComma-separated metric keys
categorystringIndicator category filter
sourcestringSource code filter
yearintegerExact year
start_yearintegerInclusive start year
end_yearintegerInclusive end year
latestbooleanReturn only the latest observation per country and metric
limitintegerMax rows to return (1-1000)
curl "https://api.africa-api.com/v1/data" \
-G \
-d "country_code=ke" \
-d "metric_key=population_total" \
-d "start_year=2020" \
-d "end_year=2024" \
-H "Authorization: Bearer $AFRICA_API_KEY"{
"data": [
{
"country_code": "ke",
"country_name": "Kenya",
"metric_key": "population_total",
"metric_name": "Total Population",
"year": 2020,
"period": "annual",
"value": 52217334,
"unit": "persons",
"source": "world_bank_wdi",
"value_status": "reported",
"retrieved_at": "2026-03-07T12:10:14Z"
},
{
"country_code": "ke",
"country_name": "Kenya",
"metric_key": "population_total",
"metric_name": "Total Population",
"year": 2024,
"period": "annual",
"value": 55100586,
"unit": "persons",
"source": "world_bank_wdi",
"value_status": "reported",
"retrieved_at": "2026-03-07T12:10:14Z"
}
],
"meta": {
"total": 5,
"limit": 100
}
}Latest Multi-Country Query
curl "https://api.africa-api.com/v1/data?country_codes=ng,ke,za&metric_key=gdp_current_usd&year=2024" \
-H "Authorization: Bearer $AFRICA_API_KEY"Education Query Example
curl "https://api.africa-api.com/v1/data?country_code=ke&category=education&latest=true" \
-H "Authorization: Bearer $AFRICA_API_KEY"Canonical Source Behavior
When more than one source publishes the same metric, /v1/data returns one canonical observation by default. Use source= if you need to pin the response to a specific dataset.
Validation Rules
yearcannot be combined withstart_yearorend_yearstart_yearmust be less than or equal toend_yearlimitis capped at1000