Free exchange-rate API
Static JSON endpoints, published with Access-Control-Allow-Origin: *. No key, no sign-up — cache them at the edge and refresh at your own cadence.
| Endpoint | What it returns | Shape |
|---|---|---|
/api/latest.json | Latest FX rates166 currencies against USD, plus the snapshot timestamp. | {"base":"USD","updated":"…","rates":{"EUR":0.9241,"CNY":6.6735}} |
/api/currencies.json | Currency metadataCode, name, symbol, country and decimal places for every currency. | [{"code":"USD","name":"US Dollar","symbol":"$"}] |
/api/pairs.json | Major pairs380 major pairs with the current cross rate. | [{"from":"USD","to":"CNY","rate":6.6735}] |
/api/crypto.json | Crypto snapshot30 assets: price, 24h change, high/low, volume, market cap. | [{"symbol":"BTC","price":51639.77,"change24h":-9.34}] |
/api/metals.json | Metals spotGold and silver in USD per troy ounce. | {"gold":{"usd":3646.84},"silver":{"usd":45.4}} |
Usage
fetch('https://YOUR-DOMAIN/api/latest.json')
.then(r => r.json())
.then(d => console.log(d.rates.CNY));
The data is a snapshot written when the site was built, so treat the updated field as the freshness marker. For live per-second quotes call the upstream provider directly; these endpoints are meant for dashboards, prototypes and low-frequency jobs.
Cross-rate maths
All FX rates are quoted against USD, so a cross rate is rate(TO) / rate(FROM). That keeps the payload small and lets any pair be derived client-side.