All APIs

Exchange rate API

Get current exchange rates through REST or MCP. Convert amounts or retrieve stored historical rates with the same API key.

Online99.92% uptime, last 30 days733 ms typical response

First request

Get current rates

curl --request GET \
  --url "https://api.narwhalapi.com/v1/fx/rates/USD?currencies=EUR,JPY" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
Example response
{
  "base": "USD",
  "market_session": "open",
  "rates": [
    {
      "currency": "EUR",
      "rate": "0.9200",
      "timestamp": "2026-08-22T06:29:41Z",
      "stale": false
    },
    {
      "currency": "JPY",
      "rate": "147.23",
      "timestamp": "2026-08-22T06:29:39Z",
      "stale": false
    }
  ]
}

Convert an amount

curl --request GET \
  --url "https://api.narwhalapi.com/v1/fx/convert?from=USD&to=JPY&amount=100.00" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
Example response
{
  "from": "USD",
  "to": "JPY",
  "rate": "147.23",
  "converted": "14723",
  "market_session": "open",
  "timestamp": "2026-08-22T06:29:39Z",
  "stale": false
}

Get historical rates

curl --request GET \
  --url "https://api.narwhalapi.com/v1/fx/rates/USD/observations?currencies=EUR,NZD&start_date=2026-08-20&end_date=2026-08-28&limit=100" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
Example response
{
  "base": "USD",
  "observations": [
    {
      "date": "2026-08-20",
      "rates": [
        {
          "currency": "EUR",
          "rate": "0.85609"
        },
        {
          "currency": "NZD",
          "rate": "1.681"
        }
      ]
    }
  ],
  "next_cursor": null
}

Endpoints

GETGet current rates/v1/fx/rates/{base}

Current rates for one base currency. Use it to show a price or a rate table.

Parameters

  • baserequired

    The base currency, as an uppercase ISO 4217 code.

  • currenciesoptional

    A comma-separated list of 1 to 64 different quote currencies. Leave it out to get every supported quote.

Response fields

  • basestring

    The base currency.

  • market_sessionstring

    Whether the market is open, on a weekend or closed between trading sessions.

  • ratesarray

    One record for each quote currency.

  • rates[].currencystring

    The quote currency.

  • rates[].ratestring

    What one unit of the base is worth in the quote currency, as a decimal string.

  • rates[].timestampdate-time

    The time of this rate.

  • rates[].staleboolean

    Whether this rate is stale.


Full reference →
GETConvert an amount/v1/fx/convert

Convert a positive amount using one selected rate. The result is rounded once, to the target currency’s minor unit.

Parameters

  • fromrequired

    The source currency.

  • torequired

    The target currency. It must differ from from.

  • amountrequired

    A positive decimal string, up to 1000000000000.

Response fields

  • fromstring

    The source currency.

  • tostring

    The target currency.

  • ratestring

    The rate used.

  • convertedstring

    The converted amount, as a decimal string.

  • market_sessionstring

    Whether the market is open, on a weekend or closed between trading sessions.

  • timestampdate-time

    The time of the rate.

  • staleboolean

    Whether the rate is stale.


Full reference →
GETGet historical rates/v1/fx/rates/{base}/observations

Stored rates in date order, a page at a time. Dates with no stored rate are left out, never filled in.

Parameters

  • baserequired

    The base currency, as an uppercase ISO 4217 code.

  • currenciesrequired

    A comma-separated list of 1 to 64 different quote currencies. The base cannot be in it.

  • start_daterequired

    The first day, on or after 1971-01-01. Inclusive.

  • end_daterequired

    The last day, on or after start_date and not in the future. Inclusive.

  • limitoptional

    Dates per page. The default is 100 and the most is 366.

  • cursoroptional

    Reuse next_cursor from the previous page with the same filters.

Response fields

  • basestring

    The base currency.

  • observationsarray

    One record for each date, with the rates stored for it.

  • next_cursorstring

    The cursor for the next page. Null on the last page.


Full reference →

Use cases

A rate on a past date

Get the exchange rate for one date and handle days with no rate.

Read the guide →

Rate on an invoice date

Convert a dated invoice, with weekends and currency direction handled.

Read the guide →

Monthly average rate

Average the daily rates of one month for your accounts.

Read the guide →

A daily data pull

Run a small script once a day and append the rate to a CSV.

Read the guide →

Month-end close in foreign currency

Revalue balances at the month-end rate and average the month.

Read the use case →

Coverage

Show all 24 pairs

Related APIs

Spot metals price API

Gold, silver, platinum and palladium spot prices, plus WTI, Brent and copper reference prices.

Explore the API →

Public Holidays API

Official public holidays by country, with national and regional scope.

Explore the API →

Pricing

$10 of free credit a month, then from $2 per 1,000 calls.

See pricing →

FAQ

What does an FX rate mean?

One unit of the base equals the returned amount of the quote currency.

Which currencies are supported?

144 currencies. The coverage page lists every one.

Does the API include historical rates?

Yes. History uses genuine stored dates, bounded pages, and opaque cursors.

What happens on weekends?

The latest accepted rate can remain available with its timestamp, stale state, and weekend market session. Missing publication dates are not filled with synthetic rates.

Are these executable dealer quotes?

No. Rates and conversions are indicative, not dealer quotes or official fixings.