WebSocket Streams — General Info
The Stocks Trading module ships real-time market and user data over WebSocket. All streams are one-way push (server → client); there is no subscribe/unsubscribe RPC — the stream name is encoded in the URL path.
Base URL
| Environment | Base URL |
|---|---|
| Production | wss://nbstream.binance.com/equity |
The production base URL shares the standard Binance stream domain. Use the /ws/<streamName> and
/stream?streams=<A>/<B>/<C> suffixes described below.
Single Stream
Connect to a single stream by appending the stream name to /ws/:
Code
The server pushes raw event payloads directly — no stream-name wrapper:
Code
Combined Stream
Connect to multiple streams on a single socket by joining them with / under /stream?streams=:
Code
Each event is wrapped in an envelope that tells you which stream it came from:
Code
Stream Name Rules
| Stream | Format | Casing | Example |
|---|---|---|---|
| Price (all symbols) | price | lowercase fixed | price |
| Quote (per symbol) | {SYMBOL}@quote | SYMBOL UPPERCASE | AAPL@quote |
| Kline (per symbol + interval) | {SYMBOL}@kline_{interval} | SYMBOL UPPERCASE | AAPL@kline_5m |
| Market calendar | calendar | lowercase fixed | calendar |
| Trading status (per symbol) | {SYMBOL}@tradingStatus | SYMBOL UPPERCASE | AAPL@tradingStatus |
| Tradability (per symbol) | {SYMBOL}@tradability | SYMBOL UPPERCASE | AAPL@tradability |
| Order report (per user) | {listenKey}@orderReport | listenKey as issued | pqia91ma19a5s61cv6a81va65...@orderReport |
SYMBOL is always the bare US-equity ticker in UPPERCASE (AAPL, NVDA, SPY), matching the
module-level symbol format.
Kline Intervals
| Interval | Stream suffix |
|---|---|
| 5 minutes | kline_5m |
| 1 hour | kline_1h |
| 1 day | kline_1d |
| 1 week | kline_1w |
| 1 month | kline_1M |
1Min is not published over WebSocket.
Event Type Field
Every payload carries an e field identifying the event. Callers fan out by e:
e value | Document |
|---|---|
price | Price Stream |
quote | Quote Stream |
kline | Kline Stream |
calendar | Calendar Stream |
tradingStatus | Trading Status Stream |
tradability | Tradability Stream |
orderReport | Order Report Stream |
Timestamps
All t / T / E / time / ts fields are epoch milliseconds UTC.
Authentication
| Stream type | Requires authentication? |
|---|---|
price, *@quote, *@kline_*, calendar, *@tradingStatus, *@tradability | No — public market data |
{listenKey}@orderReport | Yes — obtain the listenKey via Listen Key. The WebSocket URL itself carries no signature; authentication is the presence of the listenKey in the stream name |
Heartbeat & Connection Lifecycle
The server sends standard WebSocket PING frames; clients MUST reply with PONG. Connections idle
for extended periods may be closed — callers should reconnect and resubscribe on close.
For orderReport: if the underlying listenKey expires (the user stops renewing it via the Listen
Key endpoint), the stream will stop pushing. Renew the listenKey before its 60-minute TTL to keep
the stream alive.