# ECB EUR FX Rates, Policy Rates, Inflation & Invoice Tool (`itulo/ecb-fx-rates-macro`) Actor

Official European Central Bank (ECB SDMX 2.1) daily & historical EUR reference exchange rates, Eurosystem key policy interest rates (DFR/MRO/MLF), Eurozone HICP inflation, and B2B cross-currency invoice converter.

- **URL**: https://apify.com/itulo/ecb-fx-rates-macro.md
- **Developed by:** [Italo Armenti](https://apify.com/itulo) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 90.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 ecb fx rate, macro indicator, or converted invoice rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## ECB Official EUR Exchange Rates, Policy Rates, Inflation & Invoice Converter (`itulo/ecb-fx-rates-macro`)

All-in-one B2B accounting, ERP reconciliation, and macro-treasury feed powered by the official **European Central Bank (ECB) SDMX 2.1 Data Portal** (`data-api.ecb.europa.eu`):

1. **`fx_rates` (`EXR`)**: Daily & historical official EUR reference exchange rates for 30+ global currencies (`USD`, `GBP`, `SEK`, `NOK`, `DKK`, `CHF`, `JPY`, `PLN`, `CAD`, `AUD`, `CNY`, etc.) with both `ratePerEur` and `eurPerUnit`.
2. **`policy_rates` (`FM`)**: Eurosystem key interest rates — Deposit facility (`DFR`), Main refinancing operations (`MRR_FR`), and Marginal lending facility (`MLFR`).
3. **`hicp_inflation` (`ICP`)**: Euro Area (`U2`) and EU Member State (`FI`, `DE`, `FR`, `NL`, `SE`, etc.) HICP annual headline inflation rates.
4. **`invoice_converter`**: Batch B2B invoice & cross-currency reconciliation (`USD -> EUR`, `SEK -> EUR`, `USD -> SEK`, etc.) with automatic prior-business-day fallback on weekends and TARGET bank holidays.

Ships as both a **Pay-Per-Event Apify Actor** (`itulo/ecb-fx-rates-macro`) and an open-source **stdio MCP Server** (`src/mcp-server.js`).

> **Independent Tool Notice:** Not affiliated with or endorsed by the European Central Bank; uses no ECB logo. ECB reference rates are published for information purposes only.

***

### Pay-Per-Event Pricing (`PAY_PER_EVENT`)

| Event Name | Price (USD) | Description |
|---|---|---|
| `actor-start` | **$0.01 / run** | Flat fee for starting an Actor run |
| `macro-or-fx-record` | **$0.001 / record** ($1.00 / 1,000) | Each official ECB FX rate, policy interest rate, HICP inflation reading, or converted invoice row written to the dataset (primary event) |

***

### Data Licence & Attribution Compliance

- **Licence:** Reused under the official [Policy regarding the reuse of ESCB statistics](https://www.ecb.europa.eu/stats/ecb_statistics/governance_and_quality_framework/html/usage_policy.en.html).
- **Mandatory Attribution on Every Record:** `Source: ECB statistics (European Central Bank SDMX 2.1 Data Portal, data.ecb.europa.eu). Reused under the Policy regarding the reuse of ESCB statistics; reference rates are published for information purposes only.`

***

### Connect to Claude Desktop, Cursor & MCP Clients (Model Context Protocol)

You can use **`itulo/ecb-fx-rates-macro`** as a live tool inside **Claude Desktop**, **Cursor**, **Windsurf**, or any MCP-compatible AI agent in two ways:

#### Option A: Hosted Apify MCP Server (`@apify/actors-mcp-server`)

Zero local setup required. Add this to your `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`, Windows: `%APPDATA%\Claude\claude_desktop_config.json`) or Cursor `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "ecb-fx-macro": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "itulo/ecb-fx-rates-macro"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_API_TOKEN"
      }
    }
  }
}
```

#### Option B: Local Stdio MCP Server (Open-Source CLI)

Run the bundled stdio MCP server (`src/mcp-server.js`) directly on your machine. Exposed MCP tools: `ecb_fx_rates`, `ecb_policy_rates_and_inflation`, `ecb_convert_invoices`, `ecb_licence_info`.

```json
{
  "mcpServers": {
    "ecb-fx-macro-local": {
      "command": "node",
      "args": [
        "/absolute/path/to/tools/ecb-fx-rates-macro/src/mcp-server.js"
      ]
    }
  }
}
```

***

### n8n, Make.com & REST API Integration (One-Call Sync JSON)

Trigger **`itulo/ecb-fx-rates-macro`** synchronously and get the normalized JSON dataset items back in a single HTTP request — ideal for **n8n `HTTP Request` nodes**, **Make.com**, **Zapier**, or cron webhooks:

- **Method:** `POST`
- **Endpoint:** `https://api.apify.com/v2/acts/itulo~ecb-fx-rates-macro/run-sync-get-dataset-items?token=YOUR_APIFY_API_TOKEN`
- **Headers:** `Content-Type: application/json`

#### cURL Example

```bash
curl -s -X POST \
  "https://api.apify.com/v2/acts/itulo~ecb-fx-rates-macro/run-sync-get-dataset-items?token=${APIFY_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"modes":["fx_rates","policy_rates","hicp_inflation","invoice_converter"],"currencies":["USD","GBP","SEK","NOK","DKK","CHF","JPY","PLN"],"lastNObservations":5,"inflationAreas":["U2","FI","DE","FR"],"invoices":[{"invoiceId":"INV-001","amount":1500,"fromCurrency":"USD","toCurrency":"EUR"},{"invoiceId":"INV-002","amount":25000,"fromCurrency":"SEK","toCurrency":"EUR"}]}'
```

***

### LangChain, CrewAI, Node.js & Python SDK Snippets

#### Node.js (`apify-client`)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('itulo/ecb-fx-rates-macro').call({
  "modes": [
    "fx_rates",
    "policy_rates",
    "hicp_inflation",
    "invoice_converter"
  ],
  "currencies": [
    "USD",
    "GBP",
    "SEK",
    "NOK",
    "DKK",
    "CHF",
    "JPY",
    "PLN"
  ],
  "lastNObservations": 5,
  "inflationAreas": [
    "U2",
    "FI",
    "DE",
    "FR"
  ],
  "invoices": [
    {
      "invoiceId": "INV-001",
      "amount": 1500,
      "fromCurrency": "USD",
      "toCurrency": "EUR"
    },
    {
      "invoiceId": "INV-002",
      "amount": 25000,
      "fromCurrency": "SEK",
      "toCurrency": "EUR"
    }
  ]
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python (`apify-client` / LangChain `ApifyWrapper` / CrewAI)

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("itulo/ecb-fx-rates-macro").call(run_input={
  "modes": [
    "fx_rates",
    "policy_rates",
    "hicp_inflation",
    "invoice_converter"
  ],
  "currencies": [
    "USD",
    "GBP",
    "SEK",
    "NOK",
    "DKK",
    "CHF",
    "JPY",
    "PLN"
  ],
  "lastNObservations": 5,
  "inflationAreas": [
    "U2",
    "FI",
    "DE",
    "FR"
  ],
  "invoices": [
    {
      "invoiceId": "INV-001",
      "amount": 1500,
      "fromCurrency": "USD",
      "toCurrency": "EUR"
    },
    {
      "invoiceId": "INV-002",
      "amount": 25000,
      "fromCurrency": "SEK",
      "toCurrency": "EUR"
    }
  ]
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
for row in items:
    print(row)
```

#### LangChain Python Tool

```python
from langchain_community.utilities import ApifyWrapper

apify = ApifyWrapper()
loader = apify.call_actor(
    actor_id="itulo/ecb-fx-rates-macro",
    run_input={
  "modes": [
    "fx_rates",
    "policy_rates",
    "hicp_inflation",
    "invoice_converter"
  ],
  "currencies": [
    "USD",
    "GBP",
    "SEK",
    "NOK",
    "DKK",
    "CHF",
    "JPY",
    "PLN"
  ],
  "lastNObservations": 5,
  "inflationAreas": [
    "U2",
    "FI",
    "DE",
    "FR"
  ],
  "invoices": [
    {
      "invoiceId": "INV-001",
      "amount": 1500,
      "fromCurrency": "USD",
      "toCurrency": "EUR"
    },
    {
      "invoiceId": "INV-002",
      "amount": 25000,
      "fromCurrency": "SEK",
      "toCurrency": "EUR"
    }
  ]
},
    dataset_mapping_function=lambda item: str(item),
)
docs = loader.load()
```

***

### Frequently Asked Questions (FAQ)

#### Which official European Central Bank (ECB) datasets does this tool query?

It queries the official ECB SDMX 2.1 REST API (`data-api.ecb.europa.eu/service/data`) across three core dataflows: `EXR` (daily & historical official EUR reference exchange rates for 30+ currencies), `FM` (Eurosystem official policy interest rates: Deposit Facility `DFR`, Main Refinancing Operations `MRR_FR`, Marginal Lending Facility `MLFR`), and `ICP` (Harmonised Index of Consumer Prices `HICP` annual inflation rates for the Euro Area `U2` and EU Member States).

#### How does the B2B invoice converter handle weekends and TARGET bank holidays?

When converting an invoice on a weekend or TARGET closing day (or when no date is specified), `invoice_converter` automatically resolves the most recent published ECB reference rate on or before the target date and returns `effectiveRateDate`, `rateUsed`, `inverseRateUsed`, and the rounded `convertedAmount` — supporting both EUR conversions (`USD -> EUR`) and triangular cross-currency pairs (`USD -> SEK` via EUR).

#### Does this actor require an API key?

No. All ECB SDMX 2.1 endpoints are official keyless open statistics.

**Related Search Keywords:** ECB Exchange Rates API · European Central Bank SDMX 2.1 JSON API · Official EUR Reference FX Rates · ECB Deposit Facility & Policy Interest Rates API · Eurozone HICP Inflation API · B2B Multi-Currency Invoice Converter EUR · ECB FX MCP Server

# Actor input Schema

## `modes` (type: `array`):

Select which ECB feeds/tools to run: fx_rates, policy_rates, hicp_inflation, invoice_converter.

## `currencies` (type: `array`):

ISO 4217 currency codes for ECB EUR reference exchange rates.

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

Number of recent observations to retrieve per currency/indicator.

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

Optional start date for historical FX series.

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

Optional end date for historical FX series.

## `inflationAreas` (type: `array`):

Euro area (U2) and EU Member State codes for monthly HICP annual inflation rates.

## `invoices` (type: `array`):

Array of { invoiceId, amount, fromCurrency, toCurrency, date } objects to convert using official ECB reference rates.

## Actor input object example

```json
{
  "modes": [
    "fx_rates",
    "policy_rates",
    "hicp_inflation",
    "invoice_converter"
  ],
  "currencies": [
    "USD",
    "GBP",
    "SEK",
    "NOK",
    "DKK",
    "CHF",
    "JPY",
    "PLN",
    "CAD",
    "AUD"
  ],
  "lastNObservations": 5,
  "startPeriod": "",
  "endPeriod": "",
  "inflationAreas": [
    "U2",
    "FI",
    "DE",
    "FR",
    "NL",
    "SE"
  ],
  "invoices": [
    {
      "invoiceId": "INV-001",
      "amount": 1500,
      "fromCurrency": "USD",
      "toCurrency": "EUR"
    },
    {
      "invoiceId": "INV-002",
      "amount": 25000,
      "fromCurrency": "SEK",
      "toCurrency": "EUR"
    }
  ]
}
```

# Actor output Schema

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

Normalized ECB FX, policy rate, HICP inflation, and invoice conversion records with ESCB attribution.

## `summary` (type: `string`):

Summary metadata and mandatory ESCB attribution.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("itulo/ecb-fx-rates-macro").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("itulo/ecb-fx-rates-macro").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 '{}' |
apify call itulo/ecb-fx-rates-macro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,itulo/ecb-fx-rates-macro"
        }
    }
}
```

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/wJlv2elTB7fccZmS4/builds/CSJb6e29xDZCw0Pas/openapi.json
