Reference
Data
Query African indicators, latest values, and time series across countries, years, categories, and sources.
Canonical Observation Endpoint
/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
Use /v1/countries/{country_code}/signals instead when you want a compact latest snapshot without composing the query yourself.
Common category values now include:
demographicseconomyinfrastructureenergyclimatehealtheducationagriculture
country_codestringcountry_codesstringmetric_keystringmetric_keysstringcategorystringsourcestringyearintegerstart_yearintegerend_yearintegerlatestbooleanlimitintegercurl "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"Agriculture Query Example
curl "https://api.africa-api.com/v1/data?country_code=ng&metric_key=maize_production_tonnes&start_year=2020&end_year=2024" \
-H "Authorization: Bearer $AFRICA_API_KEY"Energy Query Example
curl "https://api.africa-api.com/v1/data?country_code=ke&category=energy&latest=true" \
-H "Authorization: Bearer $AFRICA_API_KEY"Climate Query Example
curl "https://api.africa-api.com/v1/data?country_code=za&category=climate&latest=true" \
-H "Authorization: Bearer $AFRICA_API_KEY"Transport Query Example
curl "https://api.africa-api.com/v1/data?country_codes=eg,ke,za&metric_key=air_transport_passengers&year=2023" \
-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
Common Query Patterns
- Use
country_codewhen you need one country. - Use
country_codeswhen you need a comparison set. - Use
latest=truewhen you only need the most recent observation per metric. - Use
source=when your application needs a specific dataset instead of the default canonical result.
Signals
Use country signals for a compact current snapshot across indicators, FX, local prices, transport, grid conditions, climate, humanitarian displacement, disaster alerts, markets, trade, and government context.
Indicators
Discover available metrics, inspect coverage, and request country rankings from Africa API.