Retrieves the historical (time series) open-high-low-close for the specified pair. Note: The timestamp returned refers to the start of the candle.
Important Update
The old endpoint
https://api.amberdata.com/market/spot/ohlcv/{pair}/historical
has been updated tohttps://api.amberdata.com/markets/spot/ohlcv/:instrument
. The old endpoint will be deprecated on 2024-09-30. Please update your integrations accordingly.See changes here
- Endpoint URL Change:
- Old:
https://api.amberdata.com/market/spot/ohlcv/{pair}/historical
- New:
https://api.amberdata.com/markets/spot/ohlcv/:instrument
- Metadata Changes:
- Removed
columns
,startDate
,endDate
.- Added
next
for pagination andapi-version
.- Data Structure Changes:
- The
data
object has been changed from a nested JSON object with arrays to an array of JSON objects.- New fields
instrument
,exchange
,exchangeTimestamp
,open
,high
,low
,close
, andvolume
.- Field Value Changes:
- The structure of OHLCV data has changed significantly to a more detailed and explicit format.
- Other
- The
exchange
parameter is now a required field- Add the
Accept-Encoding
header to your requests to benefit from data compression and improved performance.
Time Range Limit
The maximum time range (difference between startDate and endDate) is:
- 12 months of daily data
- 30 days of hourly data
- 24 hours of minutely data
In order to get more than the maximum allowed, you can use the
startDate
&endDate
parameters to move the time frame window to get the next n days/hours/minutes of data.
Not specifying startDate and endDate
If the startDate and endDate query parameters are not provided, the API will return the previous 12 months of daily data.
RESPONSE DATA
Field | Type | Description |
---|---|---|
metadata | object | The metadata associated with the ohlcv data. |
data | object | The ohlcv data corresponding to the columns fields. |
columns | array | The name of the columns associated with the returned data e.g. [ timestamp, open, ...] . |
timestamp | string | The timestamp associated with this record. |
open | number | The opening price of the market pair. |
high | number | The highest price of the market pair. |
low | number | The lowest price of the market pair. |
close | number | The closing price of the market pair. |
volume | number | The volume expressed in base units. For example, ETH-BTC, volume would be in ETH. |