Get historic rates for one base currency against one or more counter currencies.
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
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
OPTIONAL – Currency you want to convert from ISO code. Note if this parameter is omitted, default is USD.
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.
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.
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.
OPTIONAL – Time parameter is only applicable to packages with access to rate frequencies faster than daily.
UTC time is in format of HH:MM
OPTIONAL – If ‘true’ then endpoint will display rates for currencies that are obsolete. If ‘false’ then obsolete currencies are replaced by their successor currency.
OPTIONAL – If ‘true’ then endpoint will display the inverse of the converted value. If ‘false‘ then it will not be displayed.
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
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.
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.
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 historic rates for one base currency against one or more counter currencies over a period of time. GET
This endpoint returns a daily historic rate for a single base currency and one or more counter currencies over a period of time. [https://xecdapi.xe.com/v1/historic_rate/period.csv/?from=USD&to=CAD&start_timestamp=2017-09-01&end_timestamp=2017-11-30&per_page=30](https://xecdapi.xe.com/v1/historic_rate/period.csv/?from=USD&to=CAD&start_timestamp=2017-09-01&end_timestamp=2017-11-30&per_page=30)
Get monthly average rates for a single base currency and one or more counter currency for the month/year you specify in your API query. GET
The monthly average endpoint returns monthly average rates for a single base currency and one or more counter currency for the year you specify in your API query. The monthly average rate is calculated by taking the 00:00 UTC Daily rate for each day in the month/year you specify in your query. Months are returned as a numeric value from 1 to 12 where 1 is for January and 12 is for December. If no month is provided, then all months for the given year are returned.