# ECB Statistics Scraper (`crawlerbros/ecb-statistics-scraper`) Actor

Fetch time-series statistical data from the European Central Bank (ECB) Statistical Data Warehouse - exchange rates, interest rates, money supply, economic indicators. No API key required.

- **URL**: https://apify.com/crawlerbros/ecb-statistics-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 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

## ECB Statistics Scraper

Fetch time-series economic and financial data from the **European Central Bank (ECB) Statistical Data Warehouse** — the official source for eurozone exchange rates, interest rates, money supply, inflation, balance of payments, and 100+ other macroeconomic indicators. No API key or registration required.

---

### What data can I get?

- **Exchange rates** (EUR/USD, EUR/GBP, EUR/JPY, and 50+ currencies) — daily, monthly, quarterly, annual
- **Euro area interest rates** — ECB policy rates, EURIBOR, government bond yields
- **Money and banking statistics** — M1/M2/M3 money supply, bank lending, deposits
- **Inflation & HICP** — euro area consumer price indices, national breakdowns
- **Balance of payments** — current account, trade, capital flows
- **Macro-national accounts** — GDP, investment, consumption (100+ series)
- **And 100+ additional datasets** across 103 ECB statistical dataflows

---

### Modes

#### Fetch Time Series (`fetchSeries`)
Retrieve actual observations (data points) for a specific statistical series. Each output record is one observation (e.g., one month's EUR/USD exchange rate).

**Input:**
- `datasetId`: The dataset identifier (e.g., `EXR` for Exchange Rates)
- `seriesKey`: Dot-separated dimension values that identify the series (e.g., `M.USD.EUR.SP00.A`)
- `lastNObservations`: How many of the most recent observations to fetch (default: 24)
- `startPeriod` / `endPeriod`: Optional date range filters (e.g., `2020-01` to `2024-12`)

**Example output record:**
```json
{
  "dataset_id": "EXR",
  "series_key": "M.USD.EUR.SP00.A",
  "date": "2024-05",
  "value": 1.0801,
  "unit": "USD",
  "freq": "M",
  "currency": "USD",
  "currency_denom": "EUR",
  "exr_type": "SP00",
  "exr_suffix": "A",
  "series_title": "ECB reference exchange rate, US dollar/Euro, 2.15 pm (C.E.T.)",
  "scrapedAt": "2024-06-01T12:00:00+00:00"
}
````

***

#### List All Datasets (`listDatasets`)

Discover all 103 ECB statistical datasets (dataflows) available in the data warehouse.

**Example output record:**

```json
{
  "id": "EXR",
  "name": "Exchange Rates",
  "agency": "ECB",
  "version": "1.0",
  "scrapedAt": "2024-06-01T12:00:00+00:00"
}
```

***

#### Browse Series Keys (`browseSeries`)

Explore all available series within a specific dataset. Use this to discover which series keys are valid before fetching observations.

**Input:** `datasetId` (required)

**Example output record:**

```json
{
  "dataset_id": "EXR",
  "series_key": "M.USD.EUR.SP00.A",
  "freq": "M",
  "currency": "USD",
  "currency_denom": "EUR",
  "exr_type": "SP00",
  "exr_suffix": "A",
  "scrapedAt": "2024-06-01T12:00:00+00:00"
}
```

***

### Common Series Keys

| Description | datasetId | seriesKey |
|---|---|---|
| EUR/USD monthly average | EXR | M.USD.EUR.SP00.A |
| EUR/GBP monthly average | EXR | M.GBP.EUR.SP00.A |
| EUR/JPY monthly average | EXR | M.JPY.EUR.SP00.A |
| EUR/CHF daily rate | EXR | D.CHF.EUR.SP00.A |
| EUR/CNY monthly average | EXR | M.CNY.EUR.SP00.A |

For other datasets (HICP, BSI, MNA, etc.), use `browseSeries` mode to discover valid series keys.

***

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | select | fetchSeries | What to fetch: fetchSeries, listDatasets, or browseSeries |
| `datasetId` | string | EXR | ECB dataset ID (e.g., EXR, BSI, ILM, MNA, HICP) |
| `seriesKey` | string | M.USD.EUR.SP00.A | Dot-separated series identifier |
| `lastNObservations` | integer | 24 | Number of most recent data points (0 = all available) |
| `startPeriod` | string | — | Start of date range (e.g., 2020-01) |
| `endPeriod` | string | — | End of date range (e.g., 2024-12) |
| `maxItems` | integer | 200 | Maximum records to return |

***

### Output Fields (fetchSeries mode)

| Field | Type | Description |
|---|---|---|
| `dataset_id` | string | ECB dataset identifier (e.g., "EXR") |
| `series_key` | string | Full dot-separated series key |
| `date` | string | Observation period (e.g., "2024-01" for monthly) |
| `value` | number | The numeric statistical value |
| `unit` | string | Measurement unit (e.g., "USD", "EUR", "PURE\_NUMB") |
| `freq` | string | Frequency: D (daily), M (monthly), Q (quarterly), A (annual) |
| `series_title` | string | Human-readable description of the series |
| `scrapedAt` | string | ISO 8601 timestamp when the record was collected |

Additional dimension fields (e.g., `currency`, `currency_denom`, `exr_type`) are included depending on the dataset.

***

### Data Source

All data is sourced from the **ECB Statistical Data Warehouse (SDW)** public REST API at `https://data-api.ecb.europa.eu/service/`. This is the official ECB open data platform — no registration, API keys, or authentication is required. Data is published by the European Central Bank and National Central Banks of the Eurosystem.

***

### FAQs

**Q: How current is the data?**\
A: Exchange rates and most financial statistics are updated daily or monthly by the ECB. The API always returns the latest published data.

**Q: How do I find the right series key?**\
A: Use `listDatasets` mode to find dataset IDs, then `browseSeries` mode on the dataset to discover available series keys. The ECB's official SDW browser at [sdw.ecb.europa.eu](https://sdw.ecb.europa.eu) also shows series keys.

**Q: What does the seriesKey format mean?**\
A: Each dot-separated part corresponds to a dimension of the dataset. For EXR: `FREQ.CURRENCY.CURRENCY_DENOM.EXR_TYPE.EXR_SUFFIX` — e.g., `M.USD.EUR.SP00.A` means Monthly, USD, Euro-denominated, Spot rate, Average.

**Q: Can I fetch multiple series at once?**\
A: The current mode fetches one series at a time. Use `browseSeries` to list all series and run multiple actor calls, or use wildcards in the series key where the API supports them (e.g., `M.*.EUR.SP00.A` fetches all currencies).

**Q: What is the maximum date range I can request?**\
A: The ECB API returns up to 1000 observations per series. Set `lastNObservations=0` to fetch all available history, or use `startPeriod`/`endPeriod` to specify a range.

**Q: Does this require a proxy or API key?**\
A: No. The ECB SDW is a free public API with no rate limits, no authentication, and no proxy required.

**Q: What currencies are available for exchange rates?**\
A: The ECB publishes reference rates for 50+ currencies against the Euro, including USD, GBP, JPY, CHF, CNY, CAD, AUD, SEK, NOK, and many more. Use `browseSeries` on the EXR dataset to see the full list.

# Actor input Schema

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

What to fetch from the ECB API.

## `datasetId` (type: `string`):

ECB dataset (dataflow) identifier. Examples: EXR (Exchange Rates), ILM (Intra-day Liquidity), MNA (Macro-National Accounts), BSI (Balance Sheet Items). Required for fetchSeries and browseSeries.

## `seriesKey` (type: `string`):

Dot-separated dimension values that identify the series. Example: M.USD.EUR.SP00.A (monthly USD/EUR spot rate average). Required for fetchSeries mode.

## `lastNObservations` (type: `integer`):

Number of most recent observations to fetch per series. Default is 24 (2 years of monthly data). Set to 0 to fetch all available observations.

## `startPeriod` (type: `string`):

Filter observations from this period (inclusive). Format: YYYY, YYYY-Q1/Q2/Q3/Q4, YYYY-MM, or YYYY-MM-DD depending on frequency. Example: 2020-01

## `endPeriod` (type: `string`):

Filter observations up to this period (inclusive). Format: YYYY, YYYY-Q1/Q2/Q3/Q4, YYYY-MM, or YYYY-MM-DD depending on frequency. Example: 2024-12

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

Maximum number of records to return across all series. Default is 200.

## Actor input object example

```json
{
  "mode": "fetchSeries",
  "datasetId": "EXR",
  "seriesKey": "M.USD.EUR.SP00.A",
  "lastNObservations": 24,
  "maxItems": 200
}
```

# Actor output Schema

## `ecbStatistics` (type: `string`):

Dataset containing ECB statistical observations (fetchSeries mode) or dataset/series metadata (listDatasets / browseSeries modes).

# 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": "fetchSeries",
    "datasetId": "EXR",
    "seriesKey": "M.USD.EUR.SP00.A",
    "lastNObservations": 24,
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/ecb-statistics-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 = {
    "mode": "fetchSeries",
    "datasetId": "EXR",
    "seriesKey": "M.USD.EUR.SP00.A",
    "lastNObservations": 24,
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/ecb-statistics-scraper").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 '{
  "mode": "fetchSeries",
  "datasetId": "EXR",
  "seriesKey": "M.USD.EUR.SP00.A",
  "lastNObservations": 24,
  "maxItems": 200
}' |
apify call crawlerbros/ecb-statistics-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ECB Statistics Scraper",
        "description": "Fetch time-series statistical data from the European Central Bank (ECB) Statistical Data Warehouse - exchange rates, interest rates, money supply, economic indicators. No API key required.",
        "version": "1.0",
        "x-build-id": "ydPqA3iSzFFU92z0J"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~ecb-statistics-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-ecb-statistics-scraper",
                "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/crawlerbros~ecb-statistics-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-ecb-statistics-scraper",
                "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/crawlerbros~ecb-statistics-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-ecb-statistics-scraper",
                "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": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "fetchSeries",
                            "listDatasets",
                            "browseSeries"
                        ],
                        "type": "string",
                        "description": "What to fetch from the ECB API.",
                        "default": "fetchSeries"
                    },
                    "datasetId": {
                        "title": "Dataset ID",
                        "type": "string",
                        "description": "ECB dataset (dataflow) identifier. Examples: EXR (Exchange Rates), ILM (Intra-day Liquidity), MNA (Macro-National Accounts), BSI (Balance Sheet Items). Required for fetchSeries and browseSeries.",
                        "default": "EXR"
                    },
                    "seriesKey": {
                        "title": "Series Key",
                        "type": "string",
                        "description": "Dot-separated dimension values that identify the series. Example: M.USD.EUR.SP00.A (monthly USD/EUR spot rate average). Required for fetchSeries mode.",
                        "default": "M.USD.EUR.SP00.A"
                    },
                    "lastNObservations": {
                        "title": "Last N Observations",
                        "minimum": 0,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Number of most recent observations to fetch per series. Default is 24 (2 years of monthly data). Set to 0 to fetch all available observations.",
                        "default": 24
                    },
                    "startPeriod": {
                        "title": "Start Period",
                        "type": "string",
                        "description": "Filter observations from this period (inclusive). Format: YYYY, YYYY-Q1/Q2/Q3/Q4, YYYY-MM, or YYYY-MM-DD depending on frequency. Example: 2020-01"
                    },
                    "endPeriod": {
                        "title": "End Period",
                        "type": "string",
                        "description": "Filter observations up to this period (inclusive). Format: YYYY, YYYY-Q1/Q2/Q3/Q4, YYYY-MM, or YYYY-MM-DD depending on frequency. Example: 2024-12"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum number of records to return across all series. Default is 200.",
                        "default": 200
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
