Bybit Public WebSocket Streams — Real-Time Market Data
Subscribe to real-time orderbook, kline, trade, ticker, and liquidation streams from Bybit using WebsocketClient.subscribeV5(). No authentication required.
Use this file to discover all available pages before exploring further.
Public WebSocket streams deliver real-time market data — orderbooks, klines, trades, tickers, liquidations — without any authentication. The WebsocketClient routes each subscription to the correct category-specific endpoint automatically. You provide the topic string and the category; the SDK handles connections, heartbeats, and reconnects.
Call subscribeV5(topic, category) with any public topic string. The category parameter is required for public topics because Bybit exposes a separate WebSocket endpoint per product group:
Category
WsKey used
Endpoint
'spot'
v5SpotPublic
wss://stream.bybit.com/v5/public/spot
'linear'
v5LinearPublic
wss://stream.bybit.com/v5/public/linear
'inverse'
v5InversePublic
wss://stream.bybit.com/v5/public/inverse
'option'
v5OptionPublic
wss://stream.bybit.com/v5/public/option
All topic updates arrive on the update event. The parsed payload always contains a topic string, a type (snapshot or delta), a ts timestamp, and a data field with the topic-specific payload. An additional wsKey property is injected by the SDK so you can identify which connection the message came from.
Call unsubscribeV5(topic, category) at any time. The topic is removed from the internal tracker and will not be resubscribed after a reconnect:
wsClient.unsubscribeV5('orderbook.50.BTCUSDT', 'linear');// Or unsubscribe from multiple topics at oncewsClient.unsubscribeV5( ['kline.5.BTCUSDT', 'kline.5.ETHUSDT'], 'spot',);
Subscribe to the order book for a symbol. Bybit pushes an initial snapshot then incremental delta updates. The depth controls the number of price levels returned.Topic format:orderbook.{depth}.{symbol}
Depth
Available for
1
spot, linear, inverse, option
50
spot, linear, inverse, option
200
spot, linear, inverse
500
spot, linear, inverse
import { WebsocketClient } from 'bybit-api';const wsClient = new WebsocketClient();wsClient.on('update', (data) => { if (data.topic.startsWith('orderbook')) { const { s, b, a, u, seq } = data.data; // s = symbol, b = bids [[price, qty]], a = asks [[price, qty]] // u = update ID, seq = cross sequence console.log(`Orderbook ${s}: best bid ${b[0]?.[0]}, best ask ${a[0]?.[0]}`); }});// Single depth level — top of book onlywsClient.subscribeV5('orderbook.1.BTCUSDT', 'linear');// 50-level orderbookwsClient.subscribeV5('orderbook.50.BTCUSDT', 'linear');// Multiple symbols in one callwsClient.subscribeV5( ['orderbook.50.BTCUSDT', 'orderbook.50.ETHUSDT'], 'linear',);// Spot orderbookwsClient.subscribeV5('orderbook.50.BTCUSDT', 'spot');// InversewsClient.subscribeV5('orderbook.50.BTCUSD', 'inverse');// OptionwsClient.subscribeV5('orderbook.25.BTC-29NOV24-100000-C', 'option');
The first message for each orderbook topic is always a full snapshot. Subsequent messages are delta updates. Your application must apply deltas to the snapshot to maintain an accurate local order book. A delta entry with qty: "0" means that price level should be removed.
The ticker stream provides a 24-hour rolling summary for a symbol: last price, 24h high/low, volume, funding rate, open interest, and more. The first message is a full snapshot; subsequent messages are delta updates containing only changed fields.Topic format:tickers.{symbol}
Kline data provides OHLCV candlesticks at a chosen interval. Each update is a snapshot containing the latest (possibly unconfirmed) candle. The confirm field in the data is true when the candle closes.Topic format:kline.{interval}.{symbol}
Interval
Meaning
1, 3, 5, 15, 30
Minutes
60, 120, 240, 360, 720
Minutes (1h, 2h, 4h, 6h, 12h)
D
Daily
W
Weekly
M
Monthly
import { WebsocketClient } from 'bybit-api';const wsClient = new WebsocketClient();wsClient.on('update', (data) => { if (data.topic.startsWith('kline')) { for (const candle of data.data) { // candle: { start, end, interval, open, high, low, close, volume, turnover, confirm, timestamp } if (candle.confirm) { console.log(`Closed candle [${data.topic}]:`, candle); } } }});// 5-minute klines for multiple symbols on spotwsClient.subscribeV5( ['kline.5.BTCUSDT', 'kline.5.ETHUSDT', 'kline.5.XRPUSDT'], 'spot',);// 1-hour klines on linearwsClient.subscribeV5('kline.60.BTCUSDT', 'linear');// Daily klines on inversewsClient.subscribeV5('kline.D.BTCUSD', 'inverse');
The public trade stream delivers every trade executed on the exchange in real time. Each message is a snapshot containing an array of trade objects.Topic format:publicTrade.{symbol}For options, you subscribe per base asset (e.g. publicTrade.BTC) rather than per contract.
import { WebsocketClient } from 'bybit-api';const wsClient = new WebsocketClient();wsClient.on('update', (data) => { if (data.topic.startsWith('publicTrade')) { for (const trade of data.data) { // trade: { T (timestamp), s (symbol), S (side), v (qty), p (price), // i (tradeId), BT (block trade flag) } console.log(`Trade on ${trade.s}: ${trade.S} ${trade.v} @ ${trade.p}`); } }});// Spot trade streamwsClient.subscribeV5('publicTrade.BTCUSDT', 'spot');// Linear trade streamwsClient.subscribeV5('publicTrade.BTCUSDT', 'linear');// Inverse trade streamwsClient.subscribeV5('publicTrade.BTCUSD', 'inverse');// Options trade stream (subscribe per base asset, not per contract)wsClient.subscribeV5('publicTrade.BTC', 'option');
The liquidation stream pushes forced-liquidation events as they occur. Only available for linear and inverse perpetuals/futures.Topic format:liquidation.{symbol}
import { WebsocketClient } from 'bybit-api';const wsClient = new WebsocketClient();wsClient.on('update', (data) => { if (data.topic.startsWith('liquidation')) { for (const liq of data.data) { // liq: { T (timestamp), s (symbol), S (side), v (qty), p (price) } console.log(`Liquidation on ${liq.s}: ${liq.S} ${liq.v} @ ${liq.p}`); } }});// Subscribe to liquidations for a specific symbolwsClient.subscribeV5('liquidation.BTCUSDT', 'linear');wsClient.subscribeV5('liquidation.BTCUSD', 'inverse');
To monitor liquidations across all symbols, fetch the full symbol list via RestClientV5.getTickers(), generate a topic per symbol, and pass the array to subscribeV5. The spot limit is 10 topics per subscribe event; other categories allow up to 500.