africaAPI

Reference

Indicators

Discover available metrics, inspect coverage, and request country rankings from Africa API.

List Indicators

GET/v1/indicators

Lists indicator definitions available through the public API.

categorystring
Filter by metric category such as demographics, economy, infrastructure, health, education, or markets
sourcestring
Filter to a specific source code such as world_bank_wdi, who_gho, or unesco_uis
has_databoolean
Return only indicators that currently have observations
Request
curl "https://api.africa-api.com/v1/indicators?category=health&has_data=true" \
  -H "Authorization: Bearer $AFRICA_API_KEY"
Response
{
  "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.

Request
curl "https://api.africa-api.com/v1/indicators/median_age_years" \
  -H "Authorization: Bearer $AFRICA_API_KEY"
Response
{
  "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}/rankings

Returns a cross-country ranking for one metric and year.

yearintegerrequired
Target year
sourcestring
Pin the ranking to one source
limitinteger
Maximum items to return (1-100)
orderstring
desc for highest-first, asc for lowest-first
Request
curl "https://api.africa-api.com/v1/indicators/gdp_current_usd/rankings" \
  -G \
  -d "year=2024" \
  -d "limit=5" \
  -H "Authorization: Bearer $AFRICA_API_KEY"
Response
{
  "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"
      }
    ]
  }
}

On this page