# World Bank Indicators API - GDP, Inflation & Economic Data (`themineworks/worldbank-indicators`) Actor

Affordable World Bank indicators: GDP, inflation & economic data. $1/1,000 results, 25 free, pay-per-result, no subscription. Works in Claude, ChatGPT & any MCP-compatible AI agent.

- **URL**: https://apify.com/themineworks/worldbank-indicators.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Business, Developer tools, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Indicators — GDP, Inflation, Trade & More by Country

Pull **World Bank development indicators** — GDP, GDP per capita, inflation, unemployment, exports/imports, population, and **1,400+ more** — for any country and year range, as clean structured JSON. The authoritative source for macro and development data, with no API key. Built for **economics, finance, market research, and data pipelines**.

**Keywords:** World Bank API, economic indicators, GDP by country, inflation data, development indicators, macro data, country statistics API.

---

### Why this actor

The World Bank publishes the World Development Indicators — the standard reference for cross-country macro and development data. Its API is open but returns a `[metadata, data]` envelope with paged results and null-padded years. This actor handles paging and null-filtering and gives you one clean record per data point. It pairs with our [Global Trade Data actor](https://apify.com/themineworks/global-trade-data) (World Bank WITS) for a complete macro + trade picture.

- **1,400+ indicators** — anything in the World Development Indicators.
- **Any country, any year range** — single country, a list, or `all`.
- **Clean output** — country, ISO3, indicator id + name, year, value.
- **No API key** — official World Bank API.

---

### Common indicator codes

| Indicator | Code |
|---|---|
| GDP (current US$) | `NY.GDP.MKTP.CD` |
| GDP per capita (current US$) | `NY.GDP.PCAP.CD` |
| GDP growth (annual %) | `NY.GDP.MKTP.KD.ZG` |
| Inflation, consumer prices (annual %) | `FP.CPI.TOTL.ZG` |
| Unemployment (% of labor force) | `SL.UEM.TOTL.ZS` |
| Exports of goods & services (current US$) | `NE.EXP.GNFS.CD` |
| Imports of goods & services (current US$) | `NE.IMP.GNFS.CD` |
| Population, total | `SP.POP.TOTL` |
| Foreign direct investment, net inflows | `BX.KLT.DINV.CD.WD` |

(Browse all at data.worldbank.org.)

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `countries` | string[] | `["IN","US","CN"]` | ISO country codes, or `all`. |
| `indicators` | string[] | `["NY.GDP.MKTP.CD"]` | World Bank indicator codes. |
| `yearFrom` / `yearTo` | integer | 2015 / 2023 | Year range. |
| `maxResults` | integer | 1000 | Max data points. |

#### Example

```json
{ "countries": ["IN","US","CN","BR"], "indicators": ["NY.GDP.MKTP.CD","FP.CPI.TOTL.ZG"], "yearFrom": 2010, "yearTo": 2023, "maxResults": 2000 }
````

***

### Output

```json
{
  "country": "China",
  "country_iso3": "CHN",
  "indicator_id": "NY.GDP.MKTP.CD",
  "indicator": "GDP (current US$)",
  "year": "2022",
  "value": 18316765021690.2,
  "scraped_at": "2026-06-12T00:00:00.000Z"
}
```

A final `{"_type":"summary"}` record reports how many data points were returned.

***

### Pricing

**First 25 data points free per account**, then **$0.001 per point** ($1 per 1,000). Zero charge on empty runs. No monthly rental, no API key.

***

### FAQ

**Do I need a key?** No — the World Bank API is fully open.

**How many indicators?** 1,400+ in the World Development Indicators.

**Where do I find indicator codes?** Browse data.worldbank.org, or use the common ones in the table above.

**Multiple countries/indicators at once?** Yes — pass lists of each; the actor fetches every combination over your year range.

**How far back does the data go?** Most indicators are available from 1960. Set `yearFrom` to any year from 1960 onward. Earlier years may have gaps for developing economies but are included where the World Bank has reported data.

**Can I automate regular refreshes?** Yes — schedule the actor on Apify to run monthly or quarterly and you will get an up-to-date dataset automatically. Pairs well with our [Global Trade Data actor](https://apify.com/themineworks/global-trade-data) for a full macro picture.

# Actor input Schema

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

2- or 3-letter ISO country codes (e.g. IN, US, CN, BR). Use 'all' for every country.

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

World Bank indicator codes. Examples: NY.GDP.MKTP.CD (GDP), NY.GDP.PCAP.CD (GDP per capita), FP.CPI.TOTL.ZG (inflation %), SL.UEM.TOTL.ZS (unemployment %), NE.EXP.GNFS.CD (exports), SP.POP.TOTL (population).

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

Earliest year.

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

Latest year.

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

Maximum number of data points to return.

## Actor input object example

```json
{
  "countries": [
    "IN",
    "US",
    "CN"
  ],
  "indicators": [
    "NY.GDP.MKTP.CD"
  ],
  "yearFrom": 2015,
  "yearTo": 2023,
  "maxResults": 50
}
```

# 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 = {
    "countries": [
        "IN",
        "US",
        "CN"
    ],
    "indicators": [
        "NY.GDP.MKTP.CD"
    ],
    "yearFrom": 2015,
    "yearTo": 2023,
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/worldbank-indicators").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 = {
    "countries": [
        "IN",
        "US",
        "CN",
    ],
    "indicators": ["NY.GDP.MKTP.CD"],
    "yearFrom": 2015,
    "yearTo": 2023,
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/worldbank-indicators").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 '{
  "countries": [
    "IN",
    "US",
    "CN"
  ],
  "indicators": [
    "NY.GDP.MKTP.CD"
  ],
  "yearFrom": 2015,
  "yearTo": 2023,
  "maxResults": 50
}' |
apify call themineworks/worldbank-indicators --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "World Bank Indicators API - GDP, Inflation & Economic Data",
        "description": "Affordable World Bank indicators: GDP, inflation & economic data. $1/1,000 results, 25 free, pay-per-result, no subscription. Works in Claude, ChatGPT & any MCP-compatible AI agent.",
        "version": "0.1",
        "x-build-id": "cQyS9mzKsDuCKJOH5"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/themineworks~worldbank-indicators/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-themineworks-worldbank-indicators",
                "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/themineworks~worldbank-indicators/runs": {
            "post": {
                "operationId": "runs-sync-themineworks-worldbank-indicators",
                "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/themineworks~worldbank-indicators/run-sync": {
            "post": {
                "operationId": "run-sync-themineworks-worldbank-indicators",
                "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": [
                    "indicators"
                ],
                "properties": {
                    "countries": {
                        "title": "Countries (ISO codes)",
                        "type": "array",
                        "description": "2- or 3-letter ISO country codes (e.g. IN, US, CN, BR). Use 'all' for every country.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "indicators": {
                        "title": "Indicator codes",
                        "type": "array",
                        "description": "World Bank indicator codes. Examples: NY.GDP.MKTP.CD (GDP), NY.GDP.PCAP.CD (GDP per capita), FP.CPI.TOTL.ZG (inflation %), SL.UEM.TOTL.ZS (unemployment %), NE.EXP.GNFS.CD (exports), SP.POP.TOTL (population).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "yearFrom": {
                        "title": "From year",
                        "type": "integer",
                        "description": "Earliest year.",
                        "default": 2015
                    },
                    "yearTo": {
                        "title": "To year",
                        "type": "integer",
                        "description": "Latest year.",
                        "default": 2023
                    },
                    "maxResults": {
                        "title": "Max data points",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of data points to return.",
                        "default": 1000
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
