World Bank Data Scraper – Indicators by Country & Year
Pricing
from $2.00 / 1,000 result rows
World Bank Data Scraper – Indicators by Country & Year
Export World Bank development indicators by country and year from the official World Bank Open Data API: GDP, population, unemployment, CO2, inflation and 1400+ more. Public API, no key.
Turn any of the World Bank's 1400+ development indicators into a tidy country-year table — from the official open data API, not from scraping data.worldbank.org page by page.
The World Bank Open Data portal publishes GDP, population, unemployment, inflation, CO2 emissions, life expectancy, literacy, trade and hundreds of other indicators for around 200 economies, with series that reach back to 1960. It is one of the most widely used free economic datasets in the world.
This Actor queries the official api.worldbank.org/v2 JSON API and returns one flat row per indicator / country / year: the code and name of the indicator, the country with its region and income group, the year, the value and the observation status.
Why this Actor
| Typical scrapers | This Actor | |
|---|---|---|
| Access | Click the portal, export per country | One query returns every country at once |
| Data source | Website exports and dashboards | Official api.worldbank.org/v2 JSON API |
| Country context | You join regions and income groups yourself | Region, income group and ISO2 code included |
| Shape | Portal CSV with its own column order | Fixed 11-column schema, newest year first |
| API key | Not needed on the site | Not needed here either — anonymous public access |
What you get
One dataset item per indicator / country / year observation.
| Field | Type | Description |
|---|---|---|
indicator_id | string | World Bank indicator code, e.g. NY.GDP.MKTP.CD. |
indicator_name | string | Human-readable indicator name, e.g. GDP (current US$). |
country_code | string | ISO 3166-1 alpha-3 country code, e.g. CHN. Aggregates use World Bank codes such as WLD or EAS. |
country_name | string | Country or aggregate name as published by the World Bank. |
country_iso2 | string | ISO 3166-1 alpha-2 code from the World Bank country directory. Empty for aggregates and when the directory could not be loaded. |
region | string | World Bank region, e.g. East Asia & Pacific. Aggregates are labelled Aggregates. |
income_level | string | World Bank income group, e.g. High income, Upper middle income, Low income. |
date | string | Reference year of the observation, YYYY. |
value | number | The indicator value in the unit reported below. Empty when the World Bank holds no figure for that country-year. |
unit | string | Unit reported by the API for the indicator, when the World Bank supplies one. |
obs_status | string | Observation status flag used by the World Bank for estimated or provisional values. Empty for ordinary observations. |
value-- Kept as a number so it can be charted straight away. The World Bank leaves the field null for country-years it has no figure for; those rows come back with an empty value rather than a zero, so a missing figure is never mistaken for a real 0.region-- Read from the World Bank country directory, not guessed. Rows whose region is Aggregates are regional or income-group totals such as East Asia & Pacific, Sub-Saharan Africa or World — switch onexcludeAggregatesto keep only real countries.obs_status-- The API's own flag for provisional or estimated values. Almost every row is empty here; when it is set, treat the figure as an estimate.
Input
| Parameter | Type | Default | Description |
|---|---|---|---|
indicator | string | NY.GDP.MKTP.CD | Required. World Bank indicator code, e.g. NY.GDP.MKTP.CD (GDP, current US$), NY.GDP.PCAP.CD (GDP per capita), SP.POP.TOTL (population), SL.UEM.TOTL.ZS (unemployment %), FP.CPI.TOTL.ZG (inflation %), EN.ATM.CO2E.PC (CO2 per capita). Any of the 1400+ codes from the World Bank indicator list works. |
countries | string | all | ISO codes separated by commas, e.g. CHN,USA,IND,DEU — or all for every country and aggregate the World Bank publishes. Aggregates such as East Asia & Pacific are included unless you turn on excludeAggregates. |
dateRange | string | 2020:2024 | A single year (2024) or a range (2015:2024). Leave empty for every year the World Bank holds for that indicator — for GDP that goes back to 1960. |
maxResults | integer | 200 | Stop after this many country-year rows have been collected. 200 rows is about 40 countries over five years. |
excludeAggregates | boolean | false | When on, rows whose region is Aggregates (East Asia & Pacific, Sub-Saharan Africa, World, income groups …) are dropped and only real countries remain. Useful when you want to average or map the data. |
A note on indicator
The code decides everything. NY.GDP.MKTP.CD is GDP in current US dollars, NY.GDP.PCAP.CD GDP per capita, SP.POP.TOTL total population, SL.UEM.TOTL.ZS unemployment as a share of the labour force, FP.CPI.TOTL.ZG inflation, EN.ATM.CO2E.PC CO2 emissions per capita, SP.DYN.LE00.IN life expectancy. The full list is browsable at data.worldbank.org/indicator — the code is shown on each indicator page.
A note on dateRange
Use 2015:2024 for a decade, 2024 for one year, or leave it empty for the whole series. Older series are sparse: GDP runs back to 1960, most social indicators start around 1990, and the most recent year is often missing for smaller economies.
A note on maxResults
Rows are collected newest year first and then cut at this number. A global query over ten years is roughly 2000 rows, so raise the limit if you want the full set.
Usage examples
1. GDP of the largest economies, 2015–2024
{"indicator": "NY.GDP.MKTP.CD","countries": "USA,CHN,JPN,DEU,IND,GBR,FRA,BRA","dateRange": "2015:2024","maxResults": 100,"excludeAggregates": true}
2. World population, every economy, latest years
{"indicator": "SP.POP.TOTL","countries": "all","dateRange": "2020:2024","maxResults": 1000,"excludeAggregates": false}
3. CO2 emissions per capita for a single country, full history
{"indicator": "EN.ATM.CO2E.PC","countries": "CHN","dateRange": "","maxResults": 100,"excludeAggregates": true}
Run it on an Apify Schedule — monthly for slow indicators like GDP and literacy, yearly for the December revision cycle. Push the dataset to a Google Sheet, Airtable, BigQuery or a dashboard, and key your rows on country_code + date + indicator_id, which together are unique.
Data notes
- Rows come out sorted by year descending and then alphabetically by country, so the newest data is always at the top of the dataset.
- The country directory request gives you region, income group and ISO2 code in one extra call. If it fails, the run still succeeds and those three columns are simply empty.
- The World Bank publishes the same series under slightly different codes across vintages, and revises history in place; the value you see today for 2020 can differ from the value published a year ago.
Pricing
This Actor uses pay-per-event pricing. You only pay for what you actually get.
| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.002 | Once per run |
| Result row | $0.002 per row | For every row saved to the dataset |
That works out to $2 per 1,000 rows. A typical run returning 50 rows costs about $0.10 in total.
No subscription is required. You can cap your spend with the max cost per run setting in Apify Console, and an empty or invalid input charges only the start event.
FAQ
Do I need an API key?
No. The World Bank Open Data API is public and anonymous, with no registration and no quota to configure.
Is this data free to use?
Yes. World Bank Open Data is released under CC BY 4.0 — you may use, redistribute and build on it, including commercially, with attribution to the World Bank.
How do I find the indicator code I want?
Open the indicator page on data.worldbank.org and look at the code printed under the indicator name, or search the Data Catalog. Codes look like NY.GDP.MKTP.CD.
Why are values missing for some years?
Because the World Bank has no reported figure for that country-year. These rows are returned with an empty value, not with a zero, and you can filter them out with a single step.
Can I get several indicators in one run?
Run the Actor once per indicator and join the datasets on country_code + date. Each run then stays fast and the schema stays flat.
Related Actors
More data tools from the same publisher:
- App Store Reviews Scraper - App Store and Steam user reviews with ratings, versions and dates.
- EU Tenders Scraper - EU public procurement notices from the official TED API.
- ClinicalTrials.gov Scraper - Clinical trial records with phase, status and sponsor.
- Federal Register Scraper - US Federal Register documents, rules and notices.
- arXiv Scraper - arXiv papers with authors, abstracts and PDF links.
- Hacker News Scraper - Hacker News stories by keyword, top ranking or newest.
- Weather Scraper - Weather forecast and history for any city worldwide.
Disclaimer
All data is retrieved in real time from the World Bank Open Data API v2 (api.worldbank.org), the World Bank's own public open data service. This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the World Bank Group.
World Bank indicators are estimates compiled from national statistics offices and may be revised, re-based or withdrawn. Verify anything financially significant against the indicator page on data.worldbank.org. This dataset is an analysis aid, not investment or policy advice.