Skip to main content

Historical Rates API

Fetch historical exchange rates for a specified date and base currency.

Endpoint

GET /historical_rates

Parameters

ParameterTypeRequiredDescription
baseCurrencystringYesBase currency code (ISO 4217) - e.g., USD, EUR, GBP
datestringYesDate in YYYY-MM-DD format - e.g., 2024-01-15
targetCurrenciesstringNoComma-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

FieldTypeDescription
statusstringRequest status (SUCCESS or FAILED)
dataobjectResponse data container
base_currencystringThe base currency code
ratesobjectHistorical exchange rates for the specified date
timestampstringISO 8601 timestamp of the response
meta_dataobjectAPI usage information
meta_data.monthly_requestsnumberTotal monthly request limit
meta_data.remaining_requestsnumberRemaining requests for the month
meta_data.reset_timestring/nullWhen the limit resets

Status Codes

StatusDescription
200Success - Historical rates returned
400Bad Request - Invalid date format or currency code
401Unauthorized - Invalid or missing API key
429Too 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

  1. Cache historical data - It never changes
  2. Batch requests for date ranges using multiple concurrent requests
  3. 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 month
  • remaining_requests - Requests remaining this month
  • reset_time - When the limit resets (if applicable)

See Also