# World Bank & Eurostat API: GDP, Inflation, Unemployment (`actose/world-bank-eurostat-indicators`) Actor

GDP, inflation, unemployment, population and 1,400+ official indicators from World Bank and Eurostat: one row per country and year, YoY change, rank, CSV table. No API key, no login. MCP-ready for AI agents. Pay per result, errors and empty values free. $0.30 per 1,000 datapoints

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

## Pricing

from $0.26 / 1,000 indicator datapoints

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 & Eurostat Indicators API: GDP, Inflation, Unemployment

**$0.30 per 1,000 datapoints** ($0.0003 each). Pay per result, no monthly rental. Errors, unknown codes and empty values are free.

Get official macroeconomic data from the **World Bank** (WDI, 1,400+ indicators, 260+ countries and aggregates) and **Eurostat** (every dataset of the EU statistical office) as **one clean row per country, indicator and year**. No raw nested JSON, no SDMX / JSON-stat cubes to decode.

- GDP, GDP per capita, GDP growth, inflation (CPI and HICP), unemployment, population, debt, exports, CO2… or any indicator code
- Compare countries directly: each row has the **change vs previous year** (absolute and %) and the **rank among the countries you asked for**
- Extra files: a wide **comparison table** (countries × years) in CSV and Markdown, ready for Google Sheets or an LLM prompt
- `onlyNew` mode for scheduled runs: get only newly published or revised values
- No API key, no login. MCP-ready for Claude, Cursor, ChatGPT and AI agents
- A free, fast alternative to downloading Excel files from the World Bank or Eurostat data browsers

### How much does it cost?

You pay **$0.0003 per datapoint delivered** (one country × one indicator × one period with a value).

| Request | Datapoints | Price |
|---|---|---|
| GDP per capita, 4 countries, 2015–2024 | 40 | $0.012 |
| 5 indicators, 27 EU countries, 10 years | 1,350 | $0.41 |
| 1 indicator, every country and aggregate, 10 years | ~2,600 | ~$0.78 |
| **1,000 datapoints** | 1,000 | **$0.30** |

Nothing is charged for unknown codes, countries without data, empty values (skipped by default) or failed requests. Set a maximum cost per run in Apify: the actor stops cleanly when it is reached, without free "preview" rows.

### Input

| Field | What it does |
|---|---|
| `worldBankIndicators` | World Bank codes, e.g. `NY.GDP.PCAP.CD`, `FP.CPI.TOTL.ZG`, `SL.UEM.TOTL.ZS`, `SP.POP.TOTL` |
| `eurostatDatasets` | Eurostat dataset + optional filters, e.g. `une_rt_a?age=Y15-74&sex=T&unit=PC_ACT` |
| `presets` | Shortcuts: `wb:gdp`, `wb:gdpPerCapita`, `wb:inflation`, `wb:unemployment`, `wb:population`, `eurostat:inflationHicp`, `eurostat:unemploymentRate`, `eurostat:gdpPerCapita`… |
| `countries` | ISO2 or ISO3 codes (`FR`, `DEU`, `US`), aggregates (`EUU`, `WLD`, `EU27_2020`), or `all` |
| `startYear`, `endYear` | Period (default: last 10 years) |
| `mostRecentValues` | Only the N latest periods (overrides the years) |
| `onlyNew` | Only datapoints not delivered in previous runs, plus revisions |
| `skipEmptyValues`, `includeAggregates`, `comparisonTable`, `maxResults` | Fine-tuning |

Example:

```json
{
  "worldBankIndicators": ["NY.GDP.PCAP.CD"],
  "presets": ["eurostat:unemploymentRate"],
  "countries": ["FR", "DE", "IT", "ES"],
  "startYear": 2015,
  "endYear": 2024
}
```

Greece and the United Kingdom are converted automatically for Eurostat (`GR` → `EL`, `GB` → `UK`). Duplicates such as `DE` and `DEU` are merged.

### Output

One object per datapoint in the dataset (export to JSON, CSV, Excel, XML):

```json
{
  "source": "worldbank",
  "indicatorCode": "NY.GDP.PCAP.CD",
  "indicatorName": "GDP per capita (current US$)",
  "datasetCode": null,
  "seriesKey": "NY.GDP.PCAP.CD",
  "dimensions": null,
  "countryCode": "DE",
  "countryIso3": "DEU",
  "countryName": "Germany",
  "isAggregate": false,
  "region": "Europe & Central Asia",
  "incomeLevel": "High income",
  "period": "2023",
  "year": 2023,
  "value": 54776.77,
  "unit": null,
  "observationStatus": null,
  "previousPeriod": "2022",
  "changeFromPreviousPeriod": 4270.25,
  "changeFromPreviousPeriodPct": 8.4549,
  "rankAmongRequestedCountries": 1,
  "countriesCompared": 4,
  "isRevision": null,
  "text": "Germany — GDP per capita (current US$) in 2023: 54,776.77 (+8.45% vs 2022), rank 1 of 4 countries compared. Source: World Bank.",
  "lastUpdated": "2026-10-08",
  "sourceUrl": "https://data.worldbank.org/indicator/NY.GDP.PCAP.CD?locations=DE",
  "apiUrl": "https://api.worldbank.org/v2/country/DEU/indicator/NY.GDP.PCAP.CD?format=json",
  "scrapedAt": "2026-10-22T08:00:00+00:00"
}
```

A Eurostat row has the same fields, plus the dataset dimensions:

```json
{
  "source": "eurostat",
  "indicatorCode": "une_rt_a?age=Y15-74&unit=PC_ACT&sex=T",
  "indicatorName": "Unemployment by sex and age - annual data — From 15 to 74 years, Percentage of population in the labour force, Total",
  "datasetCode": "une_rt_a",
  "dimensions": {"age": "Y15-74", "unit": "PC_ACT", "sex": "T"},
  "dimensionLabels": {"age": "From 15 to 74 years", "unit": "Percentage of population in the labour force", "sex": "Total"},
  "countryCode": "FR",
  "countryIso3": "FRA",
  "countryName": "France",
  "period": "2024",
  "year": 2024,
  "value": 7.4,
  "unit": "Percentage of population in the labour force",
  "observationStatus": "d (definition differs, see metadata)",
  "rankAmongRequestedCountries": 2,
  "countriesCompared": 4
}
```

Files in the run's key-value store (links in the log and in the Output tab):

- `comparison.md`: one Markdown table per indicator, countries × years
- `comparison.csv`: the same data in long CSV format

### Use cases

#### 1. Country risk analyst: monthly macro dashboard in Google Sheets

A credit analyst covering Southern Europe refreshes GDP growth, inflation and unemployment for 6 countries every month.

Input:

```json
{
  "presets": ["wb:gdpGrowth", "wb:inflation", "eurostat:unemploymentRate"],
  "countries": ["IT", "ES", "PT", "GR", "FR", "DE"],
  "startYear": 2018,
  "endYear": 2025
}
```

Output (extract): `{"countryName": "Greece", "indicatorName": "Inflation, consumer prices (annual %)", "period": "2024", "value": 2.7, "rankAmongRequestedCountries": 2}`

About 140 datapoints, **about $0.04 per refresh**. The Google Sheets integration writes the dataset to a sheet, and a pivot table drives the charts in the credit committee deck.

#### 2. Economics journalist / data desk: "Who is richest in the EU?" chart

A data journalist needs GDP per capita in euros for all 27 member states for a 10-year chart.

Input:

```json
{
  "presets": ["eurostat:gdpPerCapita"],
  "countries": ["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],
  "startYear": 2015,
  "endYear": 2024
}
```

Output: 270 rows, plus `comparison.csv` pasted straight into Datawrapper or Flourish. Cost: **$0.08**. `rankAmongRequestedCountries` gives the ranking for the article text at once.

#### 3. AI agent / RAG: grounded answers on macro questions

An AI assistant for a wealth-management firm answers "How did inflation in Japan compare with the US since 2020?" with official figures instead of guesses.

Input sent by the agent through MCP:

```json
{"presets": ["wb:inflation"], "countries": ["JP", "US"], "startYear": 2020, "endYear": 2024}
```

Output: 10 rows, each with a ready-to-quote `text` field such as `"Japan — Inflation, consumer prices (annual %) in 2023: 3.27 (+30.24% vs 2022), rank 2 of 2 countries compared. Source: World Bank."` Cost: **$0.003** per question.

#### 4. Market-entry consultant: weekly alert when new data is published

A consultant tracking emerging markets schedules a weekly run with `onlyNew: true` on population, GDP and GDP per capita for 15 countries. Most weeks return 0 rows and cost nothing beyond the run start. When the World Bank publishes a new year (or revises one), only those rows come back (`isRevision` shows revisions), and a Make scenario emails them to the team.

