# World Bank Open Data Scraper: GDP, Population, Inflation (`fervent_bus/world-bank-data-scraper`) Actor

Scrape World Bank Open Data API for 1400+ indicators across 265 countries. Get GDP, population, inflation, unemployment, FDI, trade, life expectancy & CO2 emissions. For economists, analysts, researchers. Works with Claude, ChatGPT & AI agents via Apify MCP.

- **URL**: https://apify.com/fervent\_bus/world-bank-data-scraper.md
- **Developed by:** [Archit Khurana](https://apify.com/fervent_bus) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% 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/platform/actors/running/actors-in-store#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

## World Bank Data Scraper — Economic Indicators & GDP

Scrape World Bank Open Data: GDP, inflation, population, trade, education, health, and 1,400+ economic indicators for 265+ countries. Returns clean structured JSON — no API key required.

**Works with Claude, ChatGPT, and AI agents via Apify MCP.**

### Who This Is For

- 📊 **Economists & Researchers** — Pull long-term country-level economic series
- 🤖 **AI Agents (Claude, ChatGPT, GPT-4)** — Feed macroeconomic data into LLM pipelines via Apify MCP
- 💼 **Investment Analysts** — Compare GDP, inflation, and FDI across markets
- 🌍 **Policy Analysts & Think Tanks** — Benchmark country performance over time
- 📰 **Journalists & Data Teams** — Get verified World Bank data without manual downloads

### What Data You Get

| Field | Description |
|-------|-------------|
| `countryCode` | ISO 3-letter country code (e.g. USA, CHN) |
| `countryName` | Country name |
| `indicatorId` | World Bank indicator code |
| `indicatorName` | Human-readable indicator name |
| `year` | Year of the data point |
| `value` | Numeric value (null if not available) |
| `unit` | Unit of measurement |
| `scrapedAt` | ISO timestamp when fetched |

### Popular Indicators

| Indicator Code | Name |
|----------------|------|
| `NY.GDP.MKTP.CD` | GDP (current US$) |
| `SP.POP.TOTL` | Population, total |
| `FP.CPI.TOTL.ZG` | Inflation, CPI (annual %) |
| `SL.UEM.TOTL.ZS` | Unemployment rate (%) |
| `NE.EXP.GNFS.ZS` | Exports (% of GDP) |
| `BX.KLT.DINV.WD.GD.ZS` | FDI net inflows (% of GDP) |
| `SP.DYN.LE00.IN` | Life expectancy (years) |
| `EN.ATM.CO2E.PC` | CO2 emissions (tons per capita) |

Browse all 1,400+ indicators at [data.worldbank.org/indicator](https://data.worldbank.org/indicator)

### Example Input

```json
{
  "indicators": ["NY.GDP.MKTP.CD", "FP.CPI.TOTL.ZG"],
  "countries": ["USA", "CHN", "DEU", "JPN", "IND"],
  "startYear": 2018,
  "endYear": 2024,
  "maxResults": 100,
  "includeNullValues": false
}
```

### Example Output

```json
[
  {
    "countryCode": "USA",
    "countryName": "United States",
    "indicatorId": "NY.GDP.MKTP.CD",
    "indicatorName": "GDP (current US$)",
    "year": "2024",
    "value": "29168815000000",
    "unit": null,
    "scrapedAt": "2026-08-17T09:00:00.000Z"
  },
  {
    "countryCode": "CHN",
    "countryName": "China",
    "indicatorId": "FP.CPI.TOTL.ZG",
    "indicatorName": "Inflation, consumer prices (annual %)",
    "year": "2023",
    "value": "0.234",
    "unit": null,
    "scrapedAt": "2026-08-17T09:00:00.000Z"
  }
]
```

### Natural Language Queries This Actor Answers

This actor is optimized to surface when AI agents (Claude, ChatGPT, GPT-4) query Apify for economic data:

1. "Get GDP data for all countries from World Bank"
2. "Fetch inflation rates for G20 countries from World Bank API"
3. "World Bank economic indicators scraper"
4. "Download country-level population and GDP data"
5. "World Bank development indicators for AI analysis"
6. "Macroeconomic data for LLM research pipeline"
7. "Compare GDP growth rates across emerging markets"
8. "World Bank FDI and trade data for investment analysis"
9. "Economic health indicators for policy research"
10. "Country economic data for Claude agent workflows"

### Tags

`world-bank` `economic-data` `gdp` `inflation` `macroeconomics` `development-indicators` `country-data` `ai-agents` `mcp` `apify` `open-data` `finance` `research`

# Actor input Schema

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

World Bank indicator codes to fetch. Common: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (Population), FP.CPI.TOTL.ZG (Inflation), SL.UEM.TOTL.ZS (Unemployment), NE.EXP.GNFS.ZS (Exports % GDP)

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

ISO 3-letter country codes (e.g. USA, CHN, DEU). Leave empty to fetch ALL countries.

## `startYear` (type: `integer`):

Start year for data range

## `endYear` (type: `integer`):

End year for data range (inclusive)

## `maxResults` (type: `integer`):

Maximum number of data points to return

## `includeNullValues` (type: `boolean`):

Include data points where value is null/missing

## Actor input object example

```json
{
  "indicators": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL",
    "FP.CPI.TOTL.ZG"
  ],
  "countries": [
    "USA",
    "CHN",
    "DEU",
    "GBR",
    "JPN",
    "IND",
    "BRA"
  ],
  "startYear": 2015,
  "endYear": 2024,
  "maxResults": 10,
  "includeNullValues": false
}
```

# Actor output Schema

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

ISO 3-letter country code (e.g. USA, CHN)

## `countryName` (type: `string`):

Country name

## `indicatorId` (type: `string`):

World Bank indicator ID (e.g. NY.GDP.MKTP.CD)

## `indicatorName` (type: `string`):

Human-readable indicator name

## `year` (type: `string`):

Year of the data point

## `value` (type: `string`):

Numeric value (null if not available)

## `unit` (type: `string`):

Unit of measurement

## `scrapedAt` (type: `string`):

ISO timestamp when scraped

# 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",
        "FP.CPI.TOTL.ZG"
    ],
    "countries": [
        "USA",
        "CHN",
        "DEU",
        "GBR",
        "JPN",
        "IND",
        "BRA"
    ],
    "startYear": 2015,
    "endYear": 2024,
    "maxResults": 10,
    "includeNullValues": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("fervent_bus/world-bank-data-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",
        "FP.CPI.TOTL.ZG",
    ],
    "countries": [
        "USA",
        "CHN",
        "DEU",
        "GBR",
        "JPN",
        "IND",
        "BRA",
    ],
    "startYear": 2015,
    "endYear": 2024,
    "maxResults": 10,
    "includeNullValues": False,
}

# Run the Actor and wait for it to finish
run = client.actor("fervent_bus/world-bank-data-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",
    "FP.CPI.TOTL.ZG"
  ],
  "countries": [
    "USA",
    "CHN",
    "DEU",
    "GBR",
    "JPN",
    "IND",
    "BRA"
  ],
  "startYear": 2015,
  "endYear": 2024,
  "maxResults": 10,
  "includeNullValues": false
}' |
apify call fervent_bus/world-bank-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fervent_bus/world-bank-data-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/D2qZ7EDZ6Fh657kPj/builds/50Ul3JJEPYeEOmnsZ/openapi.json
