Historical Rates API
Fetch historical exchange rates for a specified date and base currency.
Endpoint
GET /historical_rates
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
baseCurrency | string | Yes | Base currency code (ISO 4217) - e.g., USD, EUR, GBP |
date | string | Yes | Date in YYYY-MM-DD format - e.g., 2024-01-15 |
targetCurrencies | string | No | Comma-separated target currencies. Defaults to all if omitted. |
Request Example
curl -X GET "https://api.openfxrates.com/historical_rates?baseCurrency=USD&date=2024-01-15&targetCurrencies=EUR,GBP,JPY" \
-H "X-API-Key: your-api-key-here"
Response Schema
{
"status": "SUCCESS",
"data": {
"base_currency": "USD",
"rates": {
"EUR": 0.861166,
"GBP": 0.746252,
"JPY": 158.11890909
},
"timestamp": "2026-01-22T11:34:57.294Z",
"meta_data": {
"monthly_requests": 100000,
"remaining_requests": 99998,
"reset_time": null
}
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
status | string | Request status (SUCCESS or FAILED) |
data | object | Response data container |
base_currency | string | The base currency code |
rates | object | Historical exchange rates for the specified date |
timestamp | string | ISO 8601 timestamp of the response |
meta_data | object | API usage information |
meta_data.monthly_requests | number | Total monthly request limit |
meta_data.remaining_requests | number | Remaining requests for the month |
meta_data.reset_time | string/null | When the limit resets |
Status Codes
| Status | Description |
|---|---|
| 200 | Success - Historical rates returned |
| 400 | Bad Request - Invalid date format or currency code |
| 401 | Unauthorized - Invalid or missing API key |
| 429 | Too Many Requests - Rate limit exceeded |
Examples
Get rates for a specific date
curl -X GET "https://api.openfxrates.com/historical_rates?baseCurrency=USD&date=2024-01-15" \
-H "X-API-Key: your-api-key"
Get historical rates for specific currencies
curl -X GET "https://api.openfxrates.com/historical_rates?baseCurrency=EUR&date=2024-06-30&targetCurrencies=USD,GBP,JPY" \
-H "X-API-Key: your-api-key"
Date Range Support
- Available Data: 1999-01-01 to present
- Weekends & Holidays: Market rates from previous trading day
- Future Dates: Not available
Use Cases
- Financial Analysis - Analyze exchange rate trends over time
- Backtesting - Test trading strategies with historical data
- Reporting - Generate accurate historical reports
- Reconciliation - Match historical transactions
Performance Tips
- Cache historical data - It never changes
- Batch requests for date ranges using multiple concurrent requests
- Request only needed currencies to reduce payload size
Rate Limiting
Rate limit information is included in every response under meta_data:
monthly_requests- Total requests allowed per monthremaining_requests- Requests remaining this monthreset_time- When the limit resets (if applicable)
See Also
- Latest Rates API - Get real-time rates
- Currency Conversion API - Convert amounts
- List Currencies - Supported currencies