All rates are published as static JSON files. No authentication required. Base currency is CHF (Swiss franc).
curl https://currency-rates.pages.dev/rates.json
curl https://currency-rates.pages.dev/YYYY-MM-DD/rates.json
curl https://currency-rates.pages.dev/meta.json
curl -s https://currency-rates.pages.dev/rates.json | fx .USD
curl -s https://currency-rates.pages.dev/rates.json | fx 'x => 100 / x.USD * x.EUR'
curl -s https://currency-rates.pages.dev/rates.json | fx
rates.json returns an object mapping currency codes to
their exchange rate relative to CHF:
{
"EUR": 1.0902,
"USD": 1.2861,
"GBP": 0.9465,
"BTC": 0.00001808,
...
}
Rates are updated every 4 hours. Each rate is the median across multiple providers.
Used by numbr.dev — a smart calculator combined with a notepad.