Currency Rates

Loading...

API

All rates are published as static JSON files. No authentication required. Base currency is CHF (Swiss franc).

Endpoints

Latest rates
curl https://currency-rates.pages.dev/rates.json
Rates for a specific date
curl https://currency-rates.pages.dev/YYYY-MM-DD/rates.json
Metadata (date, currency names)
curl https://currency-rates.pages.dev/meta.json

Examples with fx

Get USD/CHF rate
curl -s https://currency-rates.pages.dev/rates.json | fx .USD
Convert 100 USD to EUR
curl -s https://currency-rates.pages.dev/rates.json | fx 'x => 100 / x.USD * x.EUR'
Interactive exploration
curl -s https://currency-rates.pages.dev/rates.json | fx

Response format

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.