Bids and Asks

You can also access Bid-Ask Spread from the Full Snapshot

What is this endpoint for?

Bids and asks is commonly referred to as a "Raw Order Book". This endpoint returns all bids and asks from an exchange's order book at a specific point in time. The snapshot is produced every 30 seconds.

Endpoint

https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/raw

Parameters

ParameterRequiredDescription

exchange

Yes

instrument_class

Yes

instrument

Yes

continuation_token

No

limit_orders

No

Number of orders to return on bid and ask side per snapshot. To retreive the best bid/ask, set this parameter to 1 Default: 10

page_size

No

Number of snapshots to return data for. Default: 10 Max: 100 See Pagination Automatically included in continuation tokens.

sort

No

Return the data in ascending (asc) or descending (desc) order. Default: desc Automatically included in continuation tokens.

start_time

No

Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.

end_time

No

Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.

Fields

FieldDescription

poll_timestamp

The timestamp at which the raw data snapshot was taken.

poll_date

The date at which the raw data snapshot was taken.

timestamp

The timestamp provided by the exchange. null when not provided.

asks

The sell orders in the snapshot. If the limit_oders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.

bids

The buy orders in the snapshot. If the limit_oders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.

Request example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/raw?page_size=10&limit_orders=2'

Response example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "slippage": 0,
        "limit_orders": 2,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "metric": "raw",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:13:08.823Z"
    },
    "time": "2020-05-26T14:13:08.899Z",
    "timestamp": 1590502388899,
    "data": [
        {
            "poll_timestamp": 1590502335760,
            "poll_date": "2020-05-26T14:12:15.760Z",
            "timestamp": null,
            "asks": [
                {
                    "amount": "12",
                    "price": "8830"
                },
                {
                    "amount": "3.67",
                    "price": "8832.9"
                }
            ],
            "bids": [
                {
                    "amount": "13.316",
                    "price": "8829.9"
                },
                {
                    "amount": "0.097",
                    "price": "8829.4"
                }
            ]
        }
      /* ... */         
    ],
    "result": "success",
    "continuation_token": "Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
    "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/raw?continuation_token=Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

Last updated