Exchange Rate API with JSON and CSV Output (plus Excel)

Get exchange rates as JSON or CSV from one endpoint: add format=csv to any AllRatesToday table endpoint. Real responses, plus Python and Node examples.

By Madhushan, Founder & Lead Developer ·

Short answer: AllRatesToday returns JSON by default. Add format=csv to any table endpoint to get CSV from the same URL, with the same parameters, key and quota. format=xlsx returns an Excel workbook and format=xml returns XML. Every format works with every key, including the free one.

All responses on this page were captured from the live API on 6 November 2026.

Which endpoints support JSON and CSV

EndpointReturnsCSV columns
/api/v1/ratesLive mid-market rates, a dated rate or a daily rangesource, target, rate, time
/api/v1/central-bank/{bank}/latestA central bank's latest official table, or one pairrate_date, base, quote, rate_type, value for a table; rate_date, source, target, rate, rate_type, derived, method for a pair
/api/v1/symbolsSupported currencies (no key needed)code, name, symbol

Formats also work on /api/historical-rates, /api/v1/central-banks, and the central-bank history and availability endpoints. See Response Formats in the docs.

Live rates as JSON

curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP" \
  -H "Authorization: Bearer YOUR_API_KEY"
[
  {"rate":0.897384,"source":"USD","target":"EUR","time":"2026-11-06T14:45:01+00:00"},
  {"rate":0.748419,"source":"USD","target":"GBP","time":"2026-11-06T14:45:01+00:00"}
]

The same rates as CSV

curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP&format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY" -o rates.csv
source,target,rate,time
USD,EUR,0.897384,2026-11-06T14:45:01+00:00
USD,GBP,0.748419,2026-11-06T14:45:01+00:00

The response is sent as text/csv; charset=utf-8 with a download filename. It starts with a UTF-8 byte-order mark so that Excel shows currency symbols correctly. Most CSV parsers need to be told to skip it. In Python, decode with utf-8-sig.

Official central bank rates as CSV

You can try this one with no key. It returns the latest table the European Central Bank published, under the bank's own date:

curl "https://allratestoday.com/api/open/central-bank/ecb?format=csv"
rate_date,base,quote,rate_type,value
2026-11-05,EUR,AUD,reference,1.6033
2026-11-05,EUR,BRL,reference,6.1355
2026-11-05,EUR,CAD,reference,1.5675
2026-11-05,EUR,CHF,reference,0.918
...

Use any code from the list of institutions. Keyless tables are for non-commercial use, and public pages that show them need a visible link. Commercial products need a paid plan.

Ask for one pair with a key. If the bank did not print that pair directly, the row says so:

curl "https://allratestoday.com/api/v1/central-bank/ecb/latest?source=USD&target=EUR&format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY"
rate_date,source,target,rate,rate_type,derived,method
2026-11-05,USD,EUR,0.8909479686,reference,true,inverse

Here the ECB publishes EUR/USD, so USD/EUR is marked derived with the method inverse.

Excel workbooks

curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP&format=xlsx" \
  -H "Authorization: Bearer YOUR_API_KEY" -o rates.xlsx

This is a real .xlsx workbook, not a renamed CSV, so Excel opens it without a format warning. The Excel guide shows how to refresh rates in a workbook, and the bulk download page covers date-range files.

Parsing examples

Python (CSV)

import csv, io, os, requests

response = requests.get(
    "https://allratestoday.com/api/v1/rates",
    params={"source": "USD", "target": "EUR,GBP", "format": "csv"},
    headers={"Authorization": f"Bearer {os.environ['ALLRATES_KEY']}"},
    timeout=10,
)
response.raise_for_status()

# utf-8-sig removes the byte-order mark from the first column name
text = response.content.decode("utf-8-sig")
for row in csv.DictReader(io.StringIO(text)):
    print(row["source"], row["target"], float(row["rate"]))

Node.js (JSON)

const response = await fetch(
  'https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP',
  { headers: { Authorization: 'Bearer ' + process.env.ALLRATES_KEY } }
);
if (!response.ok) throw new Error('Request failed: ' + response.status);

const rows = await response.json();
for (const row of rows) console.log(row.source, row.target, row.rate);

Which format should you use?

FormatUse it for
JSONApps and back-end services. It is also what the SDKs use.
CSVImports into databases, BI tools and accounting systems
XLSXFinance teams and audit workpapers
XMLERP and older systems that cannot read JSON

FAQ

Is CSV available on the free plan?

Yes. Output format isn't plan-gated. Historical data needs a paid plan in any format.

Does a CSV request cost more than JSON?

No. It counts once against your quota. A date range is billed the same way in every format.

What happens with an unsupported format?

You get a 400 that lists the valid values, and it is not charged.

Can I get a conversion as CSV?

No. A request with amount= always returns JSON, because a conversion is a single result rather than a table.

Get rates as JSON or CSV

Free API key in 30 seconds. No credit card.

Get free API key Read the docs

Related