Reference
Data
Query African indicators, latest values, and time series across countries, years, categories, and sources.
Migrating an api/join query from api.dataafrica.io? See the DataAfrica migration guide for /v1/data mappings and coverage differences.
Data is provided for informational purposes. Observations are aggregated from third-party sources (World Bank, UN, IMF, and others) and may contain errors, omissions, or reporting lags. Check the source field on each observation and verify against it before relying on a value for financial, compliance, or other consequential decisions. See Sources for provenance and the Terms for details.
Query observations
/v1/data/v1/data returns country-level observations filtered by metric, source, category, and year.
Use it for:
- latest country metrics
- time-series queries
- multi-country comparisons
- observations within a category
- observations from a specified source
Use /v1/countries/{country_code}/signals instead when you want a compact latest snapshot without composing the query yourself.
Common category values 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
}
}Compare countries for one year
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"For metric lists and domain-specific examples, see Energy, Climate, and Transport.
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.
Estimates And Dataset Versions
Some sources publish coded estimates rather than single reported values. When the source provides them, observations include:
estimate_low: the source's low estimateestimate_high: the source's high estimatedataset_version: the source release used for the observation
These fields are optional. Treat value as the best estimate only when
value_status is estimated, and retain the low/high range when presenting or
modeling uncertainty.
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.