Complete reference for all WebSocket data channels, subscription parameters, and message formats.
This page documents all available WebSocket channels, their subscription parameters, and the data format for each message type.
For full type definitions, see the Types page.
All data messages follow this structure:
{
"type" : "data" ,
"channel" : "<channel_name>" ,
"exchange" : "<exchange_id>" ,
"symbol" : "<symbol>" ,
"tf" : "<timeframe>" ,
"id" : "<subject>" ,
"data" : { ... }
}
Field Type Description typestring Always "data" for data messages channelstring Channel name (e.g., "candles", "trades") exchangestring Exchange ID (e.g., "binancef"). Aggregated streams use colon-separated, unique, alphabetically ordered IDs (e.g., "binancef:bybitf"). Invalid aggregate strings return INVALID_EXCHANGE. symbolstring Trading pair (e.g., "btc/usd") tfstring Timeframe string, included for channels that use timeframes idstring Subject identifier (e.g., "candles.binancef.btc/usd.60") dataobject Channel-specific data payload
The tf field is included for channels that use timeframes (candles, stats, oi, vd, volumes, heatmap_sd, heatmap_hd, flat_heatmap_sd, flat_heatmap_hd, stop_heatmap, tp_heatmap, liquidation_heatmap). It contains a human-readable timeframe string like "1m", "5m", "1h", "1d".
stop_heatmap, tp_heatmap, and liquidation_heatmap must use a single exchange ID (no aggregated exchanges), and are available only for hyperliquid and hyperliquid-xyz.
The id field contains the subject publish string that uniquely identifies this data stream. For example, "candles.binancef.btc/usd.60" for 1-minute candles on Binance Futures BTC/USD.
Real-time OHLCVT candlestick updates. A message is sent on every trade that updates the current candle.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "candles"exchangestring Yes Exchange ID (e.g., "binancef") symbolstring Yes Trading pair (e.g., "btc/usd") tfstring Yes Timeframe (e.g., "1m" for 1 minute)
{
"type" : "subscribe" ,
"channel" : "candles" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Field Type Description typestring "data"channelstring "candles"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe (e.g., "1m", "5m", "1h") dataOHLCVT Candle data
{
"type" : "data" ,
"channel" : "candles" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "candles.binancef.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"o" : 42000.50 ,
"h" : 42150.00 ,
"l" : 41950.00 ,
"c" : 42100.00 ,
"vb" : 1500000.00 ,
"vs" : 1400000.00 ,
"tb" : 1250 ,
"ts" : 1180
}
}
Field Type Description tint64 Candle timestamp (Unix seconds) ofloat64 Open price hfloat64 High price lfloat64 Low price cfloat64 Close price vbfloat64 Buy volume (USD) vsfloat64 Sell volume (USD) tbint64 Buy trade count tsint64 Sell trade count
Real-time individual trade executions. Every trade that occurs on the exchange is streamed immediately.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "trades"exchangestring Yes Exchange ID symbolstring Yes Trading pair
{
"type" : "subscribe" ,
"channel" : "trades" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd"
}
Field Type Description typestring "data"channelstring "trades"exchangestring Exchange ID symbolstring Trading pair dataTrade Trade data
{
"type" : "data" ,
"channel" : "trades" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"id" : "trades.binancef.btc/usd" ,
"data" : {
"id" : "3065401760" ,
"t" : 1704067200123 ,
"p" : 42050.00 ,
"q" : 0.5 ,
"b" : true
}
}
Field Type Description idstring Trade ID from exchange tint64 Trade timestamp (Unix milliseconds) pfloat64 Trade price qfloat64 Trade quantity (base currency) bbool Trade side (true = buy, false = sell)
Orderbook depth updates showing bid and ask levels. Works like Binance's depth stream - you receive incremental updates containing only the levels that changed.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "depth"exchangestring Yes Exchange ID symbolstring Yes Trading pair
{
"type" : "subscribe" ,
"channel" : "depth" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd"
}
Field Type Description typestring "data"channelstring "depth"exchangestring Exchange ID symbolstring Trading pair dataOrderbook Orderbook update data
{
"type" : "data" ,
"channel" : "depth" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"id" : "depth.binancef.btc/usd" ,
"data" : {
"t" : 1704067200123 ,
"a" : [[ 42001 , 1.2 ], [ 42002 , 0 ]],
"b" : [[ 42000 , 1.5 ], [ 41999 , 2.0 ]],
"lp" : 42050.00 ,
"snapshot" : false ,
"seq" : 123456
}
}
Field Type Description tint64 Timestamp (Unix milliseconds) afloat64[][] Ask updates as [price, quantity] pairs bfloat64[][] Bid updates as [price, quantity] pairs lpfloat64 Last traded price snapshotbool Whether this message is a full snapshot seqint64 Orderbook sequence number
Messages contain only the levels that changed since the last update. Maintain local orderbook state and apply updates:
quantity > 0 : Set or update the level at that price
quantity = 0 : Remove the level at that price
// Local orderbook state
const orderbook = {
asks: new Map (), // price -> quantity
bids: new Map (), // price -> quantity
lastPrice: 0
};
ws. onmessage = ( event ) => {
const msg = JSON . parse (event.data);
if (msg.channel === 'depth' ) {
// Apply ask updates
for ( const [ price , qty ] of msg.data.a) {
if (qty === 0 ) {
orderbook.asks. delete (price);
} else {
orderbook.asks. set (price, qty);
}
}
// Apply bid updates
for ( const [ price , qty ] of msg.data.b) {
if (qty === 0 ) {
orderbook.bids. delete (price);
} else {
orderbook.bids. set (price, qty);
}
}
orderbook.lastPrice = msg.data.lp;
}
};
Full orderbook snapshots are sent every ~60 seconds as a consistency checkpoint. Snapshots contain all levels currently in the book. You can identify a snapshot by the larger number of levels compared to regular updates.
After reconnection: Clear your local orderbook state and rebuild from incoming messages. The first message after subscribing will help establish state, and periodic snapshots ensure consistency.
Market statistics including funding rates, liquidations, orderbook depth metrics, and TPS (trades per second).
Field Type Required Description typestring Yes "subscribe"channelstring Yes "stats"exchangestring Yes Exchange ID. For aggregated stats, use colon-separated, unique, alphabetically ordered IDs (e.g., "binancef:bybitf"). Invalid aggregate strings return INVALID_EXCHANGE. symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "stats" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Aggregated stats subscription example:
{
"type" : "subscribe" ,
"channel" : "stats" ,
"exchange" : "binancef:bybitf" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Field Type Description typestring "data"channelstring "stats"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe (e.g., "1m", "5m", "1h") dataStat Statistics data
{
"type" : "data" ,
"channel" : "stats" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "stats.binancef.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"mp" : 42050.00 ,
"lp" : 42100.00 ,
"fr" : 0.0001 ,
"lb" : 50000.00 ,
"ls" : 75000.00 ,
"tlb" : 15 ,
"tls" : 22 ,
"vb" : 1500000.00 ,
"vs" : 1400000.00 ,
"tb" : 1250 ,
"ts" : 1180 ,
"sk" : [ 0.15 , 0.22 , 0.18 ],
"as" : [ 500000 , 1500000 , 5000000 ],
"bs" : [ 600000 , 1800000 , 5500000 ],
"mxt" : 250 ,
"mnt" : 10 ,
"avt" : 85.5 ,
"it" : 95
}
}
Field Type Description tint64 Timestamp (Unix seconds) mpfloat64 Mark price (0 when mark price is unavailable or on aggregated stats streams) lpfloat64 Last traded price frfloat64 Funding rate (0 on aggregated stats streams) lbfloat64 Liquidation buy volume (USD) lsfloat64 Liquidation sell volume (USD) tlbint64 Liquidation buy count tlsint64 Liquidation sell count vbfloat64 Buy volume (USD) vsfloat64 Sell volume (USD) tbint64 Buy trade count tsint64 Sell trade count skfloat64[] Orderbook skews at depth levels asfloat64[] Ask depth sums (USD) at levels bsfloat64[] Bid depth sums (USD) at levels mxtint64 Maximum TPS in period mntint64 Minimum TPS in period avtfloat64 Average TPS in period itint64 Instantaneous TPS
For aggregated stats streams, mp and fr are 0 by design.
Open interest OHLC candles for futures and perpetual markets. Tracks changes in open interest over time.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "oi"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "oi" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Field Type Description typestring "data"channelstring "oi"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe (e.g., "1m", "5m", "1h") dataOHLC Open interest OHLC data
{
"type" : "data" ,
"channel" : "oi" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "oi.binancef.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"o" : 5000000000 ,
"h" : 5100000000 ,
"l" : 4950000000 ,
"c" : 5050000000 ,
"n" : 60
}
}
Field Type Description tint64 Candle timestamp (Unix seconds) ofloat64 Open value (USD) hfloat64 High value (USD) lfloat64 Low value (USD) cfloat64 Close value (USD) nint64 Sample count
Volume delta (buying vs selling pressure) OHLC candles, segmented by trade size buckets. Useful for analyzing institutional vs retail activity.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "vd"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m") bucketint Yes Bucket group (1-11)
{
"type" : "subscribe" ,
"channel" : "vd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"bucket" : 1
}
Bucket Trade Size Range (USD) 1 All trades 2 $1 - $1,000 3 $1,000 - $10,000 4 $10,000 - $25,000 5 $25,000 - $50,000 6 $50,000 - $100,000 7 $100,000 - $250,000 8 $250,000 - $500,000 9 $500,000 - $1,000,000 10 $1,000,000 - $5,000,000 11 $5,000,000+
Field Type Description typestring "data"channelstring "vd"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe (e.g., "1m", "5m", "1h") dataOHLC Volume delta OHLC data
{
"type" : "data" ,
"channel" : "vd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "vd.binancef.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"o" : 50000 ,
"h" : 150000 ,
"l" : -75000 ,
"c" : 100000 ,
"n" : 847
}
}
Field Type Description tint64 Candle timestamp (Unix seconds) ofloat64 Open delta (USD) - positive = net buying hfloat64 High delta (USD) lfloat64 Low delta (USD) cfloat64 Close delta (USD) nint64 Trade count in bucket
Volume delta is calculated as buy_volume - sell_volume. Positive values indicate net buying pressure, negative values indicate net selling pressure.
Volume profile data showing buy/sell volumes at price levels.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "volumes"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "volumes" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Field Type Description typestring "data"channelstring "volumes"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe dataVolume Volume profile data
{
"type" : "data" ,
"channel" : "volumes" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "volumes.binancef.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"p" : [ 41900 , 41950 , 42000 , 42050 , 42100 ],
"b" : [ 50000 , 75000 , 120000 , 80000 , 45000 ],
"s" : [ 45000 , 60000 , 100000 , 90000 , 55000 ],
"pg" : 50
}
}
Field Type Description tint64 Timestamp (Unix seconds) pfloat64[] Price levels bfloat64[] Buy volumes at each price (USD) sfloat64[] Sell volumes at each price (USD) pgfloat64 Price grouping/bucket size
Standard density orderbook heatmap data.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "heatmap_sd"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "heatmap_sd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Field Type Description typestring "data"channelstring "heatmap_sd"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe dataHeatmap Heatmap data
{
"type" : "data" ,
"channel" : "heatmap_sd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "heatmap_sd.binancef.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"pg" : 10 ,
"p" : [ 41500 , 41510 , 41520 , 41530 , 41540 ],
"s" : [ 100000 , 250000 , 500000 , 300000 , 150000 ],
"si" : 50 ,
"lp" : 42050.00 ,
"minp" : 41500.00 ,
"maxp" : 42500.00 ,
"mins" : 10000 ,
"maxs" : 1000000
}
}
Field Type Description tint64 Timestamp (Unix seconds) pgfloat64 Price grouping/bucket size pfloat64[] Price levels sfloat64[] Sizes at each price level siint64 Split index (divides asks and bids in the arrays) lpfloat64 Last traded price minpfloat64 Minimum price in range maxpfloat64 Maximum price in range minsfloat64 Minimum size value maxsfloat64 Maximum size value
High density orderbook heatmap data with finer price granularity.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "heatmap_hd"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "heatmap_hd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Same format as heatmap_sd but with higher density price levels.
Real-time liquidation events from the exchange.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "liquidations"exchangestring Yes Exchange ID symbolstring Yes Trading pair
{
"type" : "subscribe" ,
"channel" : "liquidations" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd"
}
Field Type Description typestring "data"channelstring "liquidations"exchangestring Exchange ID symbolstring Trading pair dataLiquidation Liquidation event data
{
"type" : "data" ,
"channel" : "liquidations" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"id" : "liquidations.binancef.btc/usd" ,
"data" : {
"t" : 1704067200123 ,
"p" : 42050.00 ,
"q" : 1.5 ,
"s" : "sell"
}
}
Field Type Description tint64 Timestamp (Unix milliseconds) pfloat64 Liquidation price qfloat64 Liquidation quantity sstring Side: "buy" or "sell" (the side that was liquidated)
Standard density flat heatmap data. Same data as heatmap_sd but in a flattened format optimized for rendering.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "flat_heatmap_sd"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "flat_heatmap_sd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
High density flat heatmap data. Same data as heatmap_hd but in a flattened format optimized for rendering.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "flat_heatmap_hd"exchangestring Yes Exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "flat_heatmap_hd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Stop heatmap stream in flat format.
Single-exchange only: aggregated exchange strings are not supported.
Available exchange IDs: hyperliquid, hyperliquid-xyz.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "stop_heatmap"exchangestring Yes Single exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "stop_heatmap" ,
"exchange" : "hyperliquid" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Field Type Description typestring "data"channelstring "stop_heatmap"exchangestring Exchange ID symbolstring Trading pair tfstring Timeframe dataFlatHeatmap Flat heatmap data
{
"type" : "data" ,
"channel" : "stop_heatmap" ,
"exchange" : "hyperliquid" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"id" : "stop_heatmap.hyperliquid.btc/usd.60" ,
"data" : {
"t" : 1704067200 ,
"pg" : 10 ,
"s" : [ 100000 , 250000 , 500000 , 300000 , 150000 ],
"si" : 2 ,
"lp" : 42050.0 ,
"minp" : 42000.0 ,
"maxp" : 42040.0 ,
"mins" : 100000 ,
"maxs" : 500000
}
}
Take-profit heatmap stream in flat format.
Single-exchange only: aggregated exchange strings are not supported.
Available exchange IDs: hyperliquid, hyperliquid-xyz.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "tp_heatmap"exchangestring Yes Single exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "tp_heatmap" ,
"exchange" : "hyperliquid" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Same payload format as stop_heatmap (FlatHeatmap), with channel "tp_heatmap".
Liquidation heatmap stream in flat format.
Single-exchange only: aggregated exchange strings are not supported.
Available exchange IDs: hyperliquid, hyperliquid-xyz.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "liquidation_heatmap"exchangestring Yes Single exchange ID symbolstring Yes Trading pair tfstring Yes Timeframe (e.g., "1m")
{
"type" : "subscribe" ,
"channel" : "liquidation_heatmap" ,
"exchange" : "hyperliquid" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
Same payload format as stop_heatmap (FlatHeatmap), with channel "liquidation_heatmap".
Real-time market data updates including current price, 24h price change, buy/sell volumes, and market cap information.
Field Type Required Description typestring Yes "subscribe"channelstring Yes "markets"exchangestring Yes Exchange ID symbolstring Yes Trading pair
{
"type" : "subscribe" ,
"channel" : "markets" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd"
}
Field Type Description typestring "data"channelstring "markets"exchangestring Exchange ID symbolstring Trading pair dataMarket Market data
{
"type" : "data" ,
"channel" : "markets" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"id" : "markets.binancef.btc/usd" ,
"data" : {
"t" : 1704067200 ,
"p" : 42050.00 ,
"p24" : 41500.00 ,
"pc" : 550.00 ,
"vb24" : 15000000.00 ,
"vs24" : 14500000.00 ,
"tb24" : 125000.00 ,
"ts24" : 118000.00 ,
"mc" : 820000000000 ,
"fdv" : 880000000000 ,
"cs" : 19500000 ,
"ts" : 21000000 ,
"ms" : 21000000
}
}
Field Type Description tint64 Timestamp (Unix seconds) pfloat64 Current price p24float64 Price 24 hours ago pcfloat64 Price change (last 24h) vb24float64 Buy volume last 24h (USD) vs24float64 Sell volume last 24h (USD) tb24float64 Buy trade count last 24h ts24float64 Sell trade count last 24h mcfloat64 Market cap (USD) fdvfloat64 Fully diluted valuation (USD) csfloat64 Circulating supply tsfloat64 Total supply msfloat64 Max supply
To stop receiving updates for a channel, send an unsubscribe message with the same parameters:
{
"type" : "unsubscribe" ,
"channel" : "candles" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m"
}
For channels with additional parameters (like vd), include all parameters:
{
"type" : "unsubscribe" ,
"channel" : "vd" ,
"exchange" : "binancef" ,
"symbol" : "btc/usd" ,
"tf" : "1m" ,
"bucket" : 1
}