Historical

Retrieves the historical time series OHLCV data for the specified instrument and exchange(s).

⚠️

Important Update

The old endpoint https://api.amberdata.com/market/futures/ohlcv/{instrument}/historical has been updated to https://api.amberdata.com/markets/futures/ohlcv/:instrument. The old endpoint will be deprecated on 2024-10-31. Please update your integrations accordingly.

See changes here
  • Endpoint URL Change:
    • Old: https://api.amberdata.com/market/futures/ohlcv/{instrument}/historical
    • New: https://api.amberdata.com/markets/futures/ohlcv/:instrument
  • Metadata Changes:
    • New fields api-version and next are introduced in the metadata object.
    • startDate and endDate fields were removed.
  • Data Structure Changes:
    • The data structure remains an array of JSON objects, but the fields within each object have changed slightly.
  • Field Changes:
    • Added the instrument field to new schema
    • Renamed timestamp to exchangeTimestamp
  • Other
    • The exchange parameter is now a required field
    • Include the Accept-Encoding: header in your API requests to take advantage of compressed responses.

📘

Time Range Limit

The maximum time range (difference between startDate and endDate) is 2 years.

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 data from the previous 24 hours with a 1 minute frequency.


RESPONSE DATA
JSON Field/PathValue TypeDescription
payload.metadata.nextstringThe URL for the next page of data (nullable if there is no next page).
payload.metadata.api-versionstringThe version of the API used for this request.
payload.data[].instrumentstringThe instrument or trading pair for which OHLCV data is recorded (e.g., BTCUSD_PERP).
payload.data[].exchangestringThe name of the exchange where the OHLCV data applies (e.g., binance).
payload.data[].exchangeTimestampintegerThe timestamp from the exchange in milliseconds since epoch.
payload.data[].openfloatThe opening price of the instrument for the specified timestamp.
payload.data[].highfloatThe highest price of the instrument for the specified timestamp.
payload.data[].lowfloatThe lowest price of the instrument for the specified timestamp.
payload.data[].closefloatThe closing price of the instrument for the specified timestamp.
payload.data[].volumefloatThe trading volume for the instrument during the specified timestamp.
Language
Authorization
Header
Click Try It! to start a request and see the response here!