Science & Math — entry 028 of 28
World Bank
The World Bank's Indicators API gives free, keyless REST access to the World Development Indicators dataset — thousands of economic, social, and environmental indicators across nearly 300 countries and regions, spanning six decades. Responses are paginated JSON or XML, covering countries, regions, income levels, lending types, topics, sources, and the indicator series themselves.
The World Bank Indicators API is a keyless REST endpoint over the World Development Indicators dataset. Every successful response is a two-element JSON array: a pagination object first, then the actual data array — a shape that trips up naive `response.data` assumptions from other REST APIs.
GreatAPIs Score
Auth quickstart
- No account or key is required — every request below is a public, unauthenticated GET, reconfirmed live this run.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Fetch a country's latest value for an indicator
GEThttps://api.worldbank.org/v2/country/br/indicator/SP.POP.TOTL?format=json&per_page=1
[{"page":1,"pages":66,"per_page":1,"total":66,"sourceid":"2","lastupdated":"2026-07-13"},[{"indicator":{"id":"SP.POP.TOTL","value":"Population, total"},"country":{"id":"BR","value":"Brazil"},"countryiso3code":"BRA","date":"2025","value":212812405,"unit":"","obs_status":"","decimal":0}]]Captured byte-for-byte from this run's live probe, no truncation. Brazil's 2025 total population (212,812,405) and `lastupdated: 2026-07-13` reflect whatever the World Bank's dataset held at probe time, not a curated pick.
Developer reference
https://api.worldbank.org/v2Gotchas & limits
- `format=json` must be set explicitly — the default (no `format` param at all) is XML, not JSON. Confirmed live this run: the identical `/country/br/indicator/SP.POP.TOTL?per_page=1` call with no `format` parameter returned `content-type: text/xml` and a `<wb:data>` document instead of the JSON array above.
- An unrecognized indicator code does not 404 — it returns HTTP 200 with a single-element array carrying an error message, distinguishable from a real success only by its shape: `[{"message":[{"id":"120","key":"Invalid value","value":"The provided parameter value is not valid"}]}]`, confirmed live this run against `BOGUS.INDICATOR.XYZ`. A real success is always a *two*-element array (pagination object, then data array) — check `Array.isArray(body) && body.length === 2`, not just HTTP status, to detect failure.
- `date` accepts a `start:end` range, not just a single year — a live probe with `date=2020:2022&per_page=5` returned all three years (2020, 2021, 2022) for Brazil's population indicator in one call, with `total: 3` in the pagination object confirming the range was honored, not truncated to one point.
- CORS is open: a live probe with `Origin: https://example.com` returned `access-control-allow-origin: *` on the same indicator query, so it's safe to call directly from browser JS.