OpenAPI spec
The Xe Currency Data API is described by an OpenAPI 3 document, available as JSON or YAML. Download it to import the API into a client such as Postman or Insomnia, generate a typed client, or review the full contract offline. Both files describe the same API, pick whichever your tooling prefers.
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.
Errors & Exceptions
Next Page