# ECB, PTAX & TRM Official Exchange Rates API (`viperthruster/official-fx-rates`) Actor

Official exchange rates from central banks: ECB exchange rates (euro reference rates), Banco Central do Brasil PTAX and Colombia's TRM. One row per source, currency pair and date.

- **URL**: https://apify.com/viperthruster/official-fx-rates.md
- **Developed by:** [David Rincon](https://apify.com/viperthruster) (community)
- **Categories:** Business, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 exchange 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

## ECB, PTAX & TRM Official Exchange Rates API

Get official exchange rates straight from the institutions that publish them: ECB exchange rates (the European Central Bank's euro reference rates), Banco Central do Brasil's PTAX and Colombia's TRM, in one call and one format.

- **Official sources only:** every row names its publisher and the API URL it came from. No scraped or averaged market quotes.
- **One format for all sources:** each row reads `1 baseCurrency = rate quoteCurrency`, with ISO 4217 codes and ISO 8601 dates.
- **History and monitoring:** ask for up to 30 recent dates per currency, or turn on monitor mode to get only new rates on a schedule.

### Output example

```json
{
  "source": "BCB_PTAX",
  "publisher": "Banco Central do Brasil",
  "baseCurrency": "USD",
  "quoteCurrency": "BRL",
  "rate": 5.1991,
  "bid": 5.1985,
  "ask": 5.1991,
  "date": "2026-09-25",
  "validTo": null,
  "license": "Open data of the Banco Central do Brasil: free reuse citing the BCB as the source.",
  "sourceUrl": "https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/..."
}
```

### Sources

| Source | Publisher | Rows | Currencies |
|---|---|---|---|
| `ECB` | European Central Bank | 1 EUR = rate X | About 30 currencies (USD, GBP, JPY, BRL, MXN, ...) |
| `BCB_PTAX` | Banco Central do Brasil | 1 X = rate BRL (closing PTAX; `rate` is the selling rate, with `bid` and `ask`) | AUD, CAD, CHF, DKK, EUR, GBP, JPY, NOK, SEK, USD |
| `CO_TRM` | Superintendencia Financiera de Colombia (via datos.gov.co) | 1 USD = rate COP, with `validTo` for weekends and holidays | USD |

A source skips currencies it does not publish; the log says which.

### Cost

You pay per rate returned: US$0.002 each, so **1,000 rates = US$2.00**, plus US$0.00005 per run start. Monitor runs with no new rates cost only the run start.

The European Central Bank's reference rates are also available free of charge on the [ECB website](https://www.ecb.europa.eu/stats/exchange/eurofxref/). What you pay for is the service: several official sources in one call and one format, history, and monitoring.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `currencies` | array of strings | required | ISO 4217 codes, for example `USD`, `EUR`, `GBP`. |
| `sources` | array | all three | `ECB`, `BCB_PTAX`, `CO_TRM`. |
| `days` | integer | 1 | Most recent published dates per source and currency (1 to 30). |
| `maxItems` | integer | 50 | Stop after this many rows in total. |
| `monitorMode` | boolean | false | Return only rows that are new or changed since the previous run. |
| `proxyConfiguration` | object | empty | Not needed for these sources. |

### FAQ

**Why is there no rate for today?** Each institution publishes on its own schedule: the ECB around 16:00 CET on business days, the BCB closing PTAX in the early afternoon (Brasília time), and the TRM the business day before it applies.

**Can I get COP or BRL against the euro?** The ECB publishes EUR/BRL. It does not publish COP; for COP use `CO_TRM` (USD/COP).

**Can AI agents use it?** Yes. Input is a plain list of currency codes and runs take a few seconds.

### Legal

All data comes from official public APIs that need no login or key. The TRM dataset on datos.gov.co is published by the Superintendencia Financiera de Colombia under CC BY-SA 4.0; rows from it carry that license and must be attributed. Every row names its publisher and source URL, so the ECB and Banco Central do Brasil are cited as the sources of their data. ECB rates are reused under the [ECB's terms](https://www.ecb.europa.eu/services/disclaimer/html/index.en.html): each ECB row cites the ECB and states that the rate is free on the ECB website, and rates are returned exactly as published. Banco Central do Brasil publishes PTAX as open data under Brazil's open data policy, which allows free reuse citing the BCB; each BCB row says so. The rates are for information only; neither the publishers nor this Actor accept liability for decisions made with them.

### En español

Tasas de cambio oficiales del BCE, del Banco Central do Brasil (PTAX) y de Colombia (TRM de la Superintendencia Financiera), en un solo formato y con la fuente de cada fila.

### Changelog

- 0.2: ECB and BCB rows state their reuse terms in `license`; results are saved in batches.
- 0.1: first version.

# Actor input Schema

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

ISO 4217 codes, for example USD, EUR or JPY; up to 50. The ECB quotes them against EUR, Brazil's PTAX against BRL and Colombia's TRM against COP (TRM is USD only). A source that does not publish a currency skips it.

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

ECB: European Central Bank euro reference rates. BCB\_PTAX: Banco Central do Brasil closing PTAX. CO\_TRM: Colombia's official USD/COP rate. All three by default.

## `days` (type: `integer`):

How many of the most recent published dates to return for each source and currency, from 1 to 30. 1 returns only the latest rate.

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

Stop after this many rows in total, up to 1000. Keeps runs short and costs predictable.

## `monitorMode` (type: `boolean`):

Return only rows that are new or changed since the previous run with this option on. Useful for scheduled runs.

## `proxyConfiguration` (type: `object`):

Not needed for these sources. Leave empty to connect directly.

## Actor input object example

```json
{
  "currencies": [
    "USD",
    "EUR",
    "GBP"
  ],
  "sources": [
    "ECB",
    "BCB_PTAX",
    "CO_TRM"
  ],
  "days": 1,
  "maxItems": 50,
  "monitorMode": false
}
```

# 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 = {
    "currencies": [
        "USD",
        "EUR",
        "GBP"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("viperthruster/official-fx-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 = { "currencies": [
        "USD",
        "EUR",
        "GBP",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("viperthruster/official-fx-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 '{
  "currencies": [
    "USD",
    "EUR",
    "GBP"
  ]
}' |
apify call viperthruster/official-fx-rates --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,viperthruster/official-fx-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/jYkTMop1xFnz7eEWJ/builds/dWd6WZjvCcx6TYwkI/openapi.json
