Skip to main content

Best Book Ticker

Description​

There is no dedicated best-bid/ask WebSocket channel. The current best order (highest bid, lowest ask) is the first level on each side of the orderbook:{symbol} stream.

Connect to wss://api.ztdxtest.xyz/ws and subscribe to the order book channel. A snapshot is pushed on subscribe, followed by a full update every 500 ms (top 30 levels per side).

Subscribe​

{
"type": "subscribe",
"channel": "orderbook:BTCUSDT"
}

Push Example​

{
"type": "orderbook",
"symbol": "BTCUSDT",
"source": "internal",
"epoch": "72622087-56bd-49dd-b76a-97f031e550de",
"book_seq": 936902,
"snapshot_type": "snapshot",
"timestamp": 1795070733460,
"bids": [
{ "price": "63528.3", "size": "0.007" }
],
"asks": [
{ "price": "63529.0", "size": "0.006" }
],
"user_orders": {
"bids": [["63528.3", "0.007"]],
"asks": [["63529.0", "0.006"]]
}
}

The best bid is bids[0].price and the best ask is asks[0].price. Each level is an object {price, size}. user_orders repeats the ordinary-user levels as [price, qty] arrays. timestamp is Unix milliseconds. epoch is an opaque market id, and book_seq increases when the book changes.

See WebSocket API General Info for connection details. For a REST snapshot, use GET /fapi/v1/ticker/bookTicker.