A travel site sells in the supplier's currency and shows the traveler a total in theirs. One request returns the rates for every currency you display. Cache the answer for a few minutes, stamp the booking with the rate you showed, and the difference between quote and charge stays small and explainable.
Show the price in the traveler's currency
A three-night stay at 160 EUR a night comes to 480 EUR. One request to /v1/latest/EUR returns the rates for the three display currencies. The script below multiplies and rounds to each currency's decimal places; yen has none.
import json, urllib.requestdef get(path): return json.load(urllib.request.urlopen(f"https://api.exchangerate.dev/v1/{path}"))nights, nightly_eur = 3, 160data = get("latest/EUR?symbols=USD,GBP,JPY")total = nights * nightly_eurprint("rates as of", data["data_updated_at"], "stale:", data["stale"])for ccy, rate in data["rates"].items(): places = 0 if ccy == "JPY" else 2 print(f"{total} EUR = {round(total * rate, places):,.{places}f} {ccy} (rate {rate})")rates as of 2026-11-02T11:14:59Z stale: {'USD': False, 'GBP': False, 'JPY': False}480 EUR = 537.73 USD (rate 1.12027)480 EUR = 400.99 GBP (rate 0.83539)480 EUR = 84,938 JPY (rate 176.955)Check the stale flags before you show a total, and fall back to the supplier's currency when one is true. 30 days of daily history are included on the Free plan, which is enough for the booking-date lookups below.
Cache the answer for the search page
A search results page can show hundreds of prices and needs one rate per currency. Fetch the rates once and reuse them. At one refresh every 15 minutes for the three currencies above, a month costs about 2,880 requests, inside the 5,000 the Free plan includes. Rates without a key arrive about 15 minutes after the market. Paid plans return rates about a minute old on trading days.
Hold the rate through checkout
A traveler who sees 537.73 USD expects to be charged 537.73 USD. Keep the rate you displayed in the session, and charge the supplier's amount converted at that rate. Save three things on the booking: the rate, its data_updated_at and the currency pair. A support agent can then rebuild any total.
Look up the rate on the booking date
A booking made on 12 October and paid at check-in has two rates. The date endpoint returns the daily reference rate for any day in your plan's history window.
curl "https://api.exchangerate.dev/v1/2026-10-12?base=EUR&symbols=USD"{"result":"success","base":"EUR","date":"2026-10-12","is_forward_filled":false,"rates":{"USD":1.1181}}| When | EUR to USD | 480 EUR in USD |
|---|---|---|
| Booked, 12 Oct | 1.1181 | 536.69 |
| Latest, 2 Nov | 1.12027 | 537.73 |
The traveler pays the amount shown at booking. If you hedge or settle with the supplier later, the second row is your cost, and the difference is yours to track.
The API returns indicative rates. Your card processor or bank applies its own rate at the moment of payment, so the final charge can differ.