World Bank Scraper · Indicators, Countries, Values & Series avatar

World Bank Scraper · Indicators, Countries, Values & Series

Pricing

from $0.70 / 1,000 record returneds

Go to Apify Store
World Bank Scraper · Indicators, Countries, Values & Series

World Bank Scraper · Indicators, Countries, Values & Series

Scrape World Bank global development indicators, country GDP, population, inflation, economic series, and historical annual values. Fast HTTP API scraper with pay-per-event pricing.

Pricing

from $0.70 / 1,000 record returneds

Rating

0.0

(0)

Developer

Tarek Etman

Tarek Etman

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

reapX — public sources in, addressable records out

World Bank Scraper · Indicators, Countries, Values & Series

Scrape official World Bank global development indicators, country economic metrics, GDP figures, population stats, inflation rates, labor metrics, and multi-year time-series datasets directly from the World Bank Open Data REST API.

Maintained by reapX. Every row cites the Apify run that produced it — nothing is inferred, modelled or filled in, and a field absent from the source is absent from the row. The extracted archive for this source is browsable at reapx.dev/data/world-bank-scraper/ and mirrored as an open dataset on Hugging Face and Kaggle. Questions: reapxdev@proton.me


Features & Capabilities

  • Official Source: Direct REST API integration with World Bank Open Data API (api.worldbank.org/v2).
  • Comprehensive Coverage: Access over 16,000 indicator series covering 260+ countries, territories, and regional/income aggregates.
  • Flexible Filters: Filter by indicator code, 2-character / 3-character ISO country code, regional cohorts (EAP, ECA, LAC, SSA, EUU, OED), income groups (HIC, UMC, LMC, LIC), or single years / date ranges (2010:2024).
  • Entity Addressable: Output rows include sanitized companyName (country or aggregate entity name) ensuring total 1:1 entity page generation and data linkage.
  • Pay-Per-Event Pricing: Pay purely per complete record returned ($0.001/record with tier discounts). Failed requests or empty queries are never charged.
  • High Performance: Lightweight HTTP scraper (no browser overhead) capable of streaming hundreds of indicator records per second.

⬇️ Input

The actor accepts clean structured input to target specific indicators, country cohorts, and time horizons.

ParameterTypeDefault / PrefillDescription
indicatorStringNY.GDP.MKTP.CDWorld Bank indicator code (e.g. NY.GDP.MKTP.CD for GDP, SP.POP.TOTL for Population, FP.CPI.TOTL.ZG for Inflation).
countryStringallCountry ISO code (USA, DEU, CHN), regional aggregate (EAP, EUU, SSA), income level (HIC, LIC), or all.
dateString2015:2024Single year (2023) or range (2010:2024) controlling temporal scope.
sourceInteger2World Bank catalog source ID (2 for World Development Indicators WDI).
max_resultsInteger500Hard cap on total indicator observation records to return.

Input Example (JSON)

{
"indicator": "NY.GDP.PCAP.CD",
"country": "all",
"date": "2015:2024",
"source": 2,
"max_results": 1000
}

⬆️ Output

All extracted records are pushed directly to the run's default dataset. Each row corresponds to a single annual observation for a country/entity.

Field NameTypeExampleDescription
companyNameStringUnited StatesPrimary addressable entity key (country or aggregate region name).
countryCodeStringUS2-letter or aggregate region code.
countryIso3CodeStringUSA3-letter ISO 3166-1 alpha-3 code.
indicatorIdStringNY.GDP.PCAP.CDWorld Bank indicator series code.
indicatorNameStringGDP per capita (current US$)Human-readable series title.
yearString2023Four-digit observation year.
valueNumber81632.25Recorded numerical value (or null if missing in source).
unitString""Unit of measurement if specified by World Bank.
obsStatusString""Source observation status tag.
decimalInteger0Decimal precision reported by World Bank.

Output Row Example (JSON)

{
"companyName": "United States",
"countryCode": "US",
"countryIso3Code": "USA",
"indicatorId": "NY.GDP.PCAP.CD",
"indicatorName": "GDP per capita (current US$)",
"year": "2023",
"value": 81632.251953125,
"unit": "",
"obsStatus": "",
"decimal": 0
}

How it works

  1. API Initialization: The scraper queries https://api.worldbank.org/v2/country/{country}/indicator/{indicator} using HTTP requests.
  2. Metadata Count: Performs an initial lightweight metadata query to verify total matching records and validate parameters before scraping.
  3. Paginated Retrieval: Streams items page-by-page (500 items per request) with automatic exponential backoff on network errors or 429/5xx status codes.
  4. Data Normalization: Cleans and sanitizes country labels into companyName values matching exact entity page regex specifications.
  5. Pay-Per-Event Emission: Pushes records to the default dataset while executing atomic pay-per-event micro-charging ($0.001 per record).

❓ FAQ

What indicators can I scrape?

You can scrape any valid World Bank indicator code from the World Development Indicators (WDI) catalog or other databases. Popular examples include:

  • NY.GDP.MKTP.CD: GDP (current US$)
  • NY.GDP.PCAP.CD: GDP per capita (current US$)
  • NY.GDP.MKTP.KD.ZG: GDP growth (annual %)
  • SP.POP.TOTL: Total Population
  • FP.CPI.TOTL.ZG: Inflation rate (annual %)
  • SL.UEM.TOTL.ZS: Unemployment rate (% of labor force)
  • EN.ATM.CO2E.PC: CO2 emissions (metric tons per capita)
  • SP.DYN.LE00.IN: Life expectancy at birth (years)

How is pricing calculated?

This actor operates on Pay-Per-Event pricing. You are charged $0.001 per complete record pushed to the dataset. Platform compute usage is absorbed. Failed requests, rate limits, or queries matching 0 rows incur zero charge.

How do I filter by specific country or region?

Set the country parameter to a 3-letter ISO code (e.g. USA, DEU, JPN, BRA) or a regional cohort code (e.g. EAP for East Asia & Pacific, EUU for European Union, HIC for High Income countries). Leave as all to pull all available nations and aggregates.

Can I run this scraper programmatically?

Yes! Use the Apify Python SDK, JavaScript SDK, or standard HTTP client to invoke this actor via the Apify API.

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("reapx/world-bank-scraper").call(run_input={
"indicator": "NY.GDP.MKTP.CD",
"country": "all",
"date": "2020:2024",
"max_results": 500
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["companyName"], item["year"], item["value"])

💬 Your feedback

Have feature suggestions, bug reports, or requests for custom dataset extractions? Contact the maintainers directly at reapxdev@proton.me or visit reapx.dev.


Disclaimer: Unofficial - not affiliated with World Bank. Collects public data only. reapx. Contact reapxdev@proton.me.

🧪 Example input

A real, runnable configuration — this is an actual input this Actor has run with.

{
"indicator": "NY.GDP.MKTP.CD",
"country": "all",
"date": "2020:2024",
"source": 2,
"max_results": 500
}

📄 Sample output

One real row from a real run of this Actor, unedited.

{
"companyName": "Africa Eastern and Southern",
"countryCode": "ZH",
"countryIso3Code": "AFE",
"indicatorId": "NY.GDP.MKTP.CD",
"indicatorName": "GDP (current US$)",
"year": "2022",
"value": 1226461319482.05,
"unit": "",
"obsStatus": "",
"decimal": 0
}

⚠️ Run outcomes and error handling

This Actor reports what happened in the run's status message, and it always keeps whatever it collected. These are the outcomes you can get and what each one means.

OutcomeWhat it means
SuccessRows were returned and you were charged record-returned at $0.001 per row.
No matchesThe source returned nothing for your filters. Nothing is charged. Widen the date window or drop a filter.
Partial - source refusedThe source rate-limited or refused some requests. The affected items are skipped and named in the log, and everything already collected is still pushed. A block never discards a run's work.
Rejected filterThe source itself rejected the filter combination. The run fails fast with the source's own reason and nothing is charged.

What is guaranteed either way

  • Every row is pushed as it is built, not buffered to the end of the run. Anything that buffers output loses everything to a timeout, a block or a migration; this does not.
  • A field absent from the source is absent from the row. Nothing is inferred, modelled or filled in to make a row look complete.