API ReferenceMid market rates

Get historic rates for one base currency against one or more counter currencies.

GET
/v1/historic_rate

The Currency Data API provides you with access to daily historical rates back to 1998. When retrieving historical rates through our Currency Data API, you would specify your requested currencies along with the date and/or date range and time (hh:mm). Minutely and 15 minute rates are available for the past 7 days. Outside of 7 days you have access to rates on the hour. Historical rates are available with all API packages. The time parameter (hh:mm) is applicable only for packages with access to rate updates faster than daily. The endpoint returns the historic rate for a single base currency and one or more counter currencies.

https://xecdapi.xe.com/v1/historic_rate.csv/?from=USD&date=2011-03-05&to=CAD,EUR

Authorization

AuthorizationBearer <token>

API key created on your Xe Currency Data account's API page, sent as a Bearer token in the Authorization header.

In: header

Query Parameters

from?string

OPTIONAL – Currency you want to convert from ISO code. Note if this parameter is omitted, default is USD.

to*string

Comma separated list of to currencies ISO 4217 codes. This will limit the data returned to only those currencies you are interested in. Use an asterisk * to specify all currencies. Note: Obsolete currencies are replaced by their precursor or successor currency.

amount?number

OPTIONAL – This parameter can be used to specify the amount you want to convert, if an amount is not specified then 1.00 is assumed.

date?string

OPTIONAL - UTC date should be in the form of YYYY-MM-DD, back to 1995-11-16.

If your account is registered to receive daily rates only, the default time value used is 00:00 UTC, or your daily lock-in time if one is set.

Otherwise the endpoint will return the latest rates for your chosen date.

time?string

OPTIONAL – Time parameter is only applicable to packages with access to rate frequencies faster than daily.

UTC time is in format of HH:MM

obsolete?boolean

OPTIONAL – If ‘true’ then endpoint will display rates for currencies that are obsolete. If ‘false’ then obsolete currencies are replaced by their successor currency.

inverse?boolean

OPTIONAL – If ‘true’ then endpoint will display the inverse of the converted value. If ‘false‘ then it will not be displayed.

decimal_places?number

OPTIONAL – This parameter can be used to specify the number of decimal places included in the output. Example 1 USD to EUR = 0.874852 with decimal_places=3, the output returned will be EUR = 0.875

margin?number

OPTIONAL – This parameter can be used to add a margin (-/+) to XE's mid-market rate. Example: add margin=2.05 parameter to the endpoint and the API will return our mid-market rates plus the margin of 2.05 percent.

crypto?boolean

OPTIONAL – If 'true' then this endpoint will return data for the following crypto currencies: ADA, ARB, AVAX, BCH, BNB, BTC, DAI, DOGE, DOT, ETH, EURC, LINK, LTC, LUNA, POL, SOL, TRX, UNI, USDC, USDP, USDT, XLM and XRP.

Note: Historical crypto data varies by currency. Most start from May 2022 onward.

use_lock_in_time?boolean

OPTIONAL - If ‘true’ then this endpoint will display rates using your daily lock in rate time (any value set for the time will be ignored).

Response Body

application/json

application/json

application/json

application/json

text/plain

curl -X GET "https://example.com/v1/historic_rate?to=string"
{  "terms": "https://www.xe.com/legal",  "privacy": "https://www.xe.com/privacy",  "from": "USD",  "amount": 1,  "timestamp": "2026-09-20T00:00:00Z",  "to": [    {      "quotecurrency": "EUR",      "mid": 0.8706371278    },    {      "quotecurrency": "GBP",      "mid": 0.7465807902    }  ]}
{  "code": 11,  "message": "Date 2099-01-01T00:00:00Z is in future",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
{  "code": 1,  "message": "Bad credentials",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
{  "code": 3,  "message": "Monthly rate limit exceeded.",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
{  "code": 4,  "message": "Current interval rate limit exceeded.",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
"An unexpected error occurred"
Get help