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.
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.
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 based on ISO 4217 codes. This will limit the data returned to only those currencies that are specified.
OPTIONAL – This parameter can be used to specify the amount you want to convert, if an amount is not specified then 1 is assumed.
OPTIONAL – This parameter specifies the year to calculate average monthly rates.
OPTIONAL – This parameter specifies the month in the given year to return average monthly rates. This is 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.
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 include inverse rates.
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 – 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.
Response Body
application/json
application/json
application/json
application/json
application/json
text/plain
curl -X GET "https://example.com/v1/monthly_average?to=string"{ "terms": "https://www.xe.com/legal", "privacy": "https://www.xe.com/privacy", "from": "USD", "amount": 1, "year": 2026, "to": { "EUR": [ { "monthlyAverage": 0.8524468275, "month": 1, "daysInMonth": 31 }, { "monthlyAverage": 0.8454772824, "month": 2, "daysInMonth": 28 } ], "GBP": [ { "monthlyAverage": 0.7401499218, "month": 1, "daysInMonth": 31 }, { "monthlyAverage": 0.7360488046, "month": 2, "daysInMonth": 28 } ] }}{ "code": 15, "message": "Month 13 in the year 2026 is invalid", "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. GET
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](https://xecdapi.xe.com/v1/historic_rate.csv/?from=USD&date=2011-03-05&to=CAD,EUR)
Gets an average rate over the specified time period, as well various additional statistics such as the standard deviation and volatility. GET
The stats endpoint returns average rates for a single base currency and one or more counter currencies over the time period you specify in your API query. Note that, unlike the monthly_average endpoint, you specify exact start and end dates, which provides a heightened level of control. This can be quite useful if you want statistics for bi-monthly averages or any other intervals of time. This endpoint also provides several other statistics: the highest and lowest rate over the period (and their respective timestamps), the average rate, the standard deviation, volatility, and the number of data points over this period. To provide some background to how we obtain our statistics, volatility is measured by applying the standard deviation of the logarithmic daily returns, expressed in a percentage score. We calculate daily returns using the values of two consecutive days and measure the gain or loss of a currency pair (**for live rate frequency packages this comparison is done at 00:00 UTC; daily rate frequency packages will compute stats based on the rate lock-in time specified on the account**). Then, we apply a logarithm to the ratio between those two values (Ex: ln (valueDay2 / valueDay1) is the logarithmic return between day2 and day1). As for the standard deviation, we apply it to the daily logarithmic returns we calculated during the given time period. When applicable, values are expressed as a percentage so they are already multiplied by 100.