# Exchange Rates API: ECB Reference and Market FX Rates (`capable_coach/currency-rates-scraper`) Actor

Daily exchange rates as JSON, one row per date and currency pair: the ECB reference rate, Frankfurter history and a daily market snapshot side by side, with spread between sources, inverse rate and an agreement label. No API key. $0.50 per 1,000 rows.

- **URL**: https://apify.com/capable_coach/currency-rates-scraper.md
- **Developed by:** [jules imbert](https://apify.com/capable_coach) (community)
- **Categories:** Developer tools, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 rate 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

One row per date and currency pair, with the rate from each public source side by side: the European Central Bank reference rate, Frankfurter history and a daily market snapshot, plus the spread between them.

### What you get

- `pair`, `base`, `quote`, `date`, `rate` (your preferred source, ECB by default) and `inverseRate`.
- `sources`: the value from every source that quoted the pair on that date, with `sourceCount`, `low` and `high`.
- `spreadPct` and an `agreement` label (`single-source`, `exact`, `tight`, `close`, `divergent`).
- Or one row per source with `rows: "source"`, including the source URL.
- ECB history from 1999; about 30 ECB currencies and about 150 fiat codes in the market snapshot (last 92 days of a range).

Real output shape (trimmed):

```json
{
  "date": "2026-11-20",
  "pair": "EUR/USD",
  "base": "EUR",
  "quote": "USD",
  "rate": 1.099,
  "inverseRate": 0.90991811,
  "sources": { "ecb": 1.099, "currencyapi": 1.09862555, "frankfurter": 1.099 },
  "sourceCount": 3,
  "spreadPct": 0.0341,
  "agreement": "tight",
  "low": 1.09862555,
  "high": 1.099,
  "preferredSource": "ecb"
}
```

### Who it's for

- **Developers and data teams** who need a daily FX table in a database without managing three feeds.
- **Finance and accounting teams** reconciling an invoice rate against the ECB reference rate.
- **Analysts** checking when sources diverge: a `divergent` row means the gap exceeds 2 %.
- **Researchers** pulling ECB history by date range.

### How to use

1. Set `baseCurrencies` (for example `EUR`, `USD`) and `quoteCurrencies` (3-letter ISO 4217 codes), and choose the `sources` (`ecb`, `frankfurter`, `currencyapi`).
2. Choose the dates with `dateRange`: `latest`, `lastNDays` (with `days`) or `custom` (`startDate`, `endDate`, up to 3,650 days).
3. Run it and export JSON, CSV or Excel. Use `rows: "pair"` (default) for one row per pair and date, or `"source"` for one row per source.

Example input:

```json
{
  "baseCurrencies": ["EUR", "USD"],
  "quoteCurrencies": ["USD", "GBP", "JPY", "CHF"],
  "dateRange": { "mode": "lastNDays", "days": 30 },
  "sources": ["ecb", "frankfurter", "currencyapi"],
  "rows": "pair",
  "maxResults": 5000
}
```

### Pricing

Pay per event, no subscription: **$0.0005 per run start** (one event per GB of memory, minimum one) plus **$0.0005 per row** written to the dataset.

| Volume (Free plan) | Cost |
|---|---|
| 100 rows | $0.0505 |
| 1,000 rows | $0.5005 |

Example from the maintainers' own run: 23 pairs over 30 dates produced 690 rows. Charging starts only once at least one row exists; an input with no published rate fails with a message and writes nothing. `maxResults` caps what one run can spend.

Set the run's *Maximum cost per run* in Apify to cap spending in advance.

### FAQ

**Where do the rates come from?**
The ECB's published reference rates (EUR base), Frankfurter's JSON service (ECB series) and a daily market snapshot published as open data. All are public endpoints; no key or account.

**Why do some weekend dates have only one source?**
The ECB publishes Monday to Friday and skips TARGET holidays, so weekend rows carry the market snapshot only, labelled `single-source`.

**What does `divergent` mean?**
The spread between sources is above 2 %. Example in the source data: on 2026-10-26 the ECB fixing for EUR/BRL was 6.2523 while the market snapshot gave 5.58581161, a spread of 10.66 %. It is information, not an error; the row keeps both values.

**Can I get historical rates?**
ECB and Frankfurter history from 1999. The market snapshot covers only the last 92 days of a range.

**How many currencies are covered?**
About 30 for the ECB; about 150 fiat codes for the market snapshot. A code that no selected source quotes is skipped.

**Is this a trading-grade FX feed?**
No. These are daily reference and snapshot values, not tick data.

### Limits

- Daily values only; no intraday quotes.
- ECB values exist on publishing days only; weekends come from the market snapshot alone.
- The market snapshot is limited to the last 92 days of a long range.
- A failing feed does not fail the run as long as another feed returns data; failures are listed in the run summary.
- Retries: three attempts with exponential back-off on network errors, 429 and 5xx.
- Not affiliated with the ECB or Frankfurter.

# Changelog

This Actor's version history is a separate document: https://apify.com/capable_coach/currency-rates-scraper/changelog.md

# Actor input Schema

## `baseCurrencies` (type: `array`):

One block of pairs per base currency, as 3-letter ISO 4217 codes.

## `quoteCurrencies` (type: `array`):

Currencies quoted against each base. 3-letter ISO 4217 codes; the ECB publishes about 30, the market snapshot about 150 fiat codes.

## `dateRange` (type: `object`):

latest = most recent published date per source. lastNDays = the last N calendar days. custom = explicit startDate and endDate (YYYY-MM-DD).

## `sources` (type: `array`):

ecb = European Central Bank reference rates (EUR base, official XML). frankfurter = Frankfurter JSON, ECB series with any base back to 1999. currencyapi = daily market snapshots, about 150 fiat codes, one file per day (last 92 days of a range).

## `rows` (type: `string`):

pair: the sources of a pair are grouped in `sources`, with `rate`, `spreadPct` and `agreement`. source: one row per feed, with `source` and `sourceUrl`.

## `preferSource` (type: `string`):

Value written in `rate` when `rows` is `pair`. Other feeds stay visible in `sources`; the fallback order follows the source list.

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

Hard cap on dataset rows. The run stops cleanly at this number instead of building a huge dataset by accident.

## Actor input object example

```json
{
  "baseCurrencies": [
    "EUR",
    "USD"
  ],
  "quoteCurrencies": [
    "USD",
    "GBP",
    "JPY",
    "CHF",
    "CAD",
    "AUD",
    "CNY",
    "SEK",
    "NOK",
    "PLN",
    "INR",
    "BRL"
  ],
  "dateRange": {
    "mode": "lastNDays",
    "days": 30
  },
  "sources": [
    "ecb",
    "frankfurter",
    "currencyapi"
  ],
  "rows": "pair",
  "preferSource": "ecb",
  "maxResults": 5000
}
```

# Actor output Schema

## `items` (type: `string`):

No description

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

No description

## `output` (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 = {
    "baseCurrencies": [
        "EUR",
        "USD"
    ],
    "quoteCurrencies": [
        "USD",
        "GBP",
        "JPY",
        "CHF",
        "CAD",
        "AUD",
        "CNY",
        "SEK",
        "NOK",
        "PLN",
        "INR",
        "BRL"
    ],
    "dateRange": {
        "mode": "lastNDays",
        "days": 30
    },
    "sources": [
        "ecb",
        "frankfurter",
        "currencyapi"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("capable_coach/currency-rates-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 = {
    "baseCurrencies": [
        "EUR",
        "USD",
    ],
    "quoteCurrencies": [
        "USD",
        "GBP",
        "JPY",
        "CHF",
        "CAD",
        "AUD",
        "CNY",
        "SEK",
        "NOK",
        "PLN",
        "INR",
        "BRL",
    ],
    "dateRange": {
        "mode": "lastNDays",
        "days": 30,
    },
    "sources": [
        "ecb",
        "frankfurter",
        "currencyapi",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("capable_coach/currency-rates-scraper").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 '{
  "baseCurrencies": [
    "EUR",
    "USD"
  ],
  "quoteCurrencies": [
    "USD",
    "GBP",
    "JPY",
    "CHF",
    "CAD",
    "AUD",
    "CNY",
    "SEK",
    "NOK",
    "PLN",
    "INR",
    "BRL"
  ],
  "dateRange": {
    "mode": "lastNDays",
    "days": 30
  },
  "sources": [
    "ecb",
    "frankfurter",
    "currencyapi"
  ]
}' |
apify call capable_coach/currency-rates-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,capable_coach/currency-rates-scraper"
        }
    }
}
```

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/cYhPQojEDZjBNK23h/builds/TX6moPeh4m3LxZ4E5/openapi.json
