Open Data API

The Aso Rock Index Open Data API. Five static JSON endpoints exposing every dataset on this site, governance, GDP, debt, and election data from 1996 to the present, under a Creative Commons attribution licence. No keys, no rate limits, CORS-friendly. Built for journalists, researchers, and civic-tech projects.

Endpoints

Static JSON · regenerated on deploy
GET /api/timeline.json 29 rows · 1996 to 2024

Annual macro indicators, GDP, governance, sectors, inflation, FDI, telecoms.

{
  "meta": { "fields": { "gdp": "constant 2015 US$B", … } },
  "data": [
    { "year": 1996, "gdp": 161.1, "gov": -1.225, … },
    { "year": 2024, "gdp": 540.9, "gov": null, "govReestimated": -1.082, … },
    …
  ]
}
GET /api/presidents.json 5 administrations

Per-president aggregates, GDP added, per-capita change, governance averages, full URL.

{
  "data": [
    { "key": "obasanjo", "name": "Olusegun Obasanjo", "term": "1999-2007",
      "gdpAdded": 138.6, "gdpCagr": 7.7, "url": "/obasanjo-record.html" },
    …
  ]
}
GET /api/debt.json 29 yrs + 5 admins · through 2024

External debt stock, debt service paid, gov-debt-to-GDP, by year and by president.

{
  "timeline":    [{ "year": 2023, "extDebt": 1.025e11, … }, …],
  "byPresident": [{ "key": "buhari", "extAdded": 5.8e10, "extPct": 129.1, … }, …]
}
GET /api/elections.json 7 elections · 1999 to 2023

Top-three candidate results, party, votes, percentage, margin, turnout.

{
  "data": [
    { "year": 2023, "winner": "Bola Tinubu", "winnerPct": 36.61,
      "runnerUp": "Atiku Abubakar", "third": "Peter Obi", … },
    …
  ]
}

List of all endpoints with row counts. Start here if you're discovering the API.

Using the API

Examples

JavaScript / browser

const res = await fetch('https://asorockindex.org/api/debt.json');
const { timeline, byPresident } = await res.json();
console.log(byPresident.find(p => p.key === 'buhari'));
//   → { name: "Muhammadu Buhari", extAdded: 58.1e9, extPct: 129.1, … }

Python

import requests, pandas as pd
df = pd.DataFrame(requests.get(
    'https://asorockindex.org/api/timeline.json'
).json()['data'])
df.set_index('year')[['gdp', 'gov']].tail()

Shell / curl

curl -s https://asorockindex.org/api/elections.json | jq '.data[] | {year, winner, winnerPct}'

License & citation

All endpoints are released under Creative Commons Attribution 4.0 (CC BY 4.0). You may share, adapt, and use commercially, including for journalism. We just ask for a credit.

Suggested citation: The Aso Rock Index, https://asorockindex.org/api

Stability & updates

  • URLs and field names are stable. We only make additive changes; breaking changes will move to /api/v2/.
  • Endpoints regenerate on every Netlify deploy from the same source data as the rest of the site.
  • Underlying data refreshes on its own cadence; check /api/version.json for the last build time.

Found a bug or want a new endpoint?

Open an issue at github.com/kossisoroyce/aso-rock-index, or email [email protected].