Helenis API
Start for free

BusinessExchange Rates

Exchange Rate API: Official Daily and Historical Rates Since 1999 in Python

Exchange rate API guide: official ECB, Norges Bank and HMRC rates for 140+ currencies, exact conversion, history since 1999 and time series, in Python.

Exchange Rate API cover: a currency exchange sticker, an arrow and a JSON response converting USD to JPY at a rate of 159.54185, a result of 199507, zero minor units and the source ECB.
1,250.50 dollars to yen at the day's ECB rate, rounded to whole yen, with its source and date named.

An accountant converts 400 supplier invoices to euros at month end. The free exchange rate feed the team found returns a number for any pair and any date, but not where it comes from or which day it reflects. A Japanese invoice comes back as 199,157.47 yen, a currency without decimals. A Saturday invoice gets a rate nobody published on a Saturday. And when the auditor asks "which rate, from whom, on what date?", there is no answer.

An exchange rate API for this kind of work should return reference rates from named public sources, say which publication priced each pair and its date, handle weekends and holidays explicitly, and round like the currency does. This article explains where official rates come from and the traps of cross rates, then converts amounts, pulls history since 1999, builds time series and an invoice conversion script in Python on the Currency Exchange Rates & Converter API.

Where official exchange rates come from

Most "free" rates are either scraped market quotes or a resale of central bank reference rates. Reference rates are fixings: published once a day, they are what accountants, statistics offices and customs use. This API combines three public sources whose terms allow reuse:

Source Currencies Published History
European Central Bank euro reference rates EUR + 29 (USD, JPY, GBP, CHF, CNY, INR, BRL...) Around 16:00 CET on TARGET business days 4 Jan 1999, legacy currencies included
Norges Bank Adds TWD, PKR, BDT, VND, BYN, MMK and the IMF's SDR (XDR) Around 16:00 CET on Norwegian business days From 1999 to 2021 depending on the currency
HM Revenue & Customs monthly rates About 106 more (NGN, AED, SAR, ARS, KES, EGP, KWD...) Monthly, for the next calendar month January 2021

The ECB publishes no rates on weekends, 1 January, Good Friday, Easter Monday, 1 May, 25 and 26 December. HMRC sets each month's rates from the market of the day before the penultimate Thursday of the previous month, so they are about five weeks old by the end of the month they cover.

Why a cross rate must come from one publication

The ECB quotes everything against the euro, HMRC against the pound. A USD to AED rate has to be computed from two quotes, and both must come from the same publication on the same date. The UAE dirham is pegged at about 3.6725 per dollar. Mix the ECB's dollar of the day with HMRC's dirham fixed a month earlier and the euro's move in between leaks into the result: 3.7575, 2.3 % off a peg that never moved. The API prices each pair from one source that quotes both currencies (the freshest one, ECB first, then Norges Bank, then HMRC) and returns that source with the rate.

Convert currency in Python

GET /v1/currency/convert takes from, to, an amount (a string, to keep it exact) and an optional date:

Python
from decimal import Decimal

import requests

HOST = "currency-exchange-rates-converter-since-1999.p.rapidapi.com"
API = f"https://{HOST}"
HEADERS = {"x-rapidapi-key": "YOUR_API_KEY", "x-rapidapi-host": HOST}

r = requests.get(
    f"{API}/v1/currency/convert",
    headers=HEADERS,
    params={"from": "USD", "to": "JPY", "amount": "1250.50"},
    timeout=30,
)
r.raise_for_status()
conversion = r.json()
amount = Decimal(conversion["result_text"])  # exact, never a float
print(amount, conversion["to"], conversion["source"]["id"], conversion["date"])

The real response, asked on the evening of Friday 27 November 2026 (UTC):

JSON
{
  "from": "USD",
  "to": "JPY",
  "amount": "1250.50",
  "date": "2026-11-27",
  "rate": 159.54185,
  "inverse_rate": 0.0062679481,
  "result": 199507.0,
  "result_text": "199507",
  "minor_units": 0,
  "rounding": "half-up",
  "source": {
    "id": "ECB",
    "name": "European Central Bank",
    "frequency": "daily",
    "date": "2026-11-27",
    "currencies": ["USD", "JPY"],
    "stale": false,
    "credit": "Source: European Central Bank (ECB), euro foreign exchange reference rates, available free of charge at ecb.europa.eu. Cross rates computed by Helenis API."
  },
  "notes": [],
  "method": "Each pair comes from one official publication that quotes both currencies, on one date: rate = (units of the symbol per source base) / (units of the base per source base). Cross rates are computed by Helenis API from the sources' reference rates, which are published for information purposes."
}

The ECB had published that day's rates at 16:00 CET, and date says which publication was used. "Today" is the UTC date: asked on a UTC weekend or before the day's publication, the answer carries the previous business day's date and a note saying why. The yen has no minor unit in ISO 4217, so the result is rounded half-up to a whole number; a Kuwaiti dinar result gets 3 decimals. result_text is the exact decimal string: read it with Decimal, because a JSON float cannot hold every amount up to the 10^15 the API accepts.

With curl:

Terminal
curl "https://currency-exchange-rates-converter-since-1999.p.rapidapi.com/v1/currency/convert?from=USD&to=JPY&amount=1250.50" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: currency-exchange-rates-converter-since-1999.p.rapidapi.com"

Historical exchange rates for any date since 1999

GET /v1/currency/historical returns the rates of a date, and /convert accepts the same date. Ask for a Sunday and you get the last publication before it, with the reason:

JSON
{
  "base": "EUR",
  "requested_date": "2020-03-15",
  "date": "2020-03-13",
  "rates": { "USD": 1.1104, "GBP": 0.8907 },
  "sources": [
    { "id": "ECB", "name": "European Central Bank", "frequency": "daily", "date": "2020-03-13", "currencies": ["EUR", "USD", "GBP"], "stale": false }
  ],
  "notes": ["No ECB rates on 2020-03-15 (Sunday): rates of 2020-03-13, its last publication before that date."]
}

For a currency only HMRC quotes, the rate of a date is that month's rate. An invoice of 4,890.00 EUR converted to Kuwaiti dinars on 15 October 2026:

JSON
{
  "from": "EUR",
  "to": "KWD",
  "amount": "4890.00",
  "requested_date": "2026-10-15",
  "date": "2026-10-01",
  "rate": 0.35585084,
  "result": 1740.111,
  "result_text": "1740.111",
  "minor_units": 3,
  "source": {
    "id": "HMRC",
    "name": "HM Revenue & Customs",
    "frequency": "monthly",
    "date": "2026-10-01",
    "valid_until": "2026-10-31",
    "market_date": "2026-09-16",
    "currencies": ["EUR", "KWD"],
    "stale": false,
    "credit": "Contains public sector information licensed under the Open Government Licence v3.0 (HMRC monthly exchange rates). Cross rates computed by Helenis API."
  },
  "notes": ["HM Revenue & Customs rates are monthly: valid 2026-10-01 to 2026-10-31, set from the market of 2026-09-16."]
}

Both legs come from the same HMRC file, so the pair is consistent, and market_date tells you the rate reflects the market of 16 September. That is the rate UK customs and VAT use for the month; if you need the dinar's daily market rate, this source does not give it.

Legacy currencies are served until their last day and never after. 100 Cypriot pounds on 31 December 2007, the day before Cyprus adopted the euro, give 170.86 EUR, and inverse_rate is 0.585274: the irrevocable conversion rate of the Cypriot pound. Dates outside the data are refused, not guessed, and not billed:

JSON
{ "error": { "status": 400, "code": "date_out_of_range", "message": "date 1998-12-31 is before the first rates (ECB, 1999-01-04)." } }
JSON
{ "error": { "status": 400, "code": "rate_unavailable", "message": "No source quotes USD/NGN on 2019-06-03 (see Get Currencies)." } }

The naira only has HMRC rates, which start in January 2021. GET /v1/currency/currencies lists each of the 154 currencies (11 of them legacy) with its source, frequency and first date.

Latest rates from three sources in one call

GET /v1/currency/latest takes a base (USD by default) and optional symbols. A dollar base against a mix of daily and monthly currencies:

JSON
{
  "base": "USD",
  "date": "2026-11-27",
  "rates": {
    "EUR": 0.91265857,
    "GBP": 0.76210642,
    "JPY": 159.54185,
    "TWD": 32.976464,
    "NGN": 1333.1098,
    "AED": 3.6725888
  },
  "sources": [
    { "id": "ECB", "frequency": "daily", "date": "2026-11-27", "currencies": ["USD", "EUR", "GBP", "JPY"], "stale": false },
    { "id": "NORGES_BANK", "frequency": "daily", "date": "2026-11-27", "currencies": ["USD", "TWD"], "stale": false },
    { "id": "HMRC", "frequency": "monthly", "date": "2026-11-01", "valid_until": "2026-11-30", "market_date": "2026-10-21", "currencies": ["USD", "NGN", "AED"], "stale": false }
  ],
  "unavailable": {},
  "notes": ["HM Revenue & Customs rates are monthly: valid 2026-11-01 to 2026-11-30, set from the market of 2026-10-21."]
}

rates is the familiar map; sources says which publication priced each currency. The dirham comes out at 3.6725888, the peg, because both of its legs come from the same HMRC file.

Time series and fluctuation for charts and reports

GET /v1/currency/timeseries returns one point per business day between two dates (up to 366 days and 50 currencies, 1 credit per 10 currencies). USD to EUR and JPY from 16 to 27 November, trimmed after the first week:

JSON
{
  "base": "USD",
  "start_date": "2026-11-16",
  "end_date": "2026-11-27",
  "rates": {
    "2026-11-16": { "EUR": 0.90793536, "JPY": 159.59688 },
    "2026-11-17": { "EUR": 0.91000091, "JPY": 159.29566 },
    "2026-11-18": { "EUR": 0.91174325, "JPY": 159.41831 },
    "2026-11-19": { "EUR": 0.90975255, "JPY": 159.97089 },
    "2026-11-20": { "EUR": 0.90991811, "JPY": 158.64422 },
    "2026-11-23": { "EUR": 0.91416034, "JPY": 159.07304 }
  }
}

Weekends are skipped (no 21 or 22 November); a monthly HMRC currency gets one point per month. GET /v1/currency/fluctuation gives the change between two dates, with both ends of a pair from the same source. From 2 January to 27 November 2026, against the dollar: EUR from 0.85316952 to 0.91265857 (+6.9727 %), JPY from 156.932 to 159.54185 (+1.663 %), TRY from 43.028069 to 50.787077 (+18.0324 %), all priced by the ECB.

A monthly average rate, the figure many expense policies and reports use, takes one series call:

Python
from statistics import mean

r = requests.get(
    f"{API}/v1/currency/timeseries",
    headers=HEADERS,
    params={
        "base": "EUR",
        "symbols": "USD,GBP,CHF",
        "start_date": "2026-10-01",
        "end_date": "2026-10-31",
    },
    timeout=60,
)
r.raise_for_status()
days = r.json()["rates"]
for symbol in ("USD", "GBP", "CHF"):
    values = [day[symbol] for day in days.values() if symbol in day]
    print(symbol, round(mean(values), 6), f"over {len(values)} business days")

Convert a batch of invoices at their own dates

The month-end job from the introduction: each invoice converted to euros at the rate of its date, with the source and the rate's real date kept for the auditor. Failed calls are not billed; a 503 (source_unavailable, all sources unreachable and nothing held for that date) is retried.

Python
import csv
import time


def convert(amount: str, currency: str, day: str, attempts: int = 3) -> dict:
    params = {"from": currency, "to": "EUR", "amount": amount, "date": day}
    for attempt in range(attempts):
        r = requests.get(
            f"{API}/v1/currency/convert", headers=HEADERS, params=params, timeout=30
        )
        if r.status_code != 503:
            break
        time.sleep(30 * (attempt + 1))
    return r.json()


with (
    open("invoices.csv", newline="", encoding="utf-8") as src,
    open("invoices_eur.csv", "w", newline="", encoding="utf-8") as out,
):
    writer = csv.writer(out)
    writer.writerow(
        ["invoice", "amount", "currency", "eur", "rate", "rate_date", "source", "note"]
    )
    for row in csv.DictReader(src):
        data = convert(row["amount"], row["currency"], row["date"])
        if "error" in data:
            blank = ["", "", "", ""]
            code = data["error"]["code"]
            writer.writerow(
                [row["invoice"], row["amount"], row["currency"], *blank, code]
            )
            continue
        source = data["source"]
        note = " ".join(data["notes"]) + (" STALE" if source["stale"] else "")
        writer.writerow(
            [
                row["invoice"],
                row["amount"],
                row["currency"],
                data["result_text"],
                data["rate"],
                data["date"],
                source["id"],
                note,
            ]
        )

Keep amount as the string from your CSV: the API parses it as a decimal (up to 12 decimals), so no float rounding creeps in. If a source is down, its last rates are served with their real date and "stale": true, never passed off as today's; the script flags those rows.

For prices shown on a website, call /latest once per base after 16:00 CET and cache it until the next publication: the rates do not change in between, so one call a day per base covers every page view. For landed costs across borders, pair the converted value with the duty rate from the HS code lookup API; for invoice amounts read from PDFs, see the invoice OCR API.

Cost

Every endpoint uses 1 credit per call, except a time series, which uses 1 credit per 10 currencies. The free BASIC plan gives 10 calls a day. PRO is $3.99 a month for 100,000 calls, $0.00004 a call; ULTRA gives 400,000 for $9.99 and MEGA 1,400,000 for $29.99. Failed calls are not billed. For comparison, the most subscribed currency API on RapidAPI charges $0.001 a call for latest rates and conversion only, and another with history $0.0012. Plans are on the currency exchange rates API page, parameters in the API reference.

The calls in this article took 1.5 to 6 seconds over the network across two runs; the first historical call of an instance loads the ECB's full history file (about 3 seconds), and later ones answer from memory.

What the exchange rate API does not do

  • No real-time or trading rates. These are daily reference fixings (around 16:00 CET), not bid/ask quotes. The ECB publishes its rates for information purposes and advises against using them for transactions; use a broker feed to trade.
  • About 106 currencies are monthly. They come from HMRC, are set about five weeks before the end of the month they cover, and start in January 2021.
  • HMRC precision carries over. Its rates have 4 decimals, so a cross rate inherits them: EUR to XOF comes out at 655.93152 where the peg is 655.957 (0.004 % off).
  • Before 16:00 CET, today is yesterday. The latest rates on a business day morning are the previous publication, and date says so.
  • No crypto and no metals. Only official fiat rates (plus the IMF's SDR), from sources whose terms allow reuse.

Frequently asked questions

Is there a free exchange rate API?

The ECB publishes its euro reference rates (29 currencies) free of charge as XML at ecb.europa.eu, and you can read them directly. This API adds Norges Bank and HMRC (about 140 currencies in all), cross rates from one publication, history since 1999, ISO rounding and the source on every rate. Its BASIC plan is free for 10 calls a day; paid plans start at $3.99 for 100,000 calls.

Where do the exchange rates come from?

From the European Central Bank's euro foreign exchange reference rates, Norges Bank's daily rates and HM Revenue & Customs' monthly rates (Open Government Licence v3.0). Each response names the publication used for each currency and its date.

Can I use these rates for invoices and accounting?

Reference rates are the usual basis for converting invoices and reports, and many tax and customs rules name a central bank or official rate. Check which rate your jurisdiction requires (UK customs and VAT use the HMRC monthly rates), and store the source and date returned with each conversion.

What rate do I get on a weekend or a holiday?

The last publication before the date you ask for, with its real date in date and a note giving the reason (Saturday, Sunday, or the TARGET holiday's name).

How far back do historical exchange rates go?

To 4 January 1999 for the ECB's currencies, including legacy ones such as the Cypriot pound, the Estonian kroon and the Croatian kuna until their last day. Norges Bank's extra currencies start between 1999 and 2021, and HMRC's monthly currencies in January 2021.

Get started

Currency Exchange Rates & Converter API

Official exchange rates of 140+ currencies: latest, convert, time series, history since 1999.

  • Exchange Rates
  • Currency Conversion
  • Finance
  • Python
  • Accounting