Central bank rates quickstart

Each central bank is identified by a short code, such as ecb (European Central Bank), boc (Bank of Canada), cbsl (Central Bank of Sri Lanka) or banxico (Banco de México). The full list of 141 central banks shows every code with its currencies and publication time.

Requests need an API key. You can get a free API key in a minute.

Latest official table

curl -H "Authorization: Bearer $ALLRATES_KEY" \
  https://allratestoday.com/api/v1/central-bank/ecb/latest

The response carries the publication date (rate_date), whether the table is stale, and every rate in it.

One currency pair

curl -H "Authorization: Bearer $ALLRATES_KEY" \
  "https://allratestoday.com/api/v1/central-bank/ecb/latest?source=EUR&target=USD"

A past date

For month-end revaluation or an audit, ask for the table in force on a given day:

curl -H "Authorization: Bearer $ALLRATES_KEY" \
  https://allratestoday.com/api/v1/central-bank/boc/2026-06-30

Python

import os, requests

r = requests.get(
    "https://allratestoday.com/api/v1/central-bank/ecb/latest",
    params={"source": "EUR", "target": "USD"},
    headers={"Authorization": f"Bearer {os.environ['ALLRATES_KEY']}"},
    timeout=10,
)
r.raise_for_status()
d = r.json()
print(d["rate_date"], d["rate"])

JavaScript

const res = await fetch(
  "https://allratestoday.com/api/v1/central-bank/ecb/latest?source=EUR&target=USD",
  { headers: { Authorization: `Bearer ${process.env.ALLRATES_KEY}` } }
);
const d = await res.json();
console.log(d.rate_date, d.rate);

Things to watch for

More endpoints, including history and CSV or Excel output, are in the API documentation.