Compare Central Bank Rates
On this page, we’ll dive into the official rates compare endpoint you can use to see one currency pair, for example EUR to USD, as every central bank published it, side by side.
Central banks fix their rates at different times of day and from different data, so the ECB, the Federal Reserve and the Bank of England rarely agree on EUR to USD to the last digit. This endpoint puts their figures next to each other and tells you how far apart they are, for example to pick the source your rules prescribe or to check a rate you were given. The values come from the same publications as /v3/official.
Compare Central Bank Rates
This endpoint returns how many currency one base_currency buys at every central bank that publishes both currencies, from each bank’s newest publication on or before date, or its newest publication when no date is given. Banks are listed in the order of /v3/official/sources.
Required attributes
- Name
base_currency- Type
- string
- Description
The currency to convert from, e.g.
EUR
- Name
currency- Type
- string
- Description
The currency to convert to, e.g.
USDMust differ frombase_currency
Optional attributes
- Name
date- Type
- string
- Description
Date to compare the rates for (format: 2026-09-26) Each bank’s newest publication on or before it, from up to 14 days before. By default each bank’s newest publication
- Name
sources- Type
- string
- Description
A list of comma-separated central banks to compare (ecb,fed), see Sources By default every bank
- Name
format- Type
- string
- Description
json(default),csvorxlsx(the same table as an Excel download,official-compare.xlsx)
Response Structure
The meta key echoes the base_currency, the currency and the requested_date (null without one), and gives the number of sources that published both currencies, the high and low value and spread_pct, how far the highest is above the lowest in percent.
The data key holds one entry per bank: its source code, source_name and country, the date of the publication the value comes from, the value, whether it is computed from cross_rates and the bank’s reference for the publication.
A request costs one request of your quota, however many banks it compares.
Request
curl -G https://api.currencyapi.com/v3/official/compare \
-d base_currency=EUR \
-d currency=USD \
-d date=2026-09-26 \
-H "apikey: YOUR-API-KEY"
Response (shortened to three banks)
{
"meta": {
"base_currency": "EUR",
"currency": "USD",
"requested_date": "2026-09-26",
"sources": 3,
"high": 1.140645161,
"low": 1.139999977,
"spread_pct": 0.0566
},
"data": [
{
"source": "ecb",
"source_name": "European Central Bank",
"country": "EU",
"date": "2026-09-25",
"value": 1.1403,
"cross_rates": false,
"reference": null
},
{
"source": "boe",
"source_name": "Bank of England",
"country": "GB",
"date": "2026-09-25",
"value": 1.140645161,
"cross_rates": true,
"reference": null
},
{
"source": "fed",
"source_name": "Federal Reserve",
"country": "US",
"date": "2026-09-25",
"value": 1.139999977,
"cross_rates": false,
"reference": null
}
]
}
Direct and cross rates
- Direct. A bank that publishes against one of the two currencies gives the rate directly: the ECB publishes USD per 1 EUR, and the Federal Reserve publishes its EUR rate against USD.
cross_ratesisfalse. - Crossed. A bank that publishes both currencies against its own gives a cross rate computed from those two official rates: the Bank of England publishes USD and EUR against GBP, so its EUR to USD is its USD rate divided by its EUR rate.
cross_ratesistrue. - Left out. Banks that do not publish both currencies are not listed. When no bank (of
sources) does, the response is a404witherror.codeno_rates_published.
Weekends and holidays
With a date, every bank answers with its own newest publication on or before it, so the date of the entries can differ: on a Saturday you get each bank’s Friday rate, and the Federal Reserve releases its H.10 rates weekly, so its newest entry can be several days older than the others. Check each entry’s date before you compare the values.
Choosing the banks
sources=ecb,fed compares only those banks; the order of the list does not matter. An unknown code returns a 422. /v3/official/sources?currency=USD lists every bank that publishes a currency.
CSV and Excel
With format=csv you get one row per bank, format=xlsx gives the same table as an Excel workbook named official-compare.xlsx:
CSV
curl -G https://api.currencyapi.com/v3/official/compare \
-d base_currency=EUR \
-d currency=USD \
-d date=2026-09-26 \
-d sources=ecb,boe,fed \
-d format=csv \
-H "apikey: YOUR-API-KEY"
Response (text/csv)
source,source_name,country,date,base_currency,currency,value,cross_rates,reference
ecb,European Central Bank,EU,2026-09-25,EUR,USD,1.1403,false,
boe,Bank of England,GB,2026-09-25,EUR,USD,1.140645161,true,
fed,Federal Reserve,US,2026-09-25,EUR,USD,1.139999977,false,
Errors
| Status | error.code | When |
|---|---|---|
404 | no_rates_published | No bank (of sources) published both currencies for the requested date or in the 14 days before it |
422 | invalid_parameters | A parameter is invalid, e.g. currency equals base_currency or sources has an unknown code; errors lists the messages per parameter |
404 response
{
"message": "No central bank published both EUR and XAU on or shortly before 2026-09-26.",
"error": {
"code": "no_rates_published",
"message": "No central bank published both EUR and XAU on or shortly before 2026-09-26."
},
"actions": {
"sources": "https://api.currencyapi.com/v3/official/sources",
"docs": "https://currencyapi.com/docs/openapi.yaml"
},
"info": "For more information, see documentation: https://currencyapi.com/docs/official"
}
See Request Status Codes for the errors every endpoint shares.