Start Here

Quickstart

Create an API key and make your first authenticated request for African country data.

Create an API key, then request Nigeria's country signals. The examples below use a shell with curl.

Create an API key

Open the dashboard, create an account or sign in, then generate an API key.

Export your API key

export AFRICA_API_KEY="your_api_key_here"

Fetch a country snapshot

curl "https://api.africa-api.com/v1/countries/ng/signals" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

The response combines available observations for Nigeria. Check the observation dates: sources update on different schedules. Coverage lists the topics available by country.

Query one indicator

Use /v1/data when you need a specific metric. This request asks for the latest available population observation for Kenya:

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

latest=true selects the most recent stored observation; it does not imply a measurement from today. See Data for year filters and time-series queries.

Data routes require an API key. Keep production keys on your server and out of public client-side code. See Authentication.

Try another route

For reference fields such as a country's name and codes:

curl "https://api.africa-api.com/v1/countries/ng" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

For a country trade overview:

curl "https://api.africa-api.com/v1/trade/overview/ng?top_limit=5" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

Handle errors and quotas

A missing or invalid key returns 401. A 429 can mean a per-minute limit or an exhausted monthly quota; the retry behavior differs. See Errors and Rate limits.

On this page