Menu

Official exchange rates API reference

We republish authorities' exchange rate tables with their validity and source documents. Choose a country, table type and date to find the applicable rate. We are not an official source or affiliated with any authority.

Addressing tables

Use https://api.exchangerate.dev as the base URL. Authenticate with the Authorization header using Bearer YOUR_API_KEY.

Address a table by its uppercase ISO 3166 alpha-3 country code and a type word. Use EUU for the European Union. The type words are tax, customs, central-bank, government-reporting and tax-average.

A table can serve more than one type. Indonesia's Kurs Pajak is available through both IDN/tax and IDN/customs.

  • GET /v1/official lists all tables with their country, types, authority, cadence, history start and latest validity.
  • GET /v1/official/{country} lists that country's tables.
  • GET /v1/official/{country}/{type} returns a table's name, authority, legal basis and cadence.
  • See /official for the full list of live countries and authorities.

Rate on a date

GET /v1/official/{country}/{type}/rate/{base}/{quote}?date=YYYY-MM-DD returns the rate valid on the requested date.

The default body contains date, base, quote, rate, valid_to and method. The date field is the publication's valid_from, so it can differ from your requested date. The rate is a number. A null valid_to means the publication remains valid until the next publication.

Add expand=source to include the published value and units, publication number, publication date, document URL and retrieval time. The published value preserves the exact printed string.

Use direction where an authority prints two sides, such as import/export or buy/sell.

  • published: the rate is as printed by the authority.
  • inverted: the authority prints the other direction.
  • rule: the value is derived using the authority's own rule, such as Indonesia's cross for an unlisted currency.
  • The source object contains published.value, published.units, publication, published_on, document_url and retrieved_at.
Rate on a date
curl "https://api.exchangerate.dev/v1/official/IDN/tax/rate/USD/IDR?date=2026-10-07&expand=source" \  -H "Authorization: Bearer YOUR_API_KEY"
Response
{  "date": "2026-10-07",  "base": "USD",  "quote": "IDR",  "rate": 17935,  "valid_to": "2026-10-13",  "method": "published",  "source": {    "published": {      "value": "17935.00",      "units": 1    },    "publication": "48/MK/EF.2/2026",    "published_on": "2026-10-06",    "document_url": "https://fiskal.kemenkeu.go.id/files/kurs/file/1791328883_nilai_kurs_7-13_oct_2026.pdf",    "retrieved_at": "…"  }}

Full tables and downloads

GET /v1/official/{country}/{type}/rates returns full tables. Use date for one date or from and to for a range. Use quotes to select currencies, such as USD,EUR.

Use /rates.csv for CSV output or /rates.xlsx for Excel output. CSV requires Basic or above. Excel export requires Pro. Past dates and ranges require Basic or above.

Full table as CSV
curl "https://api.exchangerate.dev/v1/official/IDN/tax/rates.csv?date=2026-10-07" \  -H "Authorization: Bearer YOUR_API_KEY"

Publications and corrections

GET /v1/official/{country}/{type}/publications lists publications. GET /v1/official/{country}/{type}/publications/{publication_id} returns one publication with all its rows.

A correction creates a new version. The superseded version is kept.

Conversions and invoice batches

GET /v1/official/{country}/{type}/convert/{base}/{quote}/{amount}?date= converts one amount using the rate valid on that date.

POST /v1/official/{country}/{type}/convert accepts a lines array with up to 100 invoice lines. Each line supplies base, quote, amount, date and direction, so lines can use different dates.

If a line fails, it returns result set to error, with code and message. The other lines still convert. Single and batch conversions require Plus or above.

Invoice lines
curl -X POST "https://api.exchangerate.dev/v1/official/IDN/tax/convert" \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{"lines":[{"base":"USD","quote":"IDR","amount":1200,"date":"2026-10-07"},{"base":"EUR","quote":"IDR","amount":800,"date":"2026-10-07"}]}'

Accounting packs and gain-loss

GET /v1/official/{country}/{type}/period/{YYYY-MM}?quotes= returns an accounting pack for a calendar month with a closing rate and an average.

POST /v1/official/{country}/{type}/gain-loss calculates a realised gain or loss in the home currency. Supply currency, amount, booked_on, settled_on and kind. The kind is receivable or payable.

Both dates are valued using the selected table's official rate. Period packs and gain-loss require Pro.

Month-end pack
curl "https://api.exchangerate.dev/v1/official/GBR/tax/period/2026-09?quotes=USD,EUR" \  -H "Authorization: Bearer YOUR_API_KEY"
Realised gain or loss
curl -X POST "https://api.exchangerate.dev/v1/official/IDN/tax/gain-loss" \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{"currency":"USD","amount":5000,"booked_on":"2026-09-02","settled_on":"2026-10-07","kind":"receivable"}'

Change feed and webhooks

GET /v1/official/changes accepts since, country and limit parameters. It returns new and corrected publications, oldest first.

Webhooks deliver the same events to your endpoints: official.published and official.corrected. Set up webhook endpoints in your account.

The change feed and webhooks require Plus or above. Plus supports 5 webhook endpoints. Pro supports 25.

Change feed
curl "https://api.exchangerate.dev/v1/official/changes?since=2026-10-01T00:00:00Z&country=IDN" \  -H "Authorization: Bearer YOUR_API_KEY"

Evidence

On Pro, each answer carries an X-Lookup-Id response header.

GET /v1/official/evidence/{lookup_id} returns what was answered, when it was answered and which publication it came from.

Errors

Errors return JSON with a code. Plan refusals name the feature and its minimum plan.

  • pair_not_official: HTTP 400. The table does not publish that pair.
  • no_rate_for_date: HTTP 404.
  • currency_not_published: HTTP 404.
  • rule_input_missing: HTTP 404.
  • not_found: HTTP 404.
  • bad_request: HTTP 400.

Plans

Choose a plan based on the dates, outputs and calculations you need.

  • Free: the rate valid today.
  • Basic ($19): adds history for any past date and ranges, expand=source and CSV downloads.
  • Plus ($39): adds single and batch conversions, the change feed and webhooks with up to 5 endpoints.
  • Pro ($89): adds period packs, Excel export, gain-loss, evidence and up to 25 webhook endpoints.

Questions

Is exchangerate.dev an official source?

No. We republish each authority's table with its validity and source document. We are not affiliated with any authority.

Why can the response date differ from my requested date?

The date field is the publication's valid_from. Your requested date selects the publication whose valid period covers that date.

Does the IRS require its published yearly average?

No. The IRS has no official exchange rate. Its published yearly average is not a required rate.