Use casesUse case

Exchange rate API for localized pricing

A 29 USD plan priced for five markets

6 Nov 2026 · 2 min read

Localized pricing means a price list in each market's currency that looks like a price someone chose. The rate gives you the raw number. Rounding rules give you the shown price. The example converts a 29 USD plan into five currencies and applies a price point per market.

Convert, then round to a price point

Request the rates for every market in one call. For each currency, round the raw price up to a step, then subtract to reach the ending you want. Euros and pounds end in .99, reais in .90, and yen and rupees round up to a hundred.

Python
import json, math, urllib.requestdef get(path):    return json.load(urllib.request.urlopen(f"https://api.exchangerate.dev/v1/{path}"))base_usd = 29rates = get("latest/USD?symbols=EUR,GBP,JPY,BRL,INR")["rates"]ENDINGS = {"EUR": 0.99, "GBP": 0.99, "JPY": 0, "BRL": 0.9, "INR": 0}    # price point per currencySTEP = {"JPY": 100, "INR": 100}                                          # round up to this step firstfor ccy, rate in rates.items():    raw = base_usd * rate    if ccy in STEP:        price = math.ceil(raw / STEP[ccy]) * STEP[ccy] - ENDINGS[ccy]    else:        price = math.ceil(raw) - 1 + ENDINGS[ccy]    print(f"{ccy}: raw {raw:,.2f} -> shown {price:,.2f}")
Output, 2 Nov 2026
EUR: raw 25.89 -> shown 25.99GBP: raw 21.63 -> shown 21.99JPY: raw 4,580.75 -> shown 4,600.00BRL: raw 157.80 -> shown 157.90INR: raw 2,750.97 -> shown 2,800.00

The shown price sits slightly above or below the raw conversion: 25.99 against 25.89 for euros, 4,600 against 4,580.75 for yen. Decide the direction once and apply it to every market.

Refresh prices only when the rates move

A price list that changes every minute confuses customers and breaks cached pages. Recompute the list on a schedule, such as weekly, and publish a new price only when the raw conversion has moved by more than a threshold you pick against the price now live. Keep the live price otherwise.

Store the price you charge

Save the shown price with the order, in the market's currency. A refund or an invoice then uses the amount the customer saw, whatever the rate does afterwards. The rate feeds the price list. The order keeps its own price.

What it costs in requests

A weekly refresh of 5 currencies is one request a week. Even a refresh every hour is 720 requests a month, a fraction of the 5,000 included in the Free plan. Commercial use is allowed on Free with a visible, linked credit.

Taxes and currencies

Prices that include VAT or sales tax depend on rules in each country. The rate conversion gives you the pre-tax number only.

Questions

Should the price follow the rate live?

Usually not. Recompute on a schedule and change a live price only when the conversion has moved past a threshold.

Which currencies are supported?

The API covers 144 currencies. `/v1/currencies` lists the codes with their names and minor units.

Do I need a key to test?

No. Calls without a key work at 100 an hour per IP address. Use a key for production.

Keep reading

Run this against the live API

The Free plan gives 5,000 requests a month and 10 a minute. Commercial use is allowed with a visible, linked credit. Calls without a key work at 100 an hour per IP address.

Get a free key