GET
Level2 Order Book
Establish a WebSocket connection to get real-time updates for order books. Subscribe to a live feed of all outstanding buy and sell orders on the market for specific coins and tokens. Send messages when specific market conditions occur.
Header Params
-
Authorizationstring requiredBearer token for authorization
Body Params
object
-
typestring requiredThe event type (e.g. "subscribe" or "unsubscribe") -
channelstring requiredThe subscription channel (e.g. "level2" for order books) -
accountIdstring requiredThe ID of the account -
productIdstring requiredThe ID of product. (e.g. "TBTC-TUSD*") -
includeCumulativebooleanInclude cumulative size in each price level. Whentrue, each level is[price, size, cumulativeSize]instead of[price, size].cumulativeSizeis the running total ofsizefrom the top of that side through the level.
Responses
101
Switching Protocols. Once connected, the server may send:
WsOrderBooksResponse — level2 order book snapshot/updates
WsSubscriptionResponse — confirmation after every subscribe/unsubscribe request
Switching Protocols. Once connected, the server may send:
WsOrderBooksResponse— level2 order book snapshot/updatesWsSubscriptionResponse— confirmation after every subscribe/unsubscribe request
Response Body
ONE OF
-
channelstringThe channel name (e.g. "level2"). -
typestringThe type of the response (e.g. "snapshot"). -
productstringThe product name (e.g. "TBTC-TUSD*"). -
timestring date-timeThe timestamp of the snapshot. -
bidsarray of arrayAn array of bid levels[price, size]or[price, size, cumulativeSize]whenincludeCumulativeis true.cumulativeSizeis the running total ofsizefrom the top of that side through the level. -
asksarray of arrayAn array of ask levels[price, size]or[price, size, cumulativeSize]whenincludeCumulativeis true.cumulativeSizeis the running total ofsizefrom the top of that side through the level.
-
typestring enum requiredAlways "subscription_response".subscription_response -
channelstring enum requiredThe channel the subscription applies to ("orders" or "level2").orderslevel2 -
statusstring enum requiredOutcome of the subscribe/unsubscribe request:
subscribed— subscription was accepted and is now active.already_subscribed— (orders channel only) a subscription for this accountId was already active; no duplicate was created. For the level2 channel, duplicate subscribe requests return an error instead, becauseincludeCumulativeis fixed for the lifetime of a subscription and cannot be changed without unsubscribing first.unsubscribed— subscription was successfully removed.
subscribedalready_subscribedunsubscribed -
accountIdstringThe ID of the account -
productIdstringThe product ID, present for level2 subscriptions. -
session_idstringThe session ID for this WebSocket connection.
403
Forbidden - Insufficient permissions
Response Body
object
-
errorstring required -
errorNamestring required -
reqIdstring required