# Forex & Currency Exchange Rates Scraper | 2Space (`2space/forex-exchange-rates-scraper`) Actor

Zero-browser forex and currency exchange rates scraper powered by European Central Bank (ECB) reference data. Extract live spot rates, converted amounts, historical dates, and multi-day time series for 30+ currencies.

- **URL**: https://apify.com/2space/forex-exchange-rates-scraper.md
- **Developed by:** [2Space Group](https://apify.com/2space) (community)
- **Categories:** Business, AI, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 exchange rates scraped

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/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

## Forex & Currency Exchange Rates Scraper | 2Space

> **Built by 2Space** · Zero-browser **forex exchange rates scraper**, **ECB currency conversion API**, and **historical FX time-series extractor** engineered for AI agents, MCP clients, finance teams, and multi-currency workflows.

[![Apify Actor](https://img.shields.io/badge/Apify-forex--exchange--rates--scraper-00C853?style=flat-square)](https://apify.com/2space/forex-exchange-rates-scraper)
[![MCP Ready](https://img.shields.io/badge/MCP-Ready-2563EB?style=flat-square)](https://mcp.apify.com?tools=2space/forex-exchange-rates-scraper)
[![Zero Browser](https://img.shields.io/badge/Runtime-Pure%20HTTP-7C3AED?style=flat-square)](https://apify.com/2space/forex-exchange-rates-scraper)

Whether you need a fast **forex exchange rates scraper** for live European Central Bank (ECB) spot rates, an automated **currency converter API** for 30+ global currencies, or **historical FX time-series data** for accounting, invoicing, and quantitative workflows, this Actor delivers clean JSON and CSV records in seconds with zero API keys.

***

### Why Choose This Scraper?

- **Pure HTTP Speed with Automatic Failover:** Queries `https://api.frankfurter.dev/v1/...` with automatic fallback to `https://api.frankfurter.app/...`, finishing default runs in under 3 seconds.
- **Live Spot, Historical Date & Time-Series Modes:** Fetch today's rates, look up any past `YYYY-MM-DD` settlement date, or pull multi-day FX histories across 30+ ECB reference currencies.
- **Flat, Finance-Ready Output:** Returns `baseCurrency`, `baseCurrencyName`, `targetCurrency`, `targetCurrencyName`, `rate`, `inverseRate`, `amount`, `convertedAmount`, `rateDate`, `mode`, and `source`.
- **Empty `{}` Input Ready:** Works immediately with zero configuration—running `{}` fetches `USD` exchange rates across `EUR`, `GBP`, `JPY`, `CAD`, `AUD`, `CHF`, `CNY`, `INR`, `MXN`, and `BRL`.
- **No Data, No Charge (Pay-Per-Event):** Uses the single `rate-scraped` event (`count: 1`), charged **only after** a validated rate record is pushed to the dataset, protected by `maxItems` and `maxCostUsd` caps.

***

### Popular Use Cases

- **SaaS & E-Commerce Multi-Currency Pricing:** Sync daily ECB reference rates and converted catalog prices automatically via n8n or Apify REST API.
- **AI Financial Agents & MCP Workflows:** Give Claude, ChatGPT, or Cursor instant live and historical FX conversion without hallucinated exchange rates.
- **Treasury & Accounting Reconciliation:** Pull exact historical `YYYY-MM-DD` rates or multi-day ranges (`startDate`..`endDate`) into spreadsheets or data warehouses.

***

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `baseCurrency` | `string` | `"USD"` | 3-letter ISO 4217 base currency code (e.g., `USD`, `EUR`, `GBP`, `JPY`). |
| `targetCurrencies` | `string[]` | `["EUR","GBP","JPY","CAD","AUD","CHF","CNY","INR","MXN","BRL"]` | Target currency codes (pass `[]` to fetch all 30+ ECB currencies). |
| `amount` | `number` | `1` | Amount in `baseCurrency` to convert into each target currency. |
| `date` | `string` | `""` | Optional historical date (`YYYY-MM-DD`). |
| `startDate` | `string` | `""` | Optional start date (`YYYY-MM-DD`) for time-series extraction. |
| `endDate` | `string` | `""` | Optional end date (`YYYY-MM-DD`) for time-series extraction. |
| `maxItems` | `integer` | `30` | Hard cap on rate rows pushed and charged per run (`1` to `1000`). |
| `maxCostUsd` | `number` | `0.25` | Pre-charge spending safety cap in USD for Pay-Per-Event billing. |

***

### Example JSON Output

```json
{
  "baseCurrency": "USD",
  "baseCurrencyName": "United States Dollar",
  "targetCurrency": "EUR",
  "targetCurrencyName": "Euro",
  "rate": 0.9495,
  "inverseRate": 1.053186,
  "amount": 1,
  "convertedAmount": 0.9495,
  "rateDate": "2026-12-03",
  "mode": "latest",
  "source": "European Central Bank (Frankfurter)",
  "sourceUrl": "https://api.frankfurter.dev/v1/latest?base=USD&symbols=EUR%2CGBP...",
  "extractedAt": "2026-12-03T18:00:00.000Z"
}
```

Execution diagnostics are saved to the default Key-Value Store under `RUN_DIAGNOSTICS`.

***

### 1-Prompt MCP & AI Agent Setup

Connect `2space/forex-exchange-rates-scraper` to Claude Desktop, Cursor, ChatGPT, or Antigravity via the Apify MCP endpoint:

```text
https://mcp.apify.com?tools=2space/forex-exchange-rates-scraper
```

```json
{
  "mcpServers": {
    "apify-forex": {
      "url": "https://mcp.apify.com?tools=2space/forex-exchange-rates-scraper",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

***

### Pricing & No Data, No Charge

- **Event:** `rate-scraped` (`count: 1` per validated pushed currency rate row).
- **No Data, No Charge:** If no valid rate rows are returned, `Actor.charge()` is never called.

***

New to Apify? [Create a free Apify account](https://apify.com?fpr=2space) ($5 monthly free platform credits included) to run this Actor via API or MCP.

# Actor input Schema

## `baseCurrency` (type: `string`):

3-letter base currency code (e.g., 'USD', 'EUR', 'GBP', 'JPY').

## `targetCurrencies` (type: `array`):

List of target ISO 4217 currency codes to convert into (leave empty to fetch all 30+ supported ECB currencies).

## `amount` (type: `number`):

Amount in Base Currency to convert into each target currency.

## `date` (type: `string`):

Optional single historical date in YYYY-MM-DD format (e.g., '2025-01-15'). Ignored if startDate is set.

## `startDate` (type: `string`):

Optional start date in YYYY-MM-DD format for multi-day historical time-series extraction.

## `endDate` (type: `string`):

Optional end date in YYYY-MM-DD format when startDate is provided (defaults to latest available date).

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

Hard cap on the maximum number of currency rate rows to push and charge.

## `maxCostUsd` (type: `number`):

Pre-charge spending safety cap in USD for Pay-Per-Event billing.

## Actor input object example

```json
{
  "baseCurrency": "USD",
  "targetCurrencies": [
    "EUR",
    "GBP",
    "JPY",
    "CAD",
    "AUD",
    "CHF",
    "CNY",
    "INR",
    "MXN",
    "BRL"
  ],
  "amount": 1,
  "date": "",
  "startDate": "",
  "endDate": "",
  "maxItems": 30,
  "maxCostUsd": 0.25
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset items containing extracted ECB forex exchange rates and conversions.

# 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 = {
    "baseCurrency": "USD",
    "targetCurrencies": [
        "EUR",
        "GBP",
        "JPY",
        "CAD",
        "AUD",
        "CHF",
        "CNY",
        "INR",
        "MXN",
        "BRL"
    ],
    "amount": 1,
    "date": "",
    "startDate": "",
    "endDate": "",
    "maxItems": 30,
    "maxCostUsd": 0.25
};

// Run the Actor and wait for it to finish
const run = await client.actor("2space/forex-exchange-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 = {
    "baseCurrency": "USD",
    "targetCurrencies": [
        "EUR",
        "GBP",
        "JPY",
        "CAD",
        "AUD",
        "CHF",
        "CNY",
        "INR",
        "MXN",
        "BRL",
    ],
    "amount": 1,
    "date": "",
    "startDate": "",
    "endDate": "",
    "maxItems": 30,
    "maxCostUsd": 0.25,
}

# Run the Actor and wait for it to finish
run = client.actor("2space/forex-exchange-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 '{
  "baseCurrency": "USD",
  "targetCurrencies": [
    "EUR",
    "GBP",
    "JPY",
    "CAD",
    "AUD",
    "CHF",
    "CNY",
    "INR",
    "MXN",
    "BRL"
  ],
  "amount": 1,
  "date": "",
  "startDate": "",
  "endDate": "",
  "maxItems": 30,
  "maxCostUsd": 0.25
}' |
apify call 2space/forex-exchange-rates-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,2space/forex-exchange-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/GtY6qWeKnzH0t6Ze6/builds/U8piDVRQKXUdBmgxX/openapi.json
