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

Scrapes World Bank economic indicators by country codes and indicator code. Returns each observation as a flat row with country, indicator, year, and value.

- **URL**: https://apify.com/parseforge/world-bank-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### World Bank Data Scraper

**Scrape World Bank economic indicators for any country and indicator code, up to a million rows per run.** Each row returns the country, indicator, year, and value in one flat schema. No API key or registration. Export to CSV, JSON, Excel, or XML.

The World Bank's official API needs a developer account, API key, and pagination handling. This reads the public data catalog directly, filtered by country codes and indicator code, and returns each observation as one flat row. It covers GDP, population, inflation, and thousands of other indicators.

| Who uses it | What they scrape World Bank for |
|---|---|
| Economists | Comparing GDP growth across countries over decades |
| Data analysts | Building time-series datasets for forecasting models |
| Students and researchers | Gathering historical development data for papers |
| Financial journalists | Fact-checking economic statistics for articles |

### What it does

This Actor collects World Bank economic indicator observations by country codes and indicator code, and returns each observation as a flat row with country, indicator, year, and value.

- 🌍 **Country codes:** ISO 2-letter codes like US, CN, GB, DE, JP, IN, BR, FR.
- 📊 **Indicator code:** World Bank codes like NY.GDP.MKTP.CD for GDP, SP.POP.TOTL for population, FP.CPI.TOTL.ZG for inflation.
- 🔢 **Max items:** Free users get 10 rows for preview; paid users can fetch up to 1,000,000 rows.
- 📁 **Flat output:** Each observation is one row with country, indicator, year, and value.
- 💾 **Export formats:** CSV, JSON, Excel, or XML.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with World Bank data

**📈 Track GDP growth.**

An economist runs the Actor with country codes US, CN, IN and indicator NY.GDP.MKTP.CD to compare GDP trends over the last 20 years.

**👥 Monitor population changes.**

A data analyst fetches SP.POP.TOTL for all EU countries to build a demographic dashboard.

**💰 Analyze inflation rates.**

A financial journalist pulls FP.CPI.TOTL.ZG for emerging markets to report on price stability.

**🎓 Gather data for research.**

A student collects multiple indicators for a thesis on economic development in Sub-Saharan Africa.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Reads the public data catalog directly, no registration or OAuth. |
| **One flat schema** | Every observation is a single row, ready for analysis. |
| **Any indicator** | Thousands of World Bank indicators by code. |
| **Scalable** | From 10 preview rows to 1,000,000 rows per run. |

### How it compares

No other Store actor targets World Bank the same way, so the honest comparison is with the alternatives teams actually weigh.

| | World Bank Data Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When World Bank changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor with country codes and an indicator code, and set max items to limit the number of observations returned. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "countryCodes": [
    "US",
    "CN",
    "GB",
    "DE",
    "JP"
  ],
  "indicatorCode": "NY.GDP.MKTP.CD",
  "maxItems": 10
}
```

A larger pull:

```json
{
  "countryCodes": [
    "US",
    "CN",
    "GB",
    "DE",
    "JP"
  ],
  "indicatorCode": "NY.GDP.MKTP.CD",
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0055 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.55 |
| 1,000 results | $5.50 |
| 10,000 results | $55.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [World Bank Data Scraper](https://apify.com/parseforge/world-bank-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to World Bank through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/world-bank-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that the indicator code is valid and that the country codes are correct ISO 2-letter codes. Also ensure maxItems is at least 1.

**Why am I only getting 10 rows?**

Free users are limited to 10 rows for preview. Upgrade to a paid plan to increase maxItems up to 1,000,000.

**The run failed with an error.**

Verify the input format. Country codes must be a list of strings, and indicatorCode must be a string. Check the World Bank Data Catalog for valid codes.

**Can I get data for all countries?**

Yes, you can provide a list of all ISO 2-letter country codes. There is no limit on the number of countries, but maxItems limits total rows.

**The data seems outdated.**

The Actor fetches the latest data from the World Bank's public catalog. If you need a specific update, check the catalog for the latest release.

### FAQ

| Question | Answer |
|---|---|
| What is a World Bank indicator code? | It is a unique identifier for a data series, like NY.GDP.MKTP.CD for GDP in current US dollars. You can find codes in the World Bank Data Catalog. |
| How do I find country codes? | Use ISO 2-letter codes, for example US for United States, CN for China, GB for United Kingdom. The Actor accepts a list of these codes. |
| Can I get data for multiple countries at once? | Yes, provide a list of country codes in the input. The Actor fetches data for all of them in one run. |
| What is the maximum number of rows I can get? | Free users are limited to 10 rows for preview. Paid users can set maxItems up to 1,000,000 rows. |
| Do I need a World Bank API key? | No, this Actor reads the public data catalog directly, so no API key or registration is required. |
| What export formats are supported? | You can export the results as CSV, JSON, Excel, or XML. |
| Can I get historical data? | Yes, the Actor returns observations for all available years for the selected indicator and countries. |
| What if I enter an invalid indicator code? | The Actor will return no results or an error. Check the code against the World Bank Data Catalog. |
| Is the data updated? | The Actor fetches the latest data available from the World Bank's public catalog at the time of the run. |
| Can I schedule this Actor to run regularly? | Yes, you can set up a schedule on Apify to run it daily, weekly, or at any interval. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by The World Bank Group. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `countryCodes` (type: `array`):

ISO 2-letter country codes to fetch data for (e.g. US, CN, GB, DE, JP, IN, BR, FR).

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

World Bank indicator code. Examples: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (Population), FP.CPI.TOTL.ZG (Inflation).

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "countryCodes": [
    "US",
    "CN",
    "GB",
    "DE",
    "JP"
  ],
  "indicatorCode": "NY.GDP.MKTP.CD",
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "countryCodes": [
        "US",
        "CN",
        "GB",
        "DE",
        "JP"
    ],
    "indicatorCode": "NY.GDP.MKTP.CD",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/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 = {
    "countryCodes": [
        "US",
        "CN",
        "GB",
        "DE",
        "JP",
    ],
    "indicatorCode": "NY.GDP.MKTP.CD",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/world-bank-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 '{
  "countryCodes": [
    "US",
    "CN",
    "GB",
    "DE",
    "JP"
  ],
  "indicatorCode": "NY.GDP.MKTP.CD",
  "maxItems": 10
}' |
apify call parseforge/world-bank-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/world-bank-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/1kBvLca9CTHy1JAR5/builds/iZXKEA34xvS7EKRhq/openapi.json
