GET
/
futures
/
order-book-snapshots
/
{instrument}
Snapshots Historical
curl --request GET \
  --url https://api.amberdata.com/markets/futures/order-book-snapshots/{instrument} \
  --compressed \
  --header 'Accept-Encoding: <accept-encoding>' \
  --header 'x-api-key: <api-key>'
{
  "status": 200,
  "title": "OK",
  "description": "Successful request",
  "payload": {
    "metadata": {
      "requestedStartDate": 1717518243690,
      "requestedEndDate": 1717604643690,
      "returnedStartDate": 1717518300000,
      "returnedEndDate": 1717521900000,
      "next": "https://api.amberdata.com/markets/futures/order-book-snapshots/BTCUSD_PERP?cursor=N4IgpgHgxgFghgOwOZhALhAIwJYMVVAGhCgFcAnAZwHtz0FSAbR4ygFznLYBE43U0ARgDsIgKwAmQQE4ADPPnEwCACa9%2B6ESIBssgCza9AZm1zibbAFswAMVqW%2B6EJezNslMFGqrKIc1bAASQR%2BcgA3OEZ0UDxrJwBPME5fVgBHRgA5ODiMRM4-EEp0rOsABUYKSISk8kZ4gpUwADM4JjZ0AA5DBUVnOAh0bSMJPT0OntliRmpqAGtMOChZ0rBybGoVeiZGAF9iJvtHDAArGgQCi2t2bIAHLeZiBwgAGTAwsCi0BgeQXCgKxoAVQQlFINxutH4KgAotB4MgwL40C1GB5WJCANJgeoYLTCSQyCYAfVkRJweAQBCJ0l0RlkUiM0mE2jERLY5FIYCJACEACoAYUBAGVuETStCAEqlEA7IA",
      "api-version": "2023-09-30"
    },
    "data": [
      {
        "exchange": "binance",
        "instrument": "BTCUSD_PERP",
        "timestamp": 1717518300000,
        "exchangeTimestamp": 1717518300711,
        "sequence": "960253327911",
        "currentFunding": null,
        "ask": [
          {
            "price": 70895.9,
            "volume": 7086,
            "numOrders": null
          },
          {
            "price": 70896,
            "volume": 48,
            "numOrders": null
          }
        ],
        "bid": [
          {
            "price": 70895.8,
            "volume": 2097,
            "numOrders": null
          },
          {
            "price": 70895,
            "volume": 1,
            "numOrders": null
          }
        ]
      }
    ]
  }
}
The maximum time range (difference between startDate and endDate) is 18 months.
If the startDate and endDate query parameters are not provided, the API will return the data from the previous 24 hours.

Authorizations

x-api-key
string
header
required

Headers

Accept-Encoding
string
default:gzip, deflate, br
required
api-version
string

Path Parameters

instrument
string
default:BTCUSD_PERP
required

The instrument for which to retrieve the requested data.

Query Parameters

exchange
string
default:binance
required

The exchange for which data should be retrieved. Only 1 exchange is allowed.

startDate
string<date-time>

[Optional] Payload only includes data after this date (inclusive). [Defaults] Beginning of the current minute (max time range is 10 minutes).

endDate
string<date-time>

[Optional] Payload only includes data before this date (exclusive). [Defaults] Ten minutes after the beginning of the current hour (max time range is 10 minutes).

timestamp
string

[Optional] The timestamp at which to return the order book information (closest match, lower or equal to the timestamp specified).

timeFormat
string

[Optional] Time format of the timestamps in the return payload. [Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable

sortDirection
string

[Optional] Specifies the direction in which the data is sorted (by timestamp). [Defaults] asc (ascending order). [Usage Conditions] This parameter can only be used if the startDate and endDate timeframe is within the most recent 24 hours, or if the startDate and endDate parameters are not used at all. [Examples] ascending | descending | asc | desc

maxLevel
integer

The number of order book levels that should be returned.

Response

200
application/json

200

The response is of type object.