Query Rate History
Retrieves historical exchange rate data for a specific currency pair over a given time range. The API returns rates at hourly frequency, including the latest rate when the query range covers the current time.
Request Parameters
sellCurrencystring
required
Sell currency, following the ISO 4217 standard. Fixed length of 3 characters. See Data Types
buyCurrencystring
required
Buy currency, following the ISO 4217 standard. Fixed length of 3 characters. See Data Types
startTimedatetime
required
Start time of the query range within 30 days, in ISO 8601 format.
endTimedatetime
required
End time of the query range, in ISO 8601 format. Rates are returned at hourly frequency between startTime and endTime.
Response Parameters
resultResult
See Result.
sellCurrencystring
Sell currency, following the ISO 4217 standard. Same as the request. See Data Types
buyCurrencystring
Buy currency, following the ISO 4217 standard. Same as the request. See Data Types
currentRateRateHistoryDetail
Latest exchange rate. Returned when the query range includes the current time and the rate service can provide the latest quote.
historicalRatesarray
List of historical rates. Up to 720 elements.
Error Codes
Definition
POST /api/open/v1/fx/rates/queryHistoryRequest
{
"sellCurrency": "USD",
"buyCurrency": "HKD",
"startTime": "2026-04-01T00:00:00Z",
"endTime": "2026-04-02T00:00:00Z"
}Response
{
"result": {
"resultCode": "SUCCESS",
"resultMessage": "success",
"resultStatus": "S"
},
"sellCurrency": "USD",
"buyCurrency": "HKD",
"currentRate": {
"clientRate": 7.785,
"marketRate": 7.78,
"time": "2026-04-02T10:00:00Z"
},
"historicalRates": [
{
"clientRate": 7.783,
"marketRate": 7.778,
"time": "2026-04-01T00:00:00Z"
},
{
"clientRate": 7.7845,
"marketRate": 7.7795,
"time": "2026-04-01T01:00:00Z"
}
]
}