Skip to main content

WebSocket Market Data API

Basic Info

  • The base URL for all WSS endpoints listed in this document is: wss://nbstream.binance.com/w3w/wsa/stream

Subscribe / Unsubscribe Streams in Real Time

  • You can subscribe to or unsubscribe from streams by sending messages over WebSocket. Examples are shown below.
  • The id in the request is used as a unique identifier to correlate request/response messages. The following formats are accepted:
    • 64-bit signed integer
    • Alphanumeric string; max length 36
    • null
  • If result in the corresponding response is null, it indicates the request was sent successfully.

Subscribe to a stream

Request

{
"method": "SUBSCRIBE",
"params": [
"came@allTokens@ticker24"
],
"id": 1
}

Response

{
"result": null,
"id": 1
}

Unsubscribe from a stream

Request

{
"method": "UNSUBSCRIBE",
"params": [
"came@allTokens@ticker24"
],
"id": 1
}

Response

{
"result": null,
"id": 1
}

List current subscriptions

Request

{
"method": "LIST_SUBSCRIPTION",
"id": 3
}

Response

{
"result": ["came@allTokens@ticker24"],
"id": 3
}

Streams

came@allTokens@ticker24

{
"data": {
"d": [
{
"ca": "0x8fce7206e3043dd360f115afa956ee31b90b787c@56", // Contract address@Chain ID
"cnt24": 10426, // Number of trades in the last 24h
"fdv": "72834145.18711072", // Fully Diluted Valuation (FDV)
"hc": "6822", // Number of holders
"liq": "1442996.98151177662835", // Liquidity
"mc": "13542034.24008014", // Market cap
"p": "0.072849536538593663", // Current price
"pc24": "-2.32", // 24h price change %
"s": "1",
"t": 1771825733000, // Timestamp (ms)
"vol24": "12930712.213702157742688594285" // 24h volume
}
],
"e": "tickerList"
},
"stream": "came@allTokens@ticker24"
}

<symbol>@aggTrade

{
"data": {
"E": 1771828569861, // Event time (ms)
"T": 1771828569702, // Trade time (ms)
"a": 2684294, // Aggregated trade ID
"e": "aggTrade", // Event type
"f": 2684294, // First trade ID in the aggregation
"l": 2684294, // Last trade ID in the aggregation
"m": false, // Is the buyer the market maker
"p": "0.08530000", // Price
"q": "879.24000000", // Quantity
"s": "ALPHA_474USDT" // Symbol
},
"stream": "alpha_474usdt@aggTrade"
}

<symbol>@fulldepth@<interval>

interval: 0ms, 100ms, 500ms
This stream returns all available depth, which includes UI and API orders.

{
"data": {
"E": 1771828614381, // Event time (ms)
"T": 1771828614258, // Matching time (ms)
"U": 42648947917, // First updateId in this event
"a": [
["0.07680652", "0.00000000"],
["0.08529794", "0.00000000"]
],
"b": [
["0.08513788", "0.00000000"],
["0.08520502", "23.47000000"],
["0.08521196", "320.94000000"],
["0.08529880", "0.00000000"],
["0.08529885", "0.00000000"]
],
"e": "depthUpdate",
"pu": 42648947321, // Previous updateId from the last push
"s": "ALPHA_474USDT",
"u": 42648948229 // Last updateId in this event
},
"stream": "alpha_474usdt@fulldepth@500ms"
}

came@contractAddress@chainId@kline_<interval>

interval: 1s, 1m, 5m, 15m, 1h, 4h, 1d

{
"data": {
"ca": "G7vQWurMkMMm2dU3iZpXYFTHT9Biio4F4gZCrwFpKNwG@CT_501", // Contract address@Chain ID
"e": "kline",
"k": {
"c": "0.15584957424118055058", // Close price
"ct": 1771828656000, // Kline close time
"h": "0.15584957424118055058", // High price
"i": "1s", // Interval
"l": "0.15584372258086979622", // Low price
"o": "0.15584372258086979622", // Open price
"ot": 1771828655000, // Kline open time
"v": "2.8584092999332775480" // Volume
}
},
"stream": "came@G7vQWurMkMMm2dU3iZpXYFTHT9Biio4F4gZCrwFpKNwG@CT_501@kline_1s"
}

<symbol>@bookTicker

{
"data": {
"A": "2.00353200", // ask1Quantity
"B": "0.91076900", // bid1Quantity
"E": 1773108379067, // eventTime
"T": 1773108379054, // transactionTime
"a": "9.30000000", // ask1Price
"b": "8.30000000", // bid1Price
"e": "bookTicker", // eventType
"s": "ALPHA_116USDT", // symbol
"u": 6663207693 // updateId
},
"stream": "alpha_116usdt@bookTicker"
}

!bookTicker

{
"data": {
"A": "2.00353200", // ask1Quantity
"B": "0.91076900", // bid1Quantity
"E": 1773108379067, // eventTime
"T": 1773108379054, // transactionTime
"a": "9.30000000", // ask1Price
"b": "8.30000000", // bid1Price
"e": "bookTicker", // eventType
"s": "ALPHA_116USDT", // symbol
"u": 6663207693 // updateId
},
"stream": "!bookTicker"
}

<symbol>@miniTicker

{
"data": {
"E": 1773109449908, // eventTime
"c": "8.40000000", // closePrice
"e": "24hrMiniTicker", // eventType
"h": "8.50000000", // highPrice
"l": "8.30000000", // lowPrice
"o": "8.40000000", // openPrice
"q": "543810.36005090", // quoteVolume
"s": "ALPHA_116USDT", // symbol
"v": "64739.03978900" // volume
},
"stream": "alpha_116usdt@miniTicker"
}

!miniTicker@arr

{
"data": {
"E": 1773109449908, // eventTime
"c": "8.40000000", // closePrice
"e": "24hrMiniTicker", // eventType
"h": "8.50000000", // highPrice
"l": "8.30000000", // lowPrice
"o": "8.40000000", // openPrice
"q": "543810.36005090", // quoteVolume
"s": "ALPHA_116USDT", // symbol
"v": "64739.03978900" // volume
},
"stream": "!miniTicker@arr"
}

<symbol>@ticker

{
"data": {
"C": 1773109631555, // endTime
"E": 1773109631569, // eventTime
"F": 19847634, // firstTradeId
"L": 19911287, // lastTradeId
"O": 1773023220000, // startTime
"P": "0.00", // priceChangePercent
"Q": "0.49293200", // lastTradeVolume
"c": "8.40000000", // closePrice
"e": "24hrTicker", // eventType
"h": "8.50000000", // highPrice
"l": "8.30000000", // lowPrice
"n": 217505, // tradeNum
"o": "8.40000000", // openPrice
"p": "0.00000000", // priceChange
"q": "543907.35169250", // quoteVolume
"s": "ALPHA_116USDT", // symbol
"v": "64750.63418500", // volume
"w": "8.40003127" // averagePrice
},
"stream": "alpha_116usdt@ticker"
}

!ticker@arr

{
"data": {
"C": 1773109631555, // endTime
"E": 1773109631569, // eventTime
"F": 19847634, // firstTradeId
"L": 19911287, // lastTradeId
"O": 1773023220000, // startTime
"P": "0.00", // priceChangePercent
"Q": "0.49293200", // lastTradeVolume
"c": "8.40000000", // closePrice
"e": "24hrTicker", // eventType
"h": "8.50000000", // highPrice
"l": "8.30000000", // lowPrice
"n": 217505, // tradeNum
"o": "8.40000000", // openPrice
"p": "0.00000000", // priceChange
"q": "543907.35169250", // quoteVolume
"s": "ALPHA_116USDT", // symbol
"v": "64750.63418500", // volume
"w": "8.40003127" // averagePrice
},
"stream": "!ticker@arr"
}

<symbol>@trade

{
"data": {
"E": 1773110023891, // eventTime
"T": 1773110023877, // tradeTime
"e": "trade", // eventType
"m": false, // isBuyerMaker
"p": "8.40000000", // fillPrice
"q": "0.97915700", // fillQty
"s": "ALPHA_116USDT", // symbol
"t": 19911650 // tradeId
},
"stream": "alpha_116usdt@trade"
}

<symbol>@depth<levels>@<interval>

levels: optional, available values: [5, 10, 20]
interval: optional, available values: [0ms, 100ms, 500ms]
Please note that only UI orders will be shown.

{
"data": {
"E": 1773110222878, // eventTime
"T": 1773110222767, // transactionTime
"U": 6663367135, // firstUpdateId
"a": [
[
"8.30000000", // price
"8.02776700" // qty
]
],
"b": [
[
"8.40000000", // price
"1266.84789600" // qty
]
],
"e": "depthUpdate", // eventType
"pu": 6663366971, // previousUpdateId
"s": "ALPHA_116USDT", // symbol
"u": 6663367147 // lastUpdateId
},
"stream": "alpha_116usdt@depth"
}

<symbol>@kline_<interval>

available values: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]

{
"data": {
"E": 1773111055144, // eventTime
"e": "kline", // eventType
"k": {
"B": "0", // ignore
"L": 19912765, // lastTradeId
"Q": "534.64960920", // takerBuyQuoteAssetVolume
"T": 1773111059999, // endTime
"V": "63.64876300", // takerBuyBaseAssetVolume
"c": "8.40000000", // closePrice
"f": 19912696, // firstTradeId
"h": "8.40000000", // highPrice
"i": "1m", // interval
"l": "8.40000000", // lowPrice
"n": 218, // tradeNum
"o": "8.40000000", // openPrice
"q": "534.64960920", // quoteAssetVolume
"s": "ALPHA_116USDT", // symbol
"t": 1773111000000, // startTime
"v": "63.64876300", // volume
"x": false // klineComplete
},
"s": "ALPHA_116USDT" // symbol
},
"stream": "alpha_116usdt@kline_1m"
}