World Bank Indicators Scraper icon

Developer tools

World Bank Indicators Scraper — GDP, Population & More

Multi-indicator, multi-country World Bank Open Data export flattened to one clean row per country, indicator and year — no wrestling with the API's quirky pagination envelope or sparse null-heavy series.

Free Apify credit covers a first run. No credit card to try.

What this Actor scrapes

The World Bank's Open Data API is free and keyless, but its wire format is built for the World Bank's own tooling, not for a spreadsheet. A successful response is a two-element array — pagination metadata bolted onto a row list, not a normal JSON object — and an invalid indicator code answers with HTTP 200 and a silent error block instead of a 404. This Actor fetches any mix of indicator codes across any countries and any date range, and hands back one flat row per country/indicator/year — ready for a pivot table, not a parser rewrite.

What we handle for you

  • We parse the API's two-shape response envelope so a paging bug or a bad indicator code never corrupts your dataset.
  • We skip an invalid indicator code or an empty country series with a clear warning — one bad code never kills the rest of your run.
  • We retry 429/5xx responses with exponential backoff and honour Retry-After.
  • We keep every null observation — most (country, year) pairs genuinely have no reported value, and we ship that as a real null, not a dropped row.

Use cases

  • Build a "GDP + population + CO2 for 200 countries × 25 years" master table for a macro research note.
  • Pull a development-finance dashboard's underlying indicators without hand-copying from the World Bank's website.
  • Feed an ESG or country-risk model with the World Bank's own reported figures, refreshed on a schedule.
  • Fact-check a journalism piece against the official series instead of a secondary aggregator.

Input

Paste this into the Apify Console, or send it as the run input over the API. Proxy settings are on by default; you rarely need to touch them.

FieldTypeRequiredWhat it does
indicatorCodes array no World Bank indicator codes to fetch (one paginated series per code), e.g. NY.GDP.MKTP.CD, SP.POP.TOTL, EN.ATM.CO2E.PC. Look codes up at data.worldbank.org/indicator.
countryCodes string no all for every country, or a ;-separated ISO list, e.g. US;CN;DE.
dateRange string no Optional YYYY or YYYY:YYYY range, e.g. 2000:2024. Leave empty for the API's full history.
includeSourceNote boolean no Attach each indicator's methodology note and source organization to every row (one extra request per unique indicator, not per row).
maxResults integer no Stop after this many rows. Each row is one billed result event.
{
  "indicatorCodes": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL"
  ],
  "countryCodes": "US;CN;DE",
  "dateRange": "2015:2024",
  "includeSourceNote": false,
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}

Output

One row per result, schema-validated before it is written. Export JSON, CSV, Excel or XML from the run, or read it over the API.

country_idcountry_nameindicator_idindicator_nameyearvalueunit

{
  "country_id": "USA",
  "country_iso3": "USA",
  "country_name": "United States",
  "region": null,
  "income_level": null,
  "indicator_id": "NY.GDP.MKTP.CD",
  "indicator_name": "GDP (current US$)",
  "year": 2022,
  "value": 25462700000000.0,
  "unit": "",
  "obs_status": "",
  "decimal": 0,
  "scale": null,
  "source_note": null,
  "source_organization": null
}

Pricing

EventPriceWhen
Actor start$0.20Once per run, covers warm-up and proxy session setup.
Result emitted$0.0020Per result written to the dataset.

You pay only for results that land. Cap any run with maxTotalChargeUsd. See pricing & billing for worked examples.

Limitations

  • region and income_level are not enriched from the country-metadata endpoint in this version — both ship as null. A future version will cross-reference /v2/country to fill them in.
  • This is a current snapshot, not a historical-revision tracker — the World Bank periodically restates past years, and we fetch whatever the API reports at run time.
  • We pass through the API's raw value and unit as-is — no currency conversion or unit normalization.

FAQ

Do I need an API key?
No. The World Bank's Open Data API is free and keyless. We still send a polite, identifiable User-Agent so runs stay good API citizens.
Why is `value` null for so many rows?
Most countries don't report every indicator for every year — that's a real gap in the underlying data, not something we dropped. We ship the null so your analysis sees the true coverage.
What happens if I typo an indicator code?
The API answers a typo'd code with HTTP 200 and a hidden error block — we detect that, skip the code with a warning, and keep fetching every other code you asked for.

Ready to run it?

Open the listing on Apify, paste the input above, and watch rows land. If it ever breaks, it is our problem before it is yours.

Related Actors

Teams that run this also run