# World Bank Economic Indicators API - 1,400+ Series (`martin10291/world-bank-indicators-api`) Actor

World Bank economic indicators as JSON, no API key: any of the 1,434 World Development Indicators (GDP, inflation, population, unemployment, CO2, life expectancy, electricity access, debt...) for 217 economies and regional aggregates, 1960 to the latest year. Modes: latest value with change, yearly

- **URL**: https://apify.com/martin10291/world-bank-indicators-api.md
- **Developed by:** [Martin Petrov](https://apify.com/martin10291) (community)
- **Categories:** Developer tools, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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?

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

## World Bank Economic Indicators API - 1,390+ Series

**Problem:** your dashboard, research tool, pricing model or AI agent needs a country number such as GDP, GDP per capita, inflation, population, unemployment, government debt, CO2 per capita, life expectancy or internet users. The World Bank publishes over 1,400 World Development Indicators (this API serves the 1,390+ licensed CC BY 4.0), but you have to know the code, page through its API (which often times out or caps results) and join country metadata yourself. Existing marketplace World Bank APIs show 0-78% success.

**This API:** one JSON call, no API key, answers from a maintained copy of the official World Bank files (refreshed every 24 h, the old copy is served with `"stale": true` if the source is down, so a call never fails because the World Bank is slow).

- **Any indicator:** World Bank codes (`NY.GDP.MKTP.CD`) or plain words (`gdp`, `inflation`, `gdp per capita`, `co2 per capita`, `life expectancy`, `internet users`).
- **217 economies + aggregates** (World, EU, income groups), 1960 to the latest year. ISO2, ISO3 or English names.
- **6 modes:** `latest` (newest value + change vs the year before), `history` (one row per year), `rank` (countries ranked in a year, with region / income filters), `compare` (growth between two years: change, CAGR, min/max), `search` (find codes by words), `countries`.
- **Region and income group on every row**, so you can group and filter without a second call.
- **Source on every row:** World Bank, World Development Indicators, licence CC BY 4.0, with the indicator page URL.

### Example (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/martin10291~world-bank-indicators-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "latest", "countries": ["DE"], "indicators": ["gdp per capita"]}'
```

Output row (measured 2026-11-15):

```json
{"country": "Germany", "iso2": "DE", "iso3": "DEU", "region": "Europe & Central Asia", "incomeGroup": "High income",
 "indicator": "NY.GDP.PCAP.CD", "indicatorName": "GDP per capita (current US$)", "unit": "current US$",
 "year": 2025, "value": 60496.435082, "previousYear": 2024, "previousValue": 56103.732318, "change": 4392.702764, "changePct": 7.8296,
 "source": "World Bank, World Development Indicators (CC BY 4.0)", "sourceUrl": "https://data.worldbank.org/indicator/NY.GDP.PCAP.CD",
 "dataUpdated": "2026-11-11", "stale": false}
```

Rank (`{"mode": "rank", "indicators": ["internet users"], "order": "asc", "limit": 3}`):

```json
[{"rank": 1, "country": "Burundi", "value": 8.596, "year": 2024}, {"rank": 2, "country": "Uganda", "value": 8.949831, "year": 2024}, {"rank": 3, "country": "Chad", "value": 12.6269, "year": 2024}]
```

More inputs:

- `{"mode": "compare", "countries": ["BG", "RO"], "indicators": ["gdp per capita"], "fromYear": 2010}` -> Bulgaria 6,854 -> 20,328 USD, CAGR 7.5 %.
- `{"mode": "history", "countries": ["JP"], "indicators": ["inflation"], "fromYear": 2015}` -> one row per year with `yoyChange` (percentage points for % indicators).
- `{"mode": "search", "query": "female unemployment"}` -> matching codes with definitions.
- `{"mode": "countries"}` -> economies and aggregates with region and income group.
- Monitor: `{"onlyNew": true, "monitorId": "my-dashboard"}` on a monthly schedule returns each new World Bank year once.

Countries the World Bank does not publish separately (for example Taiwan) come back as a row with a clear `error`, the rest of the call still works.

### Use from agents (MCP)

Add the Apify MCP server (`https://mcp.apify.com?tools=martin10291/world-bank-indicators-api`) to Claude, Cursor or any MCP client and ask: "Rank EU countries by GDP per capita and show Bulgaria's growth since 2010".

### FAQ

- **How fresh is the data?** Each indicator is refreshed from the World Bank at most every 24 h; `dataUpdated` shows the World Bank's own update date, `fetchedAt` our copy. The World Bank adds new yearly values a few times per year.
- **Limits?** Up to 20 countries x 10 indicators per call, up to 5,000 rows (`limit`). rank and compare use the first indicator.
- **Errors?** Unknown country or indicator = a clear message with close matches (never an empty "success"). If the World Bank is down, the last copy is served with `"stale": true`.
- **Missing values?** Rows without data carry a `note`; the World Bank does not publish every indicator for every country and year.

### Pricing

$1.00 per 1,000 rows. Data: World Bank, World Development Indicators (CC BY 4.0).

# Actor input Schema

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

latest = newest value per country and indicator with the change vs the year before; history = one row per country, indicator and year; rank = countries ranked by one indicator in one year; compare = growth of one indicator between two years per country (change, CAGR, min/max); search = find indicator codes by words; countries = list of economies and aggregates.

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

ISO2 (US, DE, BG), ISO3 (USA, DEU) or English names (Germany). Aggregates work too (WLD = world, EUU = EU, HIC = high income). Up to 20. Empty = US, CN, DE, IN, BR.

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

World Bank codes (NY.GDP.MKTP.CD) or plain words (gdp, inflation, population, unemployment, gdp per capita, co2 per capita, life expectancy, internet users). Up to 10; rank and compare use the first one. Use mode=search to find codes. Empty = GDP, inflation, population.

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

For history and compare: first year (1960 or later). Default 20 years ago.

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

For history and compare: last year. Default the latest year.

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

For rank: the year to rank. Default = the latest year where at least half of the reporting countries have data.

## `order` (type: `string`):

For rank: desc = highest first, asc = lowest first.

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

For rank: only countries of this World Bank region, e.g. Europe & Central Asia, Sub-Saharan Africa.

## `incomeGroup` (type: `string`):

For rank: only countries of this income group, e.g. High income, Lower middle income.

## `includeAggregates` (type: `boolean`):

For rank and countries: also include regional/income aggregates such as World or Euro area.

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

For search: words to find indicators, e.g. female unemployment, renewable energy, government debt.

## `limit` (type: `integer`):

Maximum rows returned. Between 1 and 5000.

## `onlyNew` (type: `boolean`):

Return only country/indicator/year rows not returned before for this Monitor ID. Schedule monthly to get each new World Bank year once.

## `monitorId` (type: `string`):

Name of the watch for only-new mode, e.g. my-dashboard. Each Monitor ID keeps its own memory.

## Actor input object example

```json
{
  "mode": "latest",
  "countries": [
    "US",
    "DE",
    "BG"
  ],
  "indicators": [
    "gdp",
    "inflation"
  ],
  "order": "desc",
  "includeAggregates": false,
  "limit": 100,
  "onlyNew": false,
  "monitorId": "default"
}
```

# Actor output Schema

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

latest/history: one row per country and indicator (and year) with value, change and source; rank: rank, country, value; compare: start/end value, change, CAGR; search: indicator code, name, unit, definition. Every row carries World Bank attribution (CC BY 4.0).

# 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": "latest",
    "countries": [
        "US",
        "DE",
        "BG"
    ],
    "indicators": [
        "gdp",
        "inflation"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/world-bank-indicators-api").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": "latest",
    "countries": [
        "US",
        "DE",
        "BG",
    ],
    "indicators": [
        "gdp",
        "inflation",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("martin10291/world-bank-indicators-api").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 '{
  "mode": "latest",
  "countries": [
    "US",
    "DE",
    "BG"
  ],
  "indicators": [
    "gdp",
    "inflation"
  ]
}' |
apify call martin10291/world-bank-indicators-api --silent --output-dataset

```

## MCP server setup

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

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/teHl7QYEC40ktrs2r/builds/qiwlg781hZIjowleg/openapi.json
