FX Rates
Get foreign exchange rates between fiat currencies.
GET
/v1/fx/rateParameters
| Parameter | Type | Description |
|---|---|---|
| from* | string | Source currency code (e.g., EUR) |
| to* | string | Target currency code (e.g., USD) |
| dateoptional | YYYY-MM-DD | Historical date. Omit for latest. |
Request
bash
curl "https://api.cryptachain.com/v1/fx/rate?from=EUR&to=USD&date=2026-04-04" \
-H "X-API-Key: $CRYPTACHAIN_API_KEY"Response
Response 200 OK
json
{
"from": "EUR",
"to": "USD",
"rate": 1.0870,
"date": "2026-04-04",
"source": "ecb"
}Rate convention
Rates follow the "1 foreign = X USD" convention for USD-based pairs, and "1 base = X quote" for cross pairs. This is the standard accounting convention.
Historical FX rates
GET
/v1/fx/historybash
curl "https://api.cryptachain.com/v1/fx/history?from=EUR&to=USD&startDate=2026-01-01&endDate=2026-03-31" \
-H "X-API-Key: $CRYPTACHAIN_API_KEY"Weekend and holiday handling
ECB does not publish rates on weekends and public holidays. CryptaChain fills gaps by carrying forward the last known rate:
- Saturday/Sunday: Friday's rate is used
- Public holidays: Previous business day's rate
- BGN: Always 1.95583 per EUR (currency board peg since 1999)
- AED, SAR, QAR, OMR, BHD: Fixed USD pegs, constant rates