Browse all documentation

Currency conversion API reference

Convert one positive decimal amount with one selected rate.

REST and fx_convert_currency return the same rate, result, timestamp, freshness, and market session.

Request

REST
curl --request GET \
  --url "https://api.narwhalapi.com/v1/fx/convert?from=USD&to=JPY&amount=100.00" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
ParameterRule
fromRequired source currency.
toRequired target currency. It must differ from from.
amountPositive decimal string up to 1000000000000.

Response

200 OK
{
  "from": "USD",
  "to": "JPY",
  "rate": "159.200",
  "converted": "15920",
  "market_session": "open",
  "timestamp": "2026-11-20T05:54:38.708502Z",
  "stale": false
}

Rounding

Narwhal uses decimal arithmetic and rounds once to the target currency's ISO 4217 minor unit using half-even rounding. Non-zero results that would round to zero instead keep up to five significant figures using half-even rounding, without padding zeros.

Errors

400 invalid_pair when from and to are the same currency. Other invalid currencies or amounts return 400 invalid_query. Unsupported currencies return 404 currency_not_supported.

Read errors and credits · Read the methodology · Exchange rate API

Was this page helpful?