Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
Websocket
Public
    Tickers ChannelCandlestick ChannelDepth ChannelPublic Trades ChannelRPI Depth ChannelLiquidation Channel
Private
Reality
SBE
Public

Depth Channel

Description

Push depth data. books is the full depth channel, books1 is the 1-level channel, books5 is the 5-level channel, and books50 is the 50-level channel:

  • books corresponds to full-depth data, the first push is the full data snapshot, subsequent pushes are incremental updates: update
  • books1 corresponds to 1-level depth data, every push: snapshot
  • books5 corresponds to 5-level depth data, every push: snapshot
  • books50 corresponds to 50-level depth data, every push: snapshot

Spot

  • books1 push frequency: 1ms
  • books5 push frequency: 10ms
  • books50 push frequency: 20ms
  • books push frequency: 50ms

Futures

  • books1 push frequency: 1ms
  • books5 push frequency: 10ms
  • books50 push frequency: 20ms
  • books push frequency: 50ms

The serial number of the previous push pseq :

  • Under normal circumstances, the serial numbers pushed by the depth channel are incremental, meaning that the seq value received in a push sequence is always greater than the pseq.
  • In cases such as system releases or service restarts, the serial numbers may be reset. At this time, users will most likely receive a push message with pseq=0. After the reset, all subsequent messages will continue to be ordered normally.
  • The seq of the previous update incremental message must be equal to the pseq of the following update incremental message.
  • The seq of update incremental messages should be increasing, except during symbol maintenance.
  • After receiving a snapshot (full snapshot), the seq of the snapshot should fall within the range [pseq, seq] of the first update incremental data received after the snapshot.
Code
{ "op": "subscribe", "args": [ { "instType": "usdt-futures", "topic": "books", "symbol": "BTCUSDT" } ] }

Request Parameters

ParametersTypeRequiredDescription
opStringYesOperation
subscribe Subscribe
unsubscribe Unsubscribe
argsList<Object>YesSubscribed channel
> instTypeStringYesProduct type
spot Spot trading
usdt-futures USDT futures
coin-futures Coin-M futures
usdc-futures USDC futures
> topicStringYesTopic
books All levels
books1 1 level
books5 5 levels
books50 50 levels
> symbolStringYesSymbol name
e.g., BTCUSDT
Code
{ "event": "subscribe", "arg": { "instType": "usdt-futures", "topic": "books1", "symbol": "BTCUSDT" }, "connId": "xxxxxxxxxx" }

Response Parameters

ParametersTypeDescription
eventStringEvent
argObjectSubscribed channel
> instTypeStringProduct type
spot Spot trading
usdt-futures USDT futures
coin-futures Coin-M futures
usdc-futures USDC futures
> topicStringTopic
> symbolStringSymbol name
codeStringError code
msgStringError message
connIdStringConnection ID
Code
{ "data": [ { "a": [ [ "99756.7", "23.9774" ] ], "b": [ [ "99756.6", "0.0128" ] ], "pseq": 0, "seq": 1304314508780744705, "maxDepth": "50", "ts": "1746698732562" } ], "arg": { "instType": "usdt-futures", "symbol": "BTCUSDT", "topic": "books" }, "action": "snapshot", "ts": 1746698732563 }

Push Parameters

Return FieldParameter TypeDescription
argObjectSubscribed channel
> instTypeStringProduct type
spot Spot trading
usdt-futures USDT futures
coin-futures Coin-M futures
usdc-futures USDC futures
> topicStringTopic
> symbolStringSymbol name
actionStringData push action
snapshot Full push
update Incremental push
tsStringData push timestamp
dataList<Object>Subscribed data
> aList<String>Sell Asks. Sort by price in ascending order
> > a[0]StringSell price
> > a[1]StringSell quantity
> bList<String>Buy bids. Sort by price in descending order
> > b[0]StringBuy Price
> > b[1]StringBuy quantity
> > seqStringSerial number.
It increments when the order book is updated and can be used to determine whether there is out-of-order packets.
> > pseqStringThe serial number of the previous push.
Can be used to determine if there has been packet loss. This field only has a value for the books channel.
> maxDepthStringMaximum depth levels.
Range: [0,1000].
Positive integer, varies between trading pairs.
This field only has a value for the books channel.
> > tsStringThe timestamp that the system generated data
A Unix timestamp in milliseconds
Candlestick ChannelPublic Trades Channel
JSON
JSON
JSON