Spot Websocket Streams

Aggregate Trade Streams

agg_trade(self, symbol: str, id=None, action=None, **kwargs)

Aggregate Trade Streams

The Aggregate Trade Streams push trade information that is aggregated for a single taker order.

Stream Name: <symbol>@aggTrade

Update Speed: Real-time

Trade Streams

trade(self, symbol: str, id=None, action=None, **kwargs)

Trade Streams

The Trade Streams push raw trade information; each trade has a unique buyer and seller.

Stream Name: <symbol>@trade

Update Speed: Real-time

Kline/Candlestick Streams

kline(self, symbol: str, interval: str, id=None, action=None)

Kline/Candlestick Streams

The Kline/Candlestick Stream push updates to the current klines/candlestick every second.

Stream Name: <symbol>@kline_<interval>

interval: m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

  • 1m

  • 3m

  • 5m

  • 15m

  • 30m

  • 1h

  • 2h

  • 4h

  • 6h

  • 8h

  • 12h

  • 1d

  • 3d

  • 1w

  • 1M

Update Speed: 1000ms for 1s, 2000ms for the other intervals

Kline/Candlestick Streams with timezone offset

kline_timezone_offset(self, symbol: str, interval: str, id=None, action=None)

Kline/Candlestick Streams with timezone offset

The Kline/Candlestick Stream push updates to the current klines/candlestick every second in UTC+8 timezone

<symbol>@kline_<interval>@+08:00

interval: m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

  • 1m

  • 3m

  • 5m

  • 15m

  • 30m

  • 1h

  • 2h

  • 4h

  • 6h

  • 8h

  • 12h

  • 1d

  • 3d

  • 1w

  • 1M

Update Speed: 1000ms for 1s, 2000ms for the other intervals

Individual symbol or all symbols mini ticker

mini_ticker(self, symbol=None, id=None, action=None, **kwargs)

Individual symbol or all symbols mini ticker

24hr rolling window mini-ticker statistics. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs

Stream Name: <symbol>@miniTicker or Stream Name: !miniTicker@arr

Update Speed: 1000ms

Individual symbol or all symbols ticker

ticker(self, symbol=None, id=None, action=None, **kwargs)

Individual symbol or all symbols ticker

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.

Stream Name: <symbol>@ticker or Stream Name: !ticker@arr

Update Speed: 1000ms

Individual symbol or all book ticker

book_ticker(self, symbol, id=None, action=None, **kwargs)

Individual symbol book ticker

Pushes any update to the best bid or ask’s price or quantity in real-time for a specified symbol.

Stream Name: <symbol>@bookTicker

Update Speed: realtime

Individual Symbol Rolling Window Statistics Streams

rolling_window_ticker(self, symbol: str, windowSize: str, id=None, action=None)

Rolling window ticker statistics for a single symbol, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size>

Window Sizes: 1h, 4h, 1d

Update Speed: 1000ms

Note: This stream is different from the <symbol>@ticker stream. The open time “O” always starts on a minute, while the closing time “C” is the current time of the update. As such, the effective window might be up to 59999ms wider that <window_size>.

All Market Rolling Window Statistics Streams

rolling_window_ticker_all_symbols(self, windowSize: str, id=None, action=None)

All Market Rolling Window Statistics Streams

Rolling window ticker statistics for all market symbols, computed over multiple windows. Note that only tickers that have changed will be present in the array.

Stream Name: !ticker_<window-size>@arr

Window Size: 1h, 4h, 1d

Update Speed: 1000ms

Partial Book Depth Streams

partial_book_depth(self, symbol: str, level=5, speed=1000, id=None, action=None, **kwargs)

Partial Book Depth Streams

Top bids and asks, Valid are 5, 10, or 20.

Stream Names: <symbol>@depth<levels> OR <symbol>@depth<levels>@100ms.

Update Speed: 1000ms or 100ms

Diff. Depth Stream

diff_book_depth(self, symbol: str, speed=1000, id=None, action=None, **kwargs)

Diff. Depth Stream

Stream Name: <symbol>@depth OR <symbol>@depth@100ms

Update Speed: 1000ms or 100ms

Order book price and quantity depth updates used to locally manage an order book.

Listen to user data by provided listenkey

user_data(self, listen_key: str, id=None, action=None, **kwargs)

Listen to user data by using the provided listen_key