GnistAI GnistAI
Log in

Getting Started with ECB Statistics

ECB Statistical Data Warehouse — 150+ datasets covering monetary policy, interest rates, inflation, bank lending, exchange rates, and financial markets for the euro area.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Finance

Data source: ECB Data API (SDMX 2.1)

Overview

ECB Statistics wraps ECB Data API (SDMX 2.1), handling authentication, pagination, and rate limits for you. This tutorial covers all 6 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-ecb-stats": {
      "url": "https://context.gnist.ai/mcp/ecb-stats/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (6)

search_datasets

Search the ECB dataset catalog by keyword. Returns matching datasets with their dataflow IDs needed for get_data, get_dataset_structure, and compare_series calls. ECB covers monetary policy, interest rates, inflation, bank lending, exchange rates, financial markets, and balance of payments for the euro area and EU member states. Args: query: Search term (e.g. "interest rate", "inflation", "lending"). limit: Number of results to return (1-50, default 20). Returns: List of matching datasets with id, name, agency, and description. Use the 'id' field as the dataflow parameter in other tools.

ParameterTypeRequiredDescription
querystringrequiredSearch term for ECB datasets (e.g. "interest rate", "inflation", "bank lending", "money supply", "exchange").
limitintegeroptionalNumber of results to return (1-50, default 20). (default: 20)
curl -X POST "https://context.gnist.ai/mcp/ecb-stats/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_datasets", "arguments": {"query": "interest rate"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/ecb-stats/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'interest rate'}, 'name': 'search_datasets'}},
)
print(resp.json())

list_datasets

List available ECB datasets, optionally filtered by topic. Browse the full ECB data catalog (150+ dataflows). Use this to discover what datasets exist before querying specific data. Args: topic: Optional topic filter keyword. Omit to list all datasets. limit: Maximum datasets to return (1-200, default 50). Returns: List of datasets with id, name, and description.

ParameterTypeRequiredDescription
topicanyoptionalOptional topic filter (e.g. "monetary", "exchange", "lending", "balance"). Omit to list all.
limitintegeroptionalMaximum datasets to return (1-200, default 50). (default: 50)
curl -X POST "https://context.gnist.ai/mcp/ecb-stats/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_datasets", "arguments": {"topic": "monetary"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/ecb-stats/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'topic': 'monetary'}, 'name': 'list_datasets'}},
)
print(resp.json())

get_dataset_structure

Get the dimension structure of an ECB dataset. Shows what dimensions (filters) are available for a dataset and their valid values. Use this before get_data to understand what currencies, frequencies, and other parameters are accepted. Args: dataflow: ECB dataflow identifier from search_datasets. Returns: List of dimensions with their valid codes/values. Each dimension shows its position in the SDMX key and sample values.

ParameterTypeRequiredDescription
dataflowstringrequiredECB dataflow identifier from search_datasets (e.g. "EXR", "IRS", "ICP", "BLS", "FM").
curl -X POST "https://context.gnist.ai/mcp/ecb-stats/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_dataset_structure", "arguments": {"dataflow": "EXR"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/ecb-stats/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'dataflow': 'EXR'}, 'name': 'get_dataset_structure'}},
)
print(resp.json())

get_data

Fetch data from an ECB dataset. Query any ECB dataset using SDMX key filters. Covers exchange rates, interest rates, inflation, money supply, bank lending, and 150+ more data series for the euro area and EU member states. Args: dataflow: ECB dataflow identifier. Use search_datasets to find IDs. key_filter: SDMX key filter. Use get_dataset_structure for valid values. start_period: Start period filter (e.g. "2015"). end_period: End period filter (e.g. "2023"). limit: Maximum observations to return (1-1000, default 200). Returns: Observations with all dimension labels and values.

ParameterTypeRequiredDescription
dataflowstringrequiredECB dataflow identifier (e.g. "EXR", "IRS", "ICP"). Use search_datasets to find IDs.
key_filteranyoptionalSDMX key filter (e.g. "M.USD.EUR.SP00.A" for monthly USD/EUR spot rate). Dot-separated dimension values. Use get_dataset_structure to find valid values. Omit for all data.
start_periodanyoptionalStart period (e.g. "2015", "2020-Q1", "2020-01").
end_periodanyoptionalEnd period (e.g. "2023", "2023-Q4", "2023-12").
limitintegeroptionalMaximum observations to return (1-1000, default 200). (default: 200)
curl -X POST "https://context.gnist.ai/mcp/ecb-stats/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_data", "arguments": {"dataflow": "EXR"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/ecb-stats/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'dataflow': 'EXR'}, 'name': 'get_data'}},
)
print(resp.json())

compare_series

Compare multiple data series from the same ECB dataset. Fetches multiple series side by side for comparison. Useful for comparing exchange rates, interest rates across countries, or different inflation measures. Args: dataflow: ECB dataflow identifier. keys: SDMX key filters to compare. Maximum 10. start_period: Start period. Omit for most recent data. end_period: End period. Omit for most recent data. Returns: Data grouped by series key for easy comparison.

ParameterTypeRequiredDescription
dataflowstringrequiredECB dataflow identifier (e.g. "EXR", "IRS").
keyslist[string]requiredSDMX key filters to compare (e.g. ["M.USD.EUR.SP00.A", "M.GBP.EUR.SP00.A"]). Maximum 10.
start_periodanyoptionalStart period (e.g. "2020"). Omit for most recent data.
end_periodanyoptionalEnd period (e.g. "2023"). Omit for most recent data.
curl -X POST "https://context.gnist.ai/mcp/ecb-stats/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "compare_series", "arguments": {"dataflow": "EXR", "keys": "[\"M.USD.EUR.SP00.A\""}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/ecb-stats/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'dataflow': 'EXR', 'keys': '["M.USD.EUR.SP00.A"'},
            'name': 'compare_series'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/ecb-stats/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/ecb-stats/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_datasets to find items, then get_dataset_structure to get full details. This two-step pattern is common for exploring data before drilling down.
Pagination
Several tools support limit, offset, or page parameters. Start with small limits during development, then increase for production queries.

FAQ

What data does ECB Statistics provide?

ECB Statistical Data Warehouse — 150+ datasets covering monetary policy, interest rates, inflation, bank lending, exchange rates, and financial markets for the euro area. It exposes 6 tools: search_datasets, list_datasets, get_dataset_structure, get_data, compare_series, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the ECB Statistics API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials