Historical currency data for analysis, accounting and backtesting
Historical exchange rates answer questions that live rates can’t: What was the EUR/USD rate on the invoice date? How much did our Japanese revenue really grow once the yen moved? How did the pound react to a central-bank decision? The /v1/historical endpoint of the fxapi FX rates API gives you that data over a single, consistent REST interface – the same JSON format, currency codes and authentication as the real-time exchange rates API.
Every endpoint accepts a base_currency (USD by default), so you can request historical rates relative to EUR, GBP, CHF or any of the 190+ supported currencies without converting them yourself.
Exchange rate for a specific date
GET /v1/historical returns the end-of-day rates for one date. Pass the date in YYYY-MM-DD format; it must be at least one day in the past and not earlier than 1999-01-01.
| Parameter | Required | Description |
|---|---|---|
date | yes | Day you want rates for, e.g. 2020-03-16 |
base_currency | no | Base currency, default USD |
currencies | no | Comma-separated list, e.g. EUR,GBP,CHF – default: all |
type | no | Limit to fiat, metal or crypto |
Typical uses: booking foreign-currency invoices at the rate of the transaction date, recalculating historic orders in your reporting currency, or filling a gap in your own rate table.
Need more than one date?
- Time series – every rate between two dates, from minute to monthly accuracy, as JSON or CSV: see the exchange rate time series API (Professional+).
- Fluctuation – start rate, end rate and % change between two dates in one call: see the currency fluctuation API (all plans).
Monthly and yearly averages
Need an average rather than a closing rate – for example to translate an income statement? The average exchange rates API returns monthly, quarterly or yearly averages including the lowest and highest daily rate, back to 1999.
Python example: load ten years of EUR/USD into pandas
import io, os
import pandas as pd
import requests
frames = []
for year in range(2016, 2026):
r = requests.get(
"https://api.fxapi.com/v1/range",
params={
"datetime_start": f"{year}-01-01T00:00:00Z",
"datetime_end": f"{year}-12-31T23:59:59Z",
"accuracy": "day",
"base_currency": "EUR",
"currencies": "USD",
"format": "csv",
},
headers={"apikey": os.environ["FXAPI_KEY"]},
timeout=30,
)
r.raise_for_status()
frames.append(pd.read_csv(io.StringIO(r.text)))
eurusd = pd.concat(frames)
print(eurusd.tail())
Ten requests, ten years of daily data. Because the maximum span for daily accuracy is 366 days, longer histories are fetched year by year – or in one call with accuracy=month.
Why developers choose fxapi for historical rates
- 27+ years of daily history for fiat currencies, plus precious metals and major cryptocurrencies.
- One format for everything – historical, live, converted and averaged rates share the same currency codes and
code/valueentries. - CSV output on range, fluctuation and average for analysts who don’t want to write a parser.
- Fair billing – a time series is one request, and failed or invalid calls are never counted.
- Available on every plan – the historical endpoint is included in the free exchange rate API plan.
Frequently asked questions
How far back does fxapi's historical exchange rate data go?
Which rate does the historical endpoint return for a date?
meta.last_updated_at field in the response shows the exact timestamp of the data point.Can I download historical exchange rates as CSV?
format=csv, which returns rows you can import straight into Excel, Google Sheets, a database or a data warehouse.