# Exchange Rates: latest, historical, time series and conversion (`examsens.ai/exchange-rates`) Actor

Currency exchange rates from the Frankfurter API: latest and historical rates, daily, weekly or monthly time series back to 1948, amount conversions, for 200+ currencies from central banks and official sources. No API key.

- **URL**: https://apify.com/examsens.ai/exchange-rates.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 rate returneds

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

## Exchange Rates: latest, historical, time series and conversion

Currency exchange rates from the open Frankfurter API in one run: today's rates, rates on any past date, daily, weekly or monthly time series, and amount conversions. Frankfurter collects rates from central banks and official sources for more than 200 currencies, with history back to 1948 for some of them. No API key needed.

You get one row per rate with the date, base currency, quote currency and rate, and for conversions the amount and the converted value.

### Input

- Base currency (default EUR) and the quote currencies you want. Leave quotes empty for every currency available.
- Latest rates: on by default.
- Historical dates: any number, as YYYY-MM-DD. On a day the provider published nothing, such as a weekend for the ECB, you get its last earlier rate with that rate's own date.
- Time series: a start date, an end date (default today) and a step: daily, weekly or monthly. Long ranges are fetched a calendar year at a time.
- Conversions: lines such as `100 USD to EUR` or `2,500.50 GBP JPY 2024-05-15`.
- Provider: leave empty for rates blended across all providers, or give one provider key, such as `ECB` for European Central Bank reference rates.
- Show contributing providers: for blended rates, adds each provider's own rate behind every row.
- Maximum rows (default 10,000).

### Output

One dataset item per rate, with `type` (`latest`, `historical`, `timeSeries` or `conversion`), `request`, `date`, `base`, `quote`, `rate` and `provider` (`blended` or the provider key). Conversions add `amount` and `converted`. With contributing providers on, `providers` lists each source's key, date and rate. A malformed date or conversion line, an unknown currency, and a date outside the provider's coverage each give an item with `error`.

### Source and terms

Rates come from Frankfurter (frankfurter.dev). Frankfurter is free for commercial use. Frankfurter states that the rates themselves fall under each provider's terms, so every row names its provider scope, and contributing providers can be listed. Frankfurter returns mid-market rates; for official reference rates, choose a single provider such as ECB. Frankfurter sets no daily or monthly cap and rate limits only to prevent abuse; this actor sends one request at a time.

The actor is not affiliated with or endorsed by Frankfurter or any central bank.

### Pricing

Pay per event: one `rate-returned` event per row returned, conversions included. Errors are not charged. The run stops at your maximum rows or the maximum charge you set, whichever comes first.

### Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.

# Actor input Schema

## `base` (type: `string`):

Three letter code of the currency the rates are quoted against, such as EUR or USD.

## `quotes` (type: `array`):

Three letter codes to return. Leave empty for every currency available.

## `latest` (type: `boolean`):

Return the most recent rates.

## `dates` (type: `array`):

Dates as YYYY-MM-DD. On a day without a published rate, such as a weekend, the provider's last earlier rate is returned with its own date.

## `from` (type: `string`):

Start date of a time series, as YYYY-MM-DD. Data goes back to 1948 for some currencies.

## `to` (type: `string`):

End date of the time series, as YYYY-MM-DD. Defaults to today.

## `group` (type: `string`):

Daily rates, or one rate per week or per month.

## `conversions` (type: `array`):

Amounts to convert, written as "100 USD to EUR", optionally followed by a date such as 2024-05-15.

## `provider` (type: `string`):

Leave empty for rates blended across all providers, or give one provider key, such as ECB for European Central Bank reference rates.

## `providerBreakdown` (type: `boolean`):

For blended rates, list each provider's rate behind every row. Makes rows much larger.

## `maxRows` (type: `integer`):

The run stops after this many rows.

## Actor input object example

```json
{
  "base": "EUR",
  "quotes": [
    "USD",
    "GBP",
    "JPY"
  ],
  "latest": true,
  "group": "day",
  "providerBreakdown": false,
  "maxRows": 10000
}
```

# Actor output Schema

## `results` (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 = {
    "quotes": [
        "USD",
        "GBP",
        "JPY"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/exchange-rates").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 = { "quotes": [
        "USD",
        "GBP",
        "JPY",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/exchange-rates").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 '{
  "quotes": [
    "USD",
    "GBP",
    "JPY"
  ]
}' |
apify call examsens.ai/exchange-rates --silent --output-dataset

```

## MCP server setup

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

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/jb9VB5oyB1Hxwz6D9/builds/WkJTDEVEmGrjimzI7/openapi.json