```json
{"presets": ["wb:gdp", "wb:gdpPerCapita", "wb:population"], "countries": ["IN","ID","VN","PH","NG","KE","EG","MA","BR","MX","CO","PE","TR","SA","BD"], "mostRecentValues": 3, "onlyNew": true}
```

### Use with the API

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("<username>/world-bank-eurostat-indicators").call(run_input={
    "worldBankIndicators": ["NY.GDP.PCAP.CD"],
    "countries": ["FR", "DE", "IT", "ES"],
    "startYear": 2015,
    "endYear": 2024,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["countryName"], row["period"], row["value"])
```

JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('<username>/world-bank-eurostat-indicators').call({
    presets: ['eurostat:inflationHicp'],
    countries: ['FR', 'DE', 'IT', 'ES'],
    startYear: 2019,
    endYear: 2025,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.table(items.map((r) => [r.countryName, r.period, r.value]));
```

Synchronous HTTP call returning the rows directly:

```
POST https://api.apify.com/v2/acts/<username>~world-bank-eurostat-indicators/run-sync-get-dataset-items?token=<TOKEN>
```

### Use with AI agents (MCP)

Add the actor to the Apify MCP server (`https://mcp.apify.com?actors=<username>/world-bank-eurostat-indicators`) in Claude Desktop, Cursor, VS Code or any MCP client. The agent passes indicator codes or presets, countries and years. Every row carries a one-sentence `text` summary, and `comparison.md` gives a compact table for the context window.

### Integrations

- **Google Sheets**: export the dataset to a sheet after every run (built-in integration)
- **Make / Zapier / n8n**: trigger on "Actor run succeeded" and get dataset items. Example n8n flow: *Schedule (every Monday) → Apify "Run actor" with `onlyNew: true` → IF items > 0 → Slack message "New GDP data: {{text}}"*
- **Webhooks, REST API, Python and JavaScript clients**
- Export formats: JSON, CSV, Excel, XML, RSS, HTML

### FAQ

**Where does the data come from?** Directly from the official open APIs: `api.worldbank.org/v2` and the Eurostat dissemination API (`ec.europa.eu/eurostat/api/dissemination`). Values are not modified, only reshaped and enriched (change, rank, labels).

**How do I find an indicator code?** World Bank: open the indicator on data.worldbank.org. The code is in the URL (`/indicator/NY.GDP.PCAP.CD`). Eurostat: the dataset code is shown in the data browser (e.g. `une_rt_a`). Add the filters you see in the browser as `?dimension=value`.

**Why is the latest year missing?** The World Bank publishes most annual indicators with a 1-year lag. Eurostat is often more recent for EU countries. Empty years are skipped and not charged.

**Are provisional values flagged?** Yes: `observationStatus` contains Eurostat flags such as `p (provisional)` or `e (estimated)`.

**Monthly or quarterly data?** Eurostat monthly and quarterly datasets work (`period` = `2025-06` or `2025-Q2`, `year` = 2025). The World Bank API mostly gives annual series.

**Does it work for aggregates?** Yes: World Bank `WLD`, `EUU`, `OED`, income groups, and Eurostat `EU27_2020`, `EA20`. Aggregates are not ranked against countries.

**What if I call it with an empty input?** It runs a small demo query (GDP per capita for FR, DE, IT, ES over the default years, about 40 datapoints) instead of failing. If you give indicators without countries, or countries without indicators, the run stops right away with a clear message and nothing is charged.

### Limits

- An Eurostat dataset without filters returns every dimension combination (and each one is a datapoint). Filter large datasets (`unit=`, `sex=`, `age=`…), or the request may be refused by Eurostat as too large.
- Indicator names, units and regions come from the sources in English.
- `rankAmongRequestedCountries` ranks only the countries in your request, highest value first, and ignores aggregates.
- The World Bank and Eurostat APIs sometimes slow down or return temporary errors. The actor retries 4 times with back-off, then skips that indicator (or only that country) with a clear log message (free). Other indicators keep going: they are fetched in parallel.
- `onlyNew` remembers values per indicator, country and period in the named key-value store `world-bank-eurostat-indicators-state` of your account. Delete it to start over.

# Actor input Schema

## `worldBankIndicators` (type: `array`):

World Bank indicator codes (WDI and other World Bank sources), e.g. NY.GDP.PCAP.CD (GDP per capita, current US$), FP.CPI.TOTL.ZG (inflation), SL.UEM.TOTL.ZS (unemployment), SP.POP.TOTL (population). Find codes on data.worldbank.org: the code is in the indicator page URL.

## `eurostatDatasets` (type: `array`):

Eurostat dataset code, optionally followed by dimension filters like in the Eurostat API: une_rt_a?age=Y15-74\&sex=T\&unit=PC_ACT (unemployment rate), prc_hicp_ainr?coicop18=TOTAL\&unit=RCH_A_AVG (HICP inflation), nama_10_pc?na_item=B1GQ\&unit=CP_EUR_HAB (GDP per capita in EUR). Countries and years come from the fields below. Without filters, every combination of the other dimensions is returned (and charged), so filter large datasets.

## `presets` (type: `array`):

Ready-made shortcuts added to the lists above: the most requested macroeconomic series from both sources.

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

ISO country codes, 2 or 3 letters (FR, DEU, US, JP...). World Bank aggregates work too (EUU = European Union, WLD = World, OED = OECD) and Eurostat aggregates (EU27_2020, EA20). Greece and the UK are converted automatically for Eurostat (EL, UK). Use "all" for every country and aggregate.

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

First year to return. Default: 10 years ago.

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

Last year to return. Default: current year (the latest available year is returned).

## `mostRecentValues` (type: `integer`):

If set (e.g. 1), ignores the years above and returns only the N latest periods published for each indicator. Handy for dashboards that only need the latest value.

## `skipEmptyValues` (type: `boolean`):

Do not return (nor charge) country-years with no published value.

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

Keep regional and income-group aggregates (World, Euro area, OECD...) in the results. Mostly useful with "all" countries.

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

Returns only datapoints not delivered by previous runs, plus revised values (flagged isRevision). The memory is kept in the named key-value store 'world-bank-eurostat-indicators-state'. Ideal for a weekly schedule that alerts you when a new year is published.

## `comparisonTable` (type: `boolean`):

Also saves a wide table (countries x years) per indicator in the key-value store: comparison.csv and comparison.md (ready for spreadsheets and LLM prompts). Free.

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

Stops after this many datapoints (0 = no limit). Keeps cost under control with "all" countries.

## Actor input object example

```json
{
  "worldBankIndicators": [
    "NY.GDP.PCAP.CD",
    "FP.CPI.TOTL.ZG",
    "SP.POP.TOTL"
  ],
  "eurostatDatasets": [
    "une_rt_a?age=Y15-74&sex=T&unit=PC_ACT"
  ],
  "presets": [],
  "countries": [
    "FR",
    "DE",
    "IT",
    "ES"
  ],
  "startYear": 2015,
  "endYear": 2024,
  "skipEmptyValues": true,
  "includeAggregates": true,
  "onlyNew": false,
  "comparisonTable": true,
  "maxResults": 0
}
```

# Actor output Schema

## `datapoints` (type: `string`):

No description

## `comparisonMarkdown` (type: `string`):

No description

## `comparisonCsv` (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 = {
    "worldBankIndicators": [
        "NY.GDP.PCAP.CD"
    ],
    "eurostatDatasets": [],
    "presets": [],
    "countries": [
        "FR",
        "DE",
        "IT",
        "ES"
    ],
    "startYear": 2015,
    "endYear": 2024
};

// Run the Actor and wait for it to finish
const run = await client.actor("actose/world-bank-eurostat-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 = {
    "worldBankIndicators": ["NY.GDP.PCAP.CD"],
    "eurostatDatasets": [],
    "presets": [],
    "countries": [
        "FR",
        "DE",
        "IT",
        "ES",
    ],
    "startYear": 2015,
    "endYear": 2024,
}

# Run the Actor and wait for it to finish
run = client.actor("actose/world-bank-eurostat-indicators").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 '{
  "worldBankIndicators": [
    "NY.GDP.PCAP.CD"
  ],
  "eurostatDatasets": [],
  "presets": [],
  "countries": [
    "FR",
    "DE",
    "IT",
    "ES"
  ],
  "startYear": 2015,
  "endYear": 2024
}' |
apify call actose/world-bank-eurostat-indicators --silent --output-dataset

```

## MCP server setup

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

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/g6Xg5OjC0WXEiAAB0/builds/Lc5H8OSo8GzdLr6kx/openapi.json
