# World Bank Scraper: GDP, Inflation & 16,000 Indicators (`recordsdata/world-bank-indicators-scraper`) Actor

Scrape World Bank Open Data: GDP, inflation, population, unemployment, CO2 and 16,000+ indicators for every country since 1960, one row per country-year, plus indicator definitions and a country directory. Export CSV, Excel, JSON, XML. No login or API key. Not billed for empty runs.

- **URL**: https://apify.com/recordsdata/world-bank-indicators-scraper.md
- **Developed by:** [RecordsData](https://apify.com/recordsdata) (community)
- **Categories:** Business, Education
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

<p align="center">
  <img src="https://api.apify.com/v2/key-value-stores/AAm3a1h3Z9nYfrvh9/records/banner?v=3" alt="RecordsData" width="100%" />
</p>

## 🏦 World Bank Scraper: GDP, Inflation & 16,000 Indicators

> **World Bank Scraper downloads World Bank Open Data indicators (GDP, inflation, population, unemployment, CO2 and 16,000+ more) as one row per country and year. Every row can carry region, income level, lending type, capital city, coordinates and the indicator's source and topics, so no join is needed. Filter by region, income group or lending type, or drop aggregates. Get CSV, Excel, JSON or XML. No login and no API key. Data comes from the official World Bank API. Priced per row, never for errors or empty results.**

World Bank Scraper turns the Bank's official open API into analysis-ready panels. In a verified cloud run on 2026-10-03, the inflation indicator `FP.CPI.TOTL.ZG` for the US, Brazil, Mexico and Colombia returned 10 rows in about 3 seconds of run time, with no empty columns. It is built for analysts, journalists, researchers and BI teams that need citable country statistics without writing API code.

### 🔎 What does the World Bank Scraper do?

- Download any indicator by code, for example "Brazil GDP 2000-2024", for several indicators and countries in one run, or `all` for every country and aggregate.
- Enrich every data row with region, income level, lending type, capital city, coordinates, ISO2 code, aggregate flag and the indicator's database, source, description and topics (`enrichRows`, on by default, free).
- Filter countries by region, income level and lending type, or exclude the 79 aggregates; restrict the year range (data starts in 1960).
- Add one definition row per indicator and an optional country directory.
- Skip years with no observation, so you only pay for real values.

There is no only-new or monitoring mode. World Bank data is revised once or twice a year, so each run returns the full requested panel.

### 📋 What data can you extract from World Bank Open Data?

The dataset schema has 32 columns. Fields that do not apply to a row type are omitted instead of being filled with empty values.

| Group | Fields | Notes |
|---|---|---|
| Row type | `recordType` | `data-point`, `indicator-info` or `country` |
| Indicator | `indicatorCode`, `indicatorName` | World Bank code and name |
| Observation | `country`, `iso3`, `year`, `value`, `unit`, `obsStatus`, `decimals` | `unit` and `obsStatus` only when the Bank provides them |
| Country details | `iso2`, `region`, `adminRegion`, `incomeLevel`, `lendingType`, `capitalCity`, `latitude`, `longitude`, `isAggregate` | On every data row when `enrichRows` is on; also in country directory rows |
| Indicator details | `indicatorDatabase`, `indicatorSource`, `indicatorDescription`, `indicatorTopics` | On every data row when `enrichRows` is on |
| Definition rows | `description`, `source`, `topics` | Indicator definition rows only |
| Directory rows | `name` | Country directory rows only |
| Provenance | `url`, `scrapedAt` | Link to data.worldbank.org and ISO timestamp |
| Errors | `error`, `errorType`, `hint` | Only on free error rows |

With `enrichRows` off, data rows keep the compact shape: code, name, country, iso3, year, value, unit, obsStatus, url, scrapedAt.

### 📊 Sample output

A real enriched data row from a local run on 2026-10-09 (GDP, United States, 2023):

```json
{
  "recordType": "data-point",
  "indicatorCode": "NY.GDP.MKTP.CD",
  "indicatorName": "GDP (current US$)",
  "country": "United States",
  "iso3": "USA",
  "iso2": "US",
  "year": 2023,
  "value": 27811517000000,
  "decimals": 0,
  "region": "North America",
  "incomeLevel": "High income",
  "capitalCity": "Washington D.C.",
  "isAggregate": "No",
  "indicatorDatabase": "World Development Indicators",
  "indicatorSource": "Country official statistics, National Statistical Organizations and/or Central Banks...",
  "indicatorDescription": "Gross domestic product is the total income earned through the production of goods and services...",
  "indicatorTopics": ["Economy & Growth"],
  "url": "https://data.worldbank.org/indicator/NY.GDP.MKTP.CD",
  "scrapedAt": "2026-10-09T17:41:46.522Z"
}
```

The source and description texts are shortened here. The `isAggregate` flag is the string "Yes" or "No", and aggregates such as World carry region "Aggregates".

### 💰 How much does it cost to scrape World Bank data?

Pay per event. You are charged only for rows that are saved with a real value.

| Event | What counts | Price (Free plan) |
|---|---|---|
| Data point | One country-year value for a requested indicator | $0.015 each ($15 per 1,000) |
| Metadata row | One indicator definition or one country directory row | $0.010 each |

Worked example for 1,000 results: 1,000 data points cost 1,000 x $0.015 = $15.00 on the Free tier, plus $0.01 for each indicator definition row (for example one indicator: $15.01 in total), or $0.01 per country directory row if you switch it on. Paid Apify plans get tiered discounts (Gold and above: $0.0126 per data point). The 10-row test run above (9 data points and 1 indicator definition) bills $0.145 on the Free tier. You are not charged for failed requests, error rows, rows without a value, or runs that deliver nothing. Set a maximum cost per run and the actor stops cleanly when it is reached.

### 🚀 How to scrape the World Bank API in 3 steps

1. Open the actor and click **Try for free**.
2. Enter indicator codes (default: `NY.GDP.MKTP.CD` and `SP.POP.TOTL`), countries and a year range.
3. Click **Start**, then download the dataset as CSV, Excel, JSON or XML.

### ⚙️ Input

| Field | Default | Meaning |
|---|---|---|
| `indicators` | GDP, population | World Bank codes, one per line |
| `countries` | `all` | ISO2/ISO3 codes or `all`; combines with the filters below |
| `yearFrom`, `yearTo` | 2000, 2026 | Time range, minimum 1960 |
| `skipEmptyValues` | true | Drop country-years with no value |
| `enrichRows` | true | Add country and indicator details to every data row (free) |
| `excludeAggregates` | false | Drop regional and income-group aggregates, keep countries only |
| `regions` | empty (all) | Multi-select: `EAS`, `ECS`, `LCN`, `MEA`, `NAC`, `SAS`, `SSF` |
| `incomeLevels` | empty (all) | Multi-select: `HIC`, `UMC`, `LMC`, `LIC` |
| `lendingTypes` | empty (all) | Multi-select: `IBD` (IBRD), `IDB` (Blend), `IDX` (IDA), `LNX` (Not classified) |
| `includeIndicatorInfo` | true | One definition row per indicator |
| `includeCountryDirectory` | false | Add the country directory |
| `maxItems` | 10 | Cap on billable rows (free plan: 10, paid up to 1,000,000) |

Example:

```json
{
  "indicators": ["FP.CPI.TOTL.ZG"],
  "countries": ["US", "BR", "MX", "CO"],
  "yearFrom": 2018,
  "yearTo": 2024,
  "maxItems": 10
}
```

### 📦 Output

One dataset with three row types and 32 columns in schema order, exportable through the dataset API or the Console. If a valid range has no observations, the run succeeds with zero rows and a status message. If the World Bank rejects the request (unknown indicator code), the run fails with a clear message and nothing is billed.

### ⚖️ World Bank scraper vs alternatives

Competitor features and prices read from their public Apify Store pages on 2026-10-09.

| Capability | This actor | scrapers_lat | chrisp1211 |
|---|---|---|---|
| Coverage | Any of 16,000+ codes, many per run | One indicator per run, all countries | Many indicators and countries per run |
| Output fields | 32 columns | 24 fields | 15 fields |
| Per-row region, income, capital | Yes, free toggle | Yes | Not stated |
| Filters: region, income, lending, aggregates | Yes | Not stated | Not stated |
| Indicator definitions, country directory rows | Yes, optional rows | Definition inline, no directory | Not stated |
| Export | CSV, Excel, JSON, XML | JSON, CSV, Excel | JSON, CSV, Excel, Sheets, HTML |
| Only-new / monitoring | No | Not stated | Not stated |
| Price per 1,000 rows | $15 data, $10 metadata | From $6.80 | $0.40 |

The other three actors I read (glitchbound, themineworks, ninhothedev) also take several indicators and countries, list 9 to 14 fields without region or income columns, and charge $0.40 to $1 per 1,000.

Every rival is cheaper. If you need a bare series and price decides, chrisp1211 or the free World Bank API fits better. If you need one indicator with enrichment at lower cost, scrapers_lat fits. This actor fits when you want many indicators in one run, enrichment on each row, and region, income or lending filters, and you accept paying more. It has no only-new mode.

### 💼 Use cases

Consulting reports, journalism and education with citable values, BI and fintech joins on ISO3 code and year, and multi-country, multi-decade academic panels.

### 🔌 Run via API, schedule and integrations

```bash
curl -X POST "https://api.apify.com/v2/acts/RecordsData~world-bank-indicators-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"indicators":["NY.GDP.MKTP.CD"],"countries":["BR"],"yearFrom":2015,"yearTo":2024}'
```

Use the Apify API or `apify-client` for Node.js and Python, schedule runs, and connect the dataset to Zapier, Make, n8n, Google Sheets or Airbyte.

### 🤖 World Bank scraper MCP server for AI agents (Claude, Cursor, VS Code)

Connect this actor to any MCP client through the Apify MCP server. Use this URL, which exposes only this actor as a tool:

`https://mcp.apify.com?tools=RecordsData/world-bank-indicators-scraper`

Config for clients that take a JSON MCP config:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=RecordsData/world-bank-indicators-scraper"
    }
  }
}
```

Example agent prompt: "Use the World Bank scraper to get inflation (FP.CPI.TOTL.ZG) for the US, Brazil, Mexico and Colombia from 2018 to 2024, then tell me which country had the highest inflation in each year."

Choose this tool when an agent needs World Bank country statistics such as GDP, inflation or population as one row per country and year, with region, income level and indicator details on each row. Every input has a default value, so an agent can start with `{}`; it takes the same input as the actor (`indicators`, `countries`, `yearFrom`, `yearTo`, `enrichRows`, `excludeAggregates`, `regions`, `incomeLevels`, `lendingTypes`, `maxItems`).

### ⚖️ Is it legal to scrape World Bank data?

The actor reads the World Bank's official public API. The data is open and published under the CC BY 4.0 license, so you can reuse it with attribution to the World Bank. It contains no personal data. Check the license terms of each indicator source on data.worldbank.org before redistributing.

### ❓ Frequently asked questions

#### Where do I find World Bank indicator codes?

Open any chart on data.worldbank.org and read the code from the URL, for example `NY.GDP.MKTP.CD` for GDP in current US dollars. Paste codes into the `indicators` field of the World Bank Scraper, one per line. Common codes are `NY.GDP.PCAP.CD`, `FP.CPI.TOTL.ZG`, `SP.POP.TOTL`, `SL.UEM.TOTL.ZS` and `EN.ATM.CO2E.PC`.

#### What does countries = "all" return in the World Bank Scraper?

Setting `countries` to `all` makes the World Bank Scraper request every country plus the World Bank aggregates such as regions and income groups, about 296 series per indicator and year. If you only want individual countries, list their ISO2 or ISO3 codes instead, for example `US`, `BR`, `MX`, which keeps the row count and cost lower.

#### How do I filter World Bank data by region or income level?

Use the `regions`, `incomeLevels` and `lendingTypes` inputs of the World Bank Scraper. Each is a multi-select: regions use codes such as `LCN` for Latin America and the Caribbean, income levels use `HIC`, `UMC`, `LMC` and `LIC`. Filters combine with the `countries` list and with each other. If nothing matches, the run succeeds with one free error row and no charge.

#### Does the World Bank Scraper exclude regional aggregates?

Only if you ask. Set `excludeAggregates` to true and the World Bank Scraper drops the 79 regional and income-group aggregates such as World, Sub-Saharan Africa and High income, keeping individual countries. Left false, `countries: all` returns aggregates too, and the `isAggregate` column marks them so you can filter them later in your own tools.

#### What does enrichRows add to each row?

With `enrichRows` on (the default), every data row gets `iso2`, `region`, `adminRegion`, `incomeLevel`, `lendingType`, `capitalCity`, `latitude`, `longitude`, `isAggregate`, `indicatorDatabase`, `indicatorSource`, `indicatorDescription`, `indicatorTopics` and `decimals`. It costs nothing extra, because the country list is fetched once per run. Turn it off for the compact row shape.

#### How far back does World Bank data go?

The World Bank Scraper can return data from 1960 for the classic indicators, which is the minimum value of `yearFrom`. Not every indicator has values for every year or country, so set `yearFrom` and `yearTo` to the range you need. With `skipEmptyValues` on, years with no observation are dropped and not billed.

#### Why did the World Bank Scraper return 0 results?

The indicator has no observation for those countries and years, or you asked for years in the future. Widen the year range or try another indicator. A fully valid World Bank Scraper request with no data still succeeds, returns zero rows, shows a status message and costs nothing.

#### Why did my World Bank Scraper run fail?

Most often the cause is an unknown indicator code that the World Bank rejects, or `yearFrom` greater than `yearTo`. The World Bank Scraper writes the reason in the run status message so you can fix the input. Failed runs are not billed, so a wrong indicator code never costs you money.

#### Am I charged for World Bank rows without a value?

No. The World Bank Scraper bills a data point only when the row holds a real value, at $0.015 on the Free plan. With `skipEmptyValues` switched off, empty country-year observations are still returned in the dataset, but they are never billed. Error rows and runs that deliver nothing are not billed either.

#### What happens if I send an empty or invalid input to the World Bank Scraper?

An empty input `{}` runs the defaults, GDP and population, with 10 rows. Input mistakes such as no indicators, or `yearFrom` greater than `yearTo`, end the World Bank Scraper run as SUCCEEDED with a single free error row (`errorType: invalid-input`, plus a `hint`) and no charge. Invalid values for typed fields are rejected with a 400 before any run starts.

#### Do I need a World Bank API key?

No. The World Bank Scraper reads the official public World Bank API, which needs no login and no API key. You only need an Apify account to run the actor. The data is open under the CC BY 4.0 license, so reuse it with attribution to the World Bank, and check each indicator's source terms before redistributing.

#### What are the free plan limits of the World Bank Scraper?

Free Apify users get a 10-row preview per World Bank Scraper run, which is enough to check the indicator codes and the output format. Paid plans can run up to 1,000,000 rows per run by setting `maxItems`. Set a maximum cost per run in the run options and the actor stops cleanly when it is reached.

### 🔗 Want more economic and public data? Other RecordsData scrapers

- [Exchange Rates Scraper](https://apify.com/RecordsData/exchange-rates-scraper)
- [Federal Contracts Spending Scraper](https://apify.com/RecordsData/federal-contracts-spending-scraper)
- [Numbeo Cost of Living Scraper](https://apify.com/RecordsData/numbeo-cost-of-living-scraper)

### 🛟 Support

Found a bug or a missing field? Open the Issues tab or write to contact.punkrecordsdata@gmail.com. Custom solutions available on request.

Last updated: 2026-10-11

# Actor input Schema

## `indicators` (type: `array`):

World Bank indicator codes to download as country-year time series, one code per line. Popular: NY.GDP.MKTP.CD (GDP US$), NY.GDP.PCAP.CD (GDP per capita), FP.CPI.TOTL.ZG (inflation %), SP.POP.TOTL (population), SL.UEM.TOTL.ZS (unemployment %), EN.ATM.CO2E.PC (CO2 per capita). Any of the 16,000+ codes from data.worldbank.org/indicator works.

## `countries` (type: `array`):

Countries to include, as ISO2 or ISO3 codes (for example US, BR, CO, MX). Use "all" for every country plus regional and income-group aggregates (about 296 series per indicator-year).

## `yearFrom` (type: `integer`):

First year of the time series.

## `yearTo` (type: `integer`):

Last year of the time series.

## `skipEmptyValues` (type: `boolean`):

Drop country-year rows where the indicator has no data.

## `enrichRows` (type: `boolean`):

Attach region, income level, lending type, capital city, coordinates, ISO2 code, an aggregate flag, the indicator's source organization and topics to each observation row, so no join with the country directory is needed. Free, no extra charge.

## `excludeAggregates` (type: `boolean`):

Drop the World Bank's regional and income-group aggregates (World, Sub-Saharan Africa, High income and so on) and keep individual countries only. Applies when Countries is all or a list.

## `regions` (type: `array`):

Only countries in these World Bank regions. Leave empty for all regions.

## `incomeLevels` (type: `array`):

Only countries in these World Bank income groups. Leave empty for all.

## `lendingTypes` (type: `array`):

Only countries with these World Bank lending categories: IBRD, Blend, IDA or Not classified. Leave empty for all.

## `includeIndicatorInfo` (type: `boolean`):

One row per indicator with its full name, description, source and topics.

## `includeCountryDirectory` (type: `boolean`):

One row per country with region, income level and capital.

## `maxItems` (type: `integer`):

Maximum number of billable rows to return (data points plus metadata rows). Default 10. Free users are limited to 10 rows. Raise it (up to 1,000,000) for full panels.

## Actor input object example

```json
{
  "indicators": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL"
  ],
  "countries": [
    "US",
    "BR",
    "MX",
    "CO"
  ],
  "yearFrom": 2000,
  "yearTo": 2026,
  "skipEmptyValues": true,
  "enrichRows": true,
  "excludeAggregates": false,
  "regions": [],
  "incomeLevels": [],
  "lendingTypes": [],
  "includeIndicatorInfo": true,
  "includeCountryDirectory": false,
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Key fields per row

## `fullData` (type: `string`):

Complete dataset with all fields

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "indicators": [
        "NY.GDP.MKTP.CD",
        "SP.POP.TOTL"
    ],
    "countries": [
        "US",
        "BR",
        "MX",
        "CO"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("recordsdata/world-bank-indicators-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "indicators": [
        "NY.GDP.MKTP.CD",
        "SP.POP.TOTL",
    ],
    "countries": [
        "US",
        "BR",
        "MX",
        "CO",
    ],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("recordsdata/world-bank-indicators-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "indicators": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL"
  ],
  "countries": [
    "US",
    "BR",
    "MX",
    "CO"
  ],
  "maxItems": 10
}' |
apify call recordsdata/world-bank-indicators-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,recordsdata/world-bank-indicators-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hHWwMFTr2eo5RvEDe/builds/LGOfS9PAxcyIUtGmS/openapi.json
