Documentation
Historical Rates Endpoint
The Historical Rates endpoint provides access to past exchange rates for any supported currency pair. This endpoint is essential for financial analysis, trend tracking, backtesting trading strategies, and building historical charts and reports.
You can retrieve historical rates for any date back to the year 2000, allowing you to analyze currency movements over time and make informed decisions based on historical performance.
Historical Rates
/api/v1/history Request Parameters
key string Your API key for authentication
date string The date for which you want historical rates (YYYY-MM-DD format)
base string The base currency for exchange rates. All rates will be relative to this currency
Default: USD
output string Response output format. Use `json` (default) or `xml`
Default: json
Response Properties
valid boolean Indicates whether the request was successful
updated integer The timestamp when the rates were last updated (Unix timestamp)
base string The base currency used for all exchange rates
date string The date for which the historical rates were retrieved
rates object Object containing historical exchange rates, where the key is the currency code and the value is the exchange rate. If the currency did not exist on the date requested, the value will be NULL.
Date Format and Examples
The date parameter must be in YYYY-MM-DD format. Here are some examples:
- 2024-01-15: January 15, 2024
- 2023-12-31: December 31, 2023
- 2024-02-29: February 29, 2024 (leap year)
- 2023-06-01: June 1, 2023
Data Availability
Our historical data goes back to the year 2000.
NOTE: Not all currencies have data back to 2000, eg newer fiat currencies or cryptocurrencies. In this case, the rate will show as null.
Our historical data is updated at 00:00 UTC every day, and rates are saved for the previous day.
With most fiat currencies, weekend and holiday rates are typically the same as the last business day.
Common Use Cases
The Historical Rates endpoint is commonly used for:
- Financial Applications: Build historical charts and analysis tools
- Trading Platforms: Provide historical data for backtesting and analysis
- Investment Research: Analyze currency performance over time
- Risk Management: Calculate historical volatility and risk metrics
- Reporting Systems: Generate historical reports for clients
- Educational Tools: Create learning materials about currency markets
Best Practices
To optimize your use of the Historical Rates endpoint:
- Cache historical data: Historical rates don't change, so cache them permanently
- Batch requests: If you need multiple dates, consider using the timeframe endpoint or looping through the dates
- Validate dates: Ensure dates are in the correct format and within our data range
- Error handling: Always check the
validfield and handle date-related errors
Related Endpoints
/api/v1/rates Currency Rates
Get current real-time exchange rates for comparison with historical data
/api/v1/timeframe Timeframe Rates
Get exchange rates for specific date ranges and periods
/api/v1/currencies Currency List
Get the complete list of supported currencies for historical analysis
/api/v1/convert Currency Conversion
Convert amounts using current rates for comparison with historical conversions