africaAPI

Use Cases

African Indicators and Time Series API

Query African indicators, latest values, rankings, and time series across countries and categories with Africa API.

Use this part of Africa API when your product needs historical data, latest values, indicator discovery, or country rankings.

This is the best fit for:

  • dashboards and analytics products
  • research workflows
  • country comparisons
  • scoring models and monitoring systems
  • time-series visualizations

Start with /v1/indicators when you need discovery. Start with /v1/data when you already know the metric you want.

Start With These Endpoints

Example: Discover Climate Indicators

curl "https://api.africa-api.com/v1/indicators?category=climate&has_data=true" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

This is a good first step when you know the topic area but not the exact metric keys yet.

Example: Compare GDP Across Countries

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"

Use /v1/data for side-by-side comparisons when you already know the metric key and the slice you want.

Example: Get The Latest Value For One Metric

curl "https://api.africa-api.com/v1/data?country_code=ke&metric_key=population_total&latest=true" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

This is the simplest pattern for “give me the most recent known value for this metric.”

Example: Rank Countries By One Indicator

curl "https://api.africa-api.com/v1/indicators/gdp_current_usd/rankings?year=2024&limit=10" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

Rankings are useful when you need leaderboards, comparison tables, or shortlist screens.

When To Use data Vs indicators

  • Use /v1/indicators to discover what exists.
  • Use /v1/indicators/{metric_key} to inspect one metric and its metadata.
  • Use /v1/data to fetch observations for charts, tables, and analysis.
  • Use /v1/indicators/{metric_key}/rankings when you need sorted country comparisons.
  • Use country signals when you want a compact country snapshot instead of a metric-driven query.

Categories Currently Covered

Common categories include:

  • demographics
  • economy
  • agriculture
  • energy
  • climate
  • health
  • education
  • infrastructure

On this page