africaAPI

Reference

Elections

Query African election events, country election overviews, and candidate-level result rows as a dedicated elections domain.

Elections In Africa API

Africa API now exposes elections as a dedicated domain alongside government history.

Current source:

  • wikidata_elections

Use:

  • GET /v1/elections
  • GET /v1/elections/upcoming
  • GET /v1/elections/country/{country_code}
  • GET /v1/elections/{election_wikidata_id}
  • GET /v1/elections/results/{election_wikidata_id}

What This Covers

The first elections slice is built around:

  • presidential elections
  • parliamentary elections
  • general elections
  • election dates and office context
  • winners when available
  • country election timelines
  • candidate-level result rows where Wikidata has them

This is intentionally separate from scalar indicator data.

Country Election Overview Example

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

Example response shape:

{
  "data": {
    "country": {
      "code": "ng",
      "name": "Nigeria",
      "region": "West Africa"
    },
    "latest_election": {
      "wikidata_id": "Q123",
      "country_code": "ng",
      "country_name": "Nigeria",
      "name": "2023 Nigerian presidential election",
      "election_scope": "presidential",
      "election_date": "2023-02-25",
      "year": 2023,
      "office_name": "President of Nigeria",
      "election_status": "completed",
      "successful_candidate_name": "Bola Tinubu",
      "source": "wikidata_elections"
    },
    "upcoming_elections": [],
    "recent_elections": []
  }
}

Election List Example

curl "https://api.africa-api.com/v1/elections?country_code=za&election_scope=parliamentary&limit=20" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

Election Detail Example

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

Election Results Example

curl "https://api.africa-api.com/v1/elections/results/Q123?limit=20" \
  -H "Authorization: Bearer $AFRICA_API_KEY"

How It Fits The Government Domain

  • Government covers current leaders, historical terms, and country government overviews
  • Elections covers election events and results
  • country profiles now embed the latest election inside the compact government block

On this page