# World Bank Open Data Scraper (`crawlerbros/world-bank-scraper`) Actor

Scrape World Bank Open Data, 16,000+ development indicators for 200+ countries spanning 60+ years. Get GDP, population, inflation, unemployment, literacy rates, and thousands more economic and social indicators.

- **URL**: https://apify.com/crawlerbros/world-bank-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.00 / 1,000 results

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

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## World Bank Open Data Scraper

Extract development indicators and economic data from the **World Bank Open Data** platform — 16,000+ indicators for 200+ countries spanning 60+ years of historical data. No API key or authentication required.

### What you can scrape

- **Countries** — full list of 200+ World Bank countries and regions with geographic metadata
- **Indicators catalog** — searchable database of 16,000+ development indicators across topics like GDP, poverty, education, health, and environment
- **Time-series data** — annual values for any indicator and country combination (e.g., US GDP from 1960–2023)
- **Cross-country comparisons** — latest values for one indicator across all countries
- **Topics** — hierarchical topic taxonomy for browsing indicators

### Input

| Field | Type | Description |
|---|---|---|
| `mode` | select | What to fetch (see modes below) |
| `query` | string | Keyword search for indicators (mode=indicators) |
| `topicId` | integer | Filter indicators by topic number 1–21 |
| `sourceId` | integer | Filter by data source ID |
| `countryCode` | string | ISO 2 or 3-letter country code (e.g. `US`, `DEU`, `IN`) |
| `indicatorCode` | string | World Bank indicator code (e.g. `NY.GDP.MKTP.CD`) |
| `fromYear` | integer | Start year for time series (default: 1960) |
| `toYear` | integer | End year for time series (default: 2024) |
| `year` | integer | Specific year for all-countries mode |
| `incomeLevel` | select | Filter countries by income level |
| `region` | select | Filter countries by World Bank region |
| `maxItems` | integer | Maximum records to return (1–10000) |

#### Modes

- **`countries`** — List all World Bank countries with region, income level, lending type, and coordinates
- **`indicators`** — Search the indicator catalog by keyword, topic, or source
- **`byCountryIndicator`** — Annual time-series data for one country + one indicator
- **`byIndicatorAllCountries`** — Latest values across all countries for one indicator
- **`topics`** — List all 21 data topic categories

#### Common indicator codes

| Indicator Code | Description |
|---|---|
| `NY.GDP.MKTP.CD` | GDP (current US$) |
| `SP.POP.TOTL` | Population, total |
| `FP.CPI.TOTL.ZG` | Inflation, consumer prices (annual %) |
| `SL.UEM.TOTL.ZS` | Unemployment, total (% of labor force) |
| `SE.ADT.LITR.ZS` | Literacy rate, adult total (%) |
| `NY.GDP.PCAP.CD` | GDP per capita (current US$) |
| `SI.POV.DDAY` | Poverty headcount ratio at $2.15/day (%) |
| `SH.DYN.MORT` | Mortality rate, under-5 (per 1,000 live births) |

### Output

#### Countries record

```json
{
  "recordType": "country",
  "id": "US",
  "iso2Code": "US",
  "name": "United States",
  "capitalCity": "Washington D.C.",
  "longitude": -77.032,
  "latitude": 38.8895,
  "region": "North America",
  "regionId": "NAC",
  "incomeLevel": "High income",
  "incomeLevelId": "HIC",
  "lendingType": "Not classified",
  "lendingTypeId": "LNX",
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
````

#### Indicator record

```json
{
  "recordType": "indicator",
  "id": "NY.GDP.MKTP.CD",
  "name": "GDP (current US$)",
  "source": "World Development Indicators",
  "description": "GDP at purchaser's prices is the sum of gross value added...",
  "topics": ["Economy & Growth"],
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
```

#### Data series record

```json
{
  "recordType": "dataSeries",
  "indicatorCode": "NY.GDP.MKTP.CD",
  "indicatorName": "GDP (current US$)",
  "countryCode": "US",
  "countryName": "United States",
  "countryIso3": "USA",
  "date": "2022",
  "value": 25462700000000.0,
  "unit": "",
  "decimal": 0,
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
```

### Example use cases

- **Economic research** — Download GDP, inflation, or unemployment trends for multiple countries
- **Development analysis** — Compare poverty rates, literacy, or health metrics globally
- **Education dashboards** — Pull enrollment ratios, teacher counts, or expenditure data
- **Environmental tracking** — CO2 emissions, forest coverage, renewable energy adoption
- **Data journalism** — Quick access to authoritative development statistics

### FAQs

**Do I need an API key?**
No. The World Bank Open Data API is completely free and requires no authentication.

**How often is the data updated?**
World Bank data is typically updated annually. Most indicators have data through 2021–2023.

**Can I get data for multiple countries at once?**
Yes — use `byIndicatorAllCountries` mode to get values for all 200+ countries for a single indicator.

**What country codes should I use?**
Use standard ISO 2-letter codes (US, DE, CN) or ISO 3-letter codes (USA, DEU, CHN). You can also use World Bank codes visible in the countries listing.

**Why are some values missing?**
Not all countries report every indicator. The scraper skips null/missing values to ensure data quality.

**How do I find indicator codes?**
Use `mode=indicators` with a keyword search (e.g., `query=GDP`) to discover indicator codes, then use them in `byCountryIndicator` mode.

# Actor input Schema

## `mode` (type: `string`):

What to fetch from the World Bank API.

## `query` (type: `string`):

Free-text keyword search for indicators (e.g. 'GDP', 'poverty', 'education'). Used in indicators mode.

## `topicId` (type: `integer`):

Filter indicators by topic number (e.g. 1=Agriculture, 3=Economy, 6=Education). Leave blank for all topics.

## `sourceId` (type: `integer`):

Filter indicators by data source ID (e.g. 2=World Development Indicators, 57=WDI Database Archives). Leave blank for all sources.

## `countryCode` (type: `string`):

ISO 2-letter or 3-letter country code, or World Bank country code (e.g. 'US', 'USA', 'CN', 'IN', 'DE', 'GB'). Required for byCountryIndicator mode.

## `indicatorCode` (type: `string`):

World Bank indicator code (e.g. 'NY.GDP.MKTP.CD' for GDP, 'SP.POP.TOTL' for Population, 'FP.CPI.TOTL.ZG' for Inflation). Required for byCountryIndicator and byIndicatorAllCountries modes.

## `fromYear` (type: `integer`):

Start year for the data range (e.g. 2000). Defaults to 1960 if not specified.

## `toYear` (type: `integer`):

End year for the data range (e.g. 2023). Defaults to current year if not specified.

## `year` (type: `integer`):

The specific year to fetch values for all countries. Defaults to most recent available year.

## `incomeLevel` (type: `string`):

Filter countries by income level classification.

## `region` (type: `string`):

Filter countries by World Bank region code.

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

Maximum number of records to return. Use a smaller value for quick tests.

## Actor input object example

```json
{
  "mode": "countries",
  "incomeLevel": "",
  "region": "",
  "maxItems": 100
}
```

# Actor output Schema

## `worldBankData` (type: `string`):

Dataset containing all scraped World Bank records.

# 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 = {
    "mode": "countries",
    "incomeLevel": "",
    "region": "",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/world-bank-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 = {
    "mode": "countries",
    "incomeLevel": "",
    "region": "",
    "maxItems": 100,
}

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

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

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

```

## CLI example

```bash
echo '{
  "mode": "countries",
  "incomeLevel": "",
  "region": "",
  "maxItems": 100
}' |
apify call crawlerbros/world-bank-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/world-bank-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "World Bank Open Data Scraper",
        "description": "Scrape World Bank Open Data, 16,000+ development indicators for 200+ countries spanning 60+ years. Get GDP, population, inflation, unemployment, literacy rates, and thousands more economic and social indicators.",
        "version": "1.0",
        "x-build-id": "aYSygZ4HPXzvCubop"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~world-bank-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-world-bank-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~world-bank-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-world-bank-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~world-bank-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-world-bank-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "countries",
                            "indicators",
                            "byCountryIndicator",
                            "byIndicatorAllCountries",
                            "topics"
                        ],
                        "type": "string",
                        "description": "What to fetch from the World Bank API.",
                        "default": "countries"
                    },
                    "query": {
                        "title": "Search query (mode=indicators)",
                        "type": "string",
                        "description": "Free-text keyword search for indicators (e.g. 'GDP', 'poverty', 'education'). Used in indicators mode."
                    },
                    "topicId": {
                        "title": "Topic ID filter (mode=indicators)",
                        "minimum": 1,
                        "maximum": 21,
                        "type": "integer",
                        "description": "Filter indicators by topic number (e.g. 1=Agriculture, 3=Economy, 6=Education). Leave blank for all topics."
                    },
                    "sourceId": {
                        "title": "Source ID filter (mode=indicators)",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Filter indicators by data source ID (e.g. 2=World Development Indicators, 57=WDI Database Archives). Leave blank for all sources."
                    },
                    "countryCode": {
                        "title": "Country code (mode=byCountryIndicator)",
                        "type": "string",
                        "description": "ISO 2-letter or 3-letter country code, or World Bank country code (e.g. 'US', 'USA', 'CN', 'IN', 'DE', 'GB'). Required for byCountryIndicator mode."
                    },
                    "indicatorCode": {
                        "title": "Indicator code",
                        "type": "string",
                        "description": "World Bank indicator code (e.g. 'NY.GDP.MKTP.CD' for GDP, 'SP.POP.TOTL' for Population, 'FP.CPI.TOTL.ZG' for Inflation). Required for byCountryIndicator and byIndicatorAllCountries modes."
                    },
                    "fromYear": {
                        "title": "From year (mode=byCountryIndicator)",
                        "minimum": 1960,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "Start year for the data range (e.g. 2000). Defaults to 1960 if not specified."
                    },
                    "toYear": {
                        "title": "To year (mode=byCountryIndicator)",
                        "minimum": 1960,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "End year for the data range (e.g. 2023). Defaults to current year if not specified."
                    },
                    "year": {
                        "title": "Year (mode=byIndicatorAllCountries)",
                        "minimum": 1960,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "The specific year to fetch values for all countries. Defaults to most recent available year."
                    },
                    "incomeLevel": {
                        "title": "Income level filter (mode=countries)",
                        "enum": [
                            "",
                            "HIC",
                            "UMC",
                            "LMC",
                            "LIC",
                            "MIC"
                        ],
                        "type": "string",
                        "description": "Filter countries by income level classification.",
                        "default": ""
                    },
                    "region": {
                        "title": "Region filter (mode=countries)",
                        "enum": [
                            "",
                            "EAS",
                            "ECS",
                            "LCN",
                            "MEA",
                            "NAC",
                            "SAS",
                            "SSF"
                        ],
                        "type": "string",
                        "description": "Filter countries by World Bank region code.",
                        "default": ""
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of records to return. Use a smaller value for quick tests.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
