API websocket endpoints

Methods

account(optionsopt)

Account information< br>

Query information about your account.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

aggTrade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams

Parameters:
NameTypeDescription
symbolstring

aggTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>

avgPrice(symbol)

Current average price < br>

Get current average price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-average-price

Parameters:
NameTypeDescription
symbolstring

bookTicker(symbolopt)

Individual symbol or all symbols book ticker

Pushes any update to the best bid or ask's price or quantity in real-time.

Stream Name: <symbol>@bookTicker or !bookTicker
Update Speed: Real-time

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream

Parameters:
NameTypeAttributesDescription
symbolstring<optional>

cancelOCOOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
newClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

cancelOpenOrders(symbol, optionsopt)

Cancel open orders< br>

Cancel all open orders on a symbol, including OCO orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-open-orders-trade

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

cancelOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
newClientOrderIdstring<optional>
recvWindownumber<optional>

cancelReplaceOrder(symbol, cancelReplaceMode, side, type, optionsopt)

Cancel and replace order< br>

Cancel an existing order and immediately place a new order instead of the canceled one.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-and-replace-order-trade

Parameters:
NameTypeAttributesDescription
symbolstring
cancelReplaceModestring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
cancelOrderIdnumber<optional>
cancelOrigClientOrderIdstring<optional>
cancelNewClientOrderIdstring<optional>
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypestring<optional>
selfTradePreventionModestring<optional>
cancelRestrictionsstring<optional>
recvWindownumber<optional>

diffBookDepth(symbol, speed)

Diff. Depth Stream

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

Stream Names: <symbol>@depth or <symbol>@depth@100ms
Update Speed: 1000ms or 100ms

https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream

Parameters:
NameTypeDescription
symbolstring
speedstring

1000ms or 100ms

exchangeInfo(optionsopt)

Exchange information< br>

Query current exchange trading rules, rate limits, and symbol information.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolsstring | array<optional>
permissionsstring | array<optional>

https://binance-docs.github.io/apidocs/websocket_api/en/#exchange-information

getOCOOpenOrders(optionsopt)

Current open OCOs < br>

Query execution status of all open OCOs.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-ocos-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

getOCOOrder(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
origClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

getOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
recvWindownumber<optional>

historicalTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>

kline(symbol, interval)

Kline/Candlestick Streams

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

Stream Name: <symbol>@kline_<interval>
Update Speed: 2000ms

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams

Parameters:
NameTypeDescription
symbolstring
intervalstring

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

klines(symbol, interval, optionsopt)

Klines < br>

Get klines (candlestick bars).

https://binance-docs.github.io/apidocs/websocket_api/en/#klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

miniTicker(symbolopt)

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 !miniTicker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

myTrades(symbolopt, optionsopt)

Account trade history< br>

Query information about all your trades, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
fromIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

newOCOOrder(symbol, side, price, quantity, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
pricenumber
quantitynumber
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
limitClientOrderIdstring<optional>
limitIcebergQtynumber<optional>
limitStrategyIdnumber<optional>
limitStrategyTypenumber<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
stopClientOrderIdnumber<optional>
stopLimitPricenumber<optional>
stopLimitTimeInForcestring<optional>
stopIcebergQtynumber<optional>
stopStrategyIdnumber<optional>
stopStrategyTypestring<optional>
newOrderRespTypenumber<optional>
selfTradePreventionModenumber<optional>
recvWindownumber<optional>

newOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ocoOrderHistory(optionsopt)

Account OCO history< br>

Query information about all your OCOs, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-oco-history-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

openOrders(symbol, optionsopt)

Current open orders< br>

Query execution status of all open orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderHistory(symbol, optionsopt)

Account order history< br>

Query information about all your orders – active, canceled, filled – filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

orderLimit(optionsopt)

Account order rate limits< br>

Query your current order rate limit.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-rate-limits-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderbook(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

partialBookDepth(symbol, levels, speed)

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

https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams

Parameters:
NameTypeDescription
symbolstring
levelsstring

5, 10, or 20

speedstring

1000ms or 100ms

ping()

Test connectivity< br>

Test connectivity to the WebSocket API.

https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity

pingUserDataStream(listenKey)

Ping user data stream.< br>

Ping a user data stream to keep it alive.

https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream

Parameters:
NameTypeDescription
listenKeystring

preventedMatches(symbolopt, optionsopt)

Account prevented matches< br>

Displays the list of orders that were expired because of STP trigger.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-prevented-matches-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
preventedMatchIdnumber<optional>
orderIdnumber<optional>
fromPreventedMatchIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

rollingWindowTicker(windowSizeopt, symbolopt)

Individual symbol or all rolling window statistics ticker

Rolling window ticker statistics, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size> or !ticker_<window_size>@arr
Window Sizes: 1h,4h
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>.

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams

Parameters:
NameTypeAttributesDefaultDescription
windowSizestring<optional>
symbolstring<optional>
null

startUserDataStream()

stopUserDataStream()

Stop user data stream.< br>

Explicitly stop and close the user data stream.

https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream

testNewOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ticker(symbolopt)

Individual symbol or all symbols ticker

24hr rollwing 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 !ticker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

ticker(optionsopt)

Rolling window price change statistics < br>

Get rolling window price change statistics with a custom window.

https://binance-docs.github.io/apidocs/websocket_api/en/#rolling-window-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

ticker24hr(optionsopt)

24hr ticker price change statistics < br>

Get 24-hour rolling window price change statistics.

https://binance-docs.github.io/apidocs/websocket_api/en/#24hr-ticker-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

tickerBook(optionsopt)

Symbol order book ticker < br>

Get the current best price and quantity on the order book.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-order-book-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

tickerPrice(optionsopt)

Symbol price ticker < br>

Get the latest market price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-price-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

time()

Check server time< br>

Test connectivity to the WebSocket API and get the current server time.

https://binance-docs.github.io/apidocs/websocket_api/en/#check-server-time

trade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#trade-streams

Parameters:
NameTypeDescription
symbolstring

trades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

uiKlines(symbol, interval, optionsopt)

UI Klines < br>

Get klines (candlestick bars) optimized for presentation.

https://binance-docs.github.io/apidocs/websocket_api/en/#ui-klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

userData(listenKey)

Parameters:
NameTypeDescription
listenKeystring

Websocket API Account endpoints

Methods

account(optionsopt)

Account information< br>

Query information about your account.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

aggTrade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams

Parameters:
NameTypeDescription
symbolstring

aggTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>

avgPrice(symbol)

Current average price < br>

Get current average price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-average-price

Parameters:
NameTypeDescription
symbolstring

bookTicker(symbolopt)

Individual symbol or all symbols book ticker

Pushes any update to the best bid or ask's price or quantity in real-time.

Stream Name: <symbol>@bookTicker or !bookTicker
Update Speed: Real-time

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream

Parameters:
NameTypeAttributesDescription
symbolstring<optional>

cancelOCOOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
newClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

cancelOpenOrders(symbol, optionsopt)

Cancel open orders< br>

Cancel all open orders on a symbol, including OCO orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-open-orders-trade

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

cancelOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
newClientOrderIdstring<optional>
recvWindownumber<optional>

cancelReplaceOrder(symbol, cancelReplaceMode, side, type, optionsopt)

Cancel and replace order< br>

Cancel an existing order and immediately place a new order instead of the canceled one.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-and-replace-order-trade

Parameters:
NameTypeAttributesDescription
symbolstring
cancelReplaceModestring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
cancelOrderIdnumber<optional>
cancelOrigClientOrderIdstring<optional>
cancelNewClientOrderIdstring<optional>
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypestring<optional>
selfTradePreventionModestring<optional>
cancelRestrictionsstring<optional>
recvWindownumber<optional>

diffBookDepth(symbol, speed)

Diff. Depth Stream

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

Stream Names: <symbol>@depth or <symbol>@depth@100ms
Update Speed: 1000ms or 100ms

https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream

Parameters:
NameTypeDescription
symbolstring
speedstring

1000ms or 100ms

exchangeInfo(optionsopt)

Exchange information< br>

Query current exchange trading rules, rate limits, and symbol information.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolsstring | array<optional>
permissionsstring | array<optional>

https://binance-docs.github.io/apidocs/websocket_api/en/#exchange-information

getOCOOpenOrders(optionsopt)

Current open OCOs < br>

Query execution status of all open OCOs.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-ocos-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

getOCOOrder(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
origClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

getOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
recvWindownumber<optional>

historicalTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>

kline(symbol, interval)

Kline/Candlestick Streams

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

Stream Name: <symbol>@kline_<interval>
Update Speed: 2000ms

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams

Parameters:
NameTypeDescription
symbolstring
intervalstring

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

klines(symbol, interval, optionsopt)

Klines < br>

Get klines (candlestick bars).

https://binance-docs.github.io/apidocs/websocket_api/en/#klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

miniTicker(symbolopt)

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 !miniTicker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

myTrades(symbolopt, optionsopt)

Account trade history< br>

Query information about all your trades, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
fromIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

newOCOOrder(symbol, side, price, quantity, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
pricenumber
quantitynumber
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
limitClientOrderIdstring<optional>
limitIcebergQtynumber<optional>
limitStrategyIdnumber<optional>
limitStrategyTypenumber<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
stopClientOrderIdnumber<optional>
stopLimitPricenumber<optional>
stopLimitTimeInForcestring<optional>
stopIcebergQtynumber<optional>
stopStrategyIdnumber<optional>
stopStrategyTypestring<optional>
newOrderRespTypenumber<optional>
selfTradePreventionModenumber<optional>
recvWindownumber<optional>

newOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ocoOrderHistory(optionsopt)

Account OCO history< br>

Query information about all your OCOs, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-oco-history-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

openOrders(symbol, optionsopt)

Current open orders< br>

Query execution status of all open orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderHistory(symbol, optionsopt)

Account order history< br>

Query information about all your orders – active, canceled, filled – filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

orderLimit(optionsopt)

Account order rate limits< br>

Query your current order rate limit.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-rate-limits-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderbook(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

partialBookDepth(symbol, levels, speed)

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

https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams

Parameters:
NameTypeDescription
symbolstring
levelsstring

5, 10, or 20

speedstring

1000ms or 100ms

ping()

Test connectivity< br>

Test connectivity to the WebSocket API.

https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity

pingUserDataStream(listenKey)

Ping user data stream.< br>

Ping a user data stream to keep it alive.

https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream

Parameters:
NameTypeDescription
listenKeystring

preventedMatches(symbolopt, optionsopt)

Account prevented matches< br>

Displays the list of orders that were expired because of STP trigger.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-prevented-matches-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
preventedMatchIdnumber<optional>
orderIdnumber<optional>
fromPreventedMatchIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

rollingWindowTicker(windowSizeopt, symbolopt)

Individual symbol or all rolling window statistics ticker

Rolling window ticker statistics, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size> or !ticker_<window_size>@arr
Window Sizes: 1h,4h
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>.

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams

Parameters:
NameTypeAttributesDefaultDescription
windowSizestring<optional>
symbolstring<optional>
null

startUserDataStream()

stopUserDataStream()

Stop user data stream.< br>

Explicitly stop and close the user data stream.

https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream

testNewOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ticker(symbolopt)

Individual symbol or all symbols ticker

24hr rollwing 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 !ticker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

ticker(optionsopt)

Rolling window price change statistics < br>

Get rolling window price change statistics with a custom window.

https://binance-docs.github.io/apidocs/websocket_api/en/#rolling-window-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

ticker24hr(optionsopt)

24hr ticker price change statistics < br>

Get 24-hour rolling window price change statistics.

https://binance-docs.github.io/apidocs/websocket_api/en/#24hr-ticker-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

tickerBook(optionsopt)

Symbol order book ticker < br>

Get the current best price and quantity on the order book.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-order-book-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

tickerPrice(optionsopt)

Symbol price ticker < br>

Get the latest market price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-price-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

time()

Check server time< br>

Test connectivity to the WebSocket API and get the current server time.

https://binance-docs.github.io/apidocs/websocket_api/en/#check-server-time

trade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#trade-streams

Parameters:
NameTypeDescription
symbolstring

trades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

uiKlines(symbol, interval, optionsopt)

UI Klines < br>

Get klines (candlestick bars) optimized for presentation.

https://binance-docs.github.io/apidocs/websocket_api/en/#ui-klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

userData(listenKey)

Parameters:
NameTypeDescription
listenKeystring

Websocket API market endpoints

Methods

account(optionsopt)

Account information< br>

Query information about your account.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

aggTrade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams

Parameters:
NameTypeDescription
symbolstring

aggTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>

avgPrice(symbol)

Current average price < br>

Get current average price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-average-price

Parameters:
NameTypeDescription
symbolstring

bookTicker(symbolopt)

Individual symbol or all symbols book ticker

Pushes any update to the best bid or ask's price or quantity in real-time.

Stream Name: <symbol>@bookTicker or !bookTicker
Update Speed: Real-time

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream

Parameters:
NameTypeAttributesDescription
symbolstring<optional>

cancelOCOOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
newClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

cancelOpenOrders(symbol, optionsopt)

Cancel open orders< br>

Cancel all open orders on a symbol, including OCO orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-open-orders-trade

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

cancelOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
newClientOrderIdstring<optional>
recvWindownumber<optional>

cancelReplaceOrder(symbol, cancelReplaceMode, side, type, optionsopt)

Cancel and replace order< br>

Cancel an existing order and immediately place a new order instead of the canceled one.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-and-replace-order-trade

Parameters:
NameTypeAttributesDescription
symbolstring
cancelReplaceModestring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
cancelOrderIdnumber<optional>
cancelOrigClientOrderIdstring<optional>
cancelNewClientOrderIdstring<optional>
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypestring<optional>
selfTradePreventionModestring<optional>
cancelRestrictionsstring<optional>
recvWindownumber<optional>

diffBookDepth(symbol, speed)

Diff. Depth Stream

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

Stream Names: <symbol>@depth or <symbol>@depth@100ms
Update Speed: 1000ms or 100ms

https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream

Parameters:
NameTypeDescription
symbolstring
speedstring

1000ms or 100ms

exchangeInfo(optionsopt)

Exchange information< br>

Query current exchange trading rules, rate limits, and symbol information.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolsstring | array<optional>
permissionsstring | array<optional>

https://binance-docs.github.io/apidocs/websocket_api/en/#exchange-information

getOCOOpenOrders(optionsopt)

Current open OCOs < br>

Query execution status of all open OCOs.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-ocos-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

getOCOOrder(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
origClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

getOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
recvWindownumber<optional>

historicalTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>

kline(symbol, interval)

Kline/Candlestick Streams

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

Stream Name: <symbol>@kline_<interval>
Update Speed: 2000ms

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams

Parameters:
NameTypeDescription
symbolstring
intervalstring

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

klines(symbol, interval, optionsopt)

Klines < br>

Get klines (candlestick bars).

https://binance-docs.github.io/apidocs/websocket_api/en/#klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

miniTicker(symbolopt)

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 !miniTicker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

myTrades(symbolopt, optionsopt)

Account trade history< br>

Query information about all your trades, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
fromIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

newOCOOrder(symbol, side, price, quantity, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
pricenumber
quantitynumber
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
limitClientOrderIdstring<optional>
limitIcebergQtynumber<optional>
limitStrategyIdnumber<optional>
limitStrategyTypenumber<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
stopClientOrderIdnumber<optional>
stopLimitPricenumber<optional>
stopLimitTimeInForcestring<optional>
stopIcebergQtynumber<optional>
stopStrategyIdnumber<optional>
stopStrategyTypestring<optional>
newOrderRespTypenumber<optional>
selfTradePreventionModenumber<optional>
recvWindownumber<optional>

newOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ocoOrderHistory(optionsopt)

Account OCO history< br>

Query information about all your OCOs, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-oco-history-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

openOrders(symbol, optionsopt)

Current open orders< br>

Query execution status of all open orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderHistory(symbol, optionsopt)

Account order history< br>

Query information about all your orders – active, canceled, filled – filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

orderLimit(optionsopt)

Account order rate limits< br>

Query your current order rate limit.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-rate-limits-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderbook(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

partialBookDepth(symbol, levels, speed)

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

https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams

Parameters:
NameTypeDescription
symbolstring
levelsstring

5, 10, or 20

speedstring

1000ms or 100ms

ping()

Test connectivity< br>

Test connectivity to the WebSocket API.

https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity

pingUserDataStream(listenKey)

Ping user data stream.< br>

Ping a user data stream to keep it alive.

https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream

Parameters:
NameTypeDescription
listenKeystring

preventedMatches(symbolopt, optionsopt)

Account prevented matches< br>

Displays the list of orders that were expired because of STP trigger.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-prevented-matches-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
preventedMatchIdnumber<optional>
orderIdnumber<optional>
fromPreventedMatchIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

rollingWindowTicker(windowSizeopt, symbolopt)

Individual symbol or all rolling window statistics ticker

Rolling window ticker statistics, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size> or !ticker_<window_size>@arr
Window Sizes: 1h,4h
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>.

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams

Parameters:
NameTypeAttributesDefaultDescription
windowSizestring<optional>
symbolstring<optional>
null

startUserDataStream()

stopUserDataStream()

Stop user data stream.< br>

Explicitly stop and close the user data stream.

https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream

testNewOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ticker(symbolopt)

Individual symbol or all symbols ticker

24hr rollwing 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 !ticker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

ticker(optionsopt)

Rolling window price change statistics < br>

Get rolling window price change statistics with a custom window.

https://binance-docs.github.io/apidocs/websocket_api/en/#rolling-window-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

ticker24hr(optionsopt)

24hr ticker price change statistics < br>

Get 24-hour rolling window price change statistics.

https://binance-docs.github.io/apidocs/websocket_api/en/#24hr-ticker-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

tickerBook(optionsopt)

Symbol order book ticker < br>

Get the current best price and quantity on the order book.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-order-book-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

tickerPrice(optionsopt)

Symbol price ticker < br>

Get the latest market price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-price-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

time()

Check server time< br>

Test connectivity to the WebSocket API and get the current server time.

https://binance-docs.github.io/apidocs/websocket_api/en/#check-server-time

trade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#trade-streams

Parameters:
NameTypeDescription
symbolstring

trades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

uiKlines(symbol, interval, optionsopt)

UI Klines < br>

Get klines (candlestick bars) optimized for presentation.

https://binance-docs.github.io/apidocs/websocket_api/en/#ui-klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

userData(listenKey)

Parameters:
NameTypeDescription
listenKeystring

Websocket API Trading endpoints

Methods

account(optionsopt)

Account information< br>

Query information about your account.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

aggTrade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams

Parameters:
NameTypeDescription
symbolstring

aggTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>

avgPrice(symbol)

Current average price < br>

Get current average price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-average-price

Parameters:
NameTypeDescription
symbolstring

bookTicker(symbolopt)

Individual symbol or all symbols book ticker

Pushes any update to the best bid or ask's price or quantity in real-time.

Stream Name: <symbol>@bookTicker or !bookTicker
Update Speed: Real-time

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream

Parameters:
NameTypeAttributesDescription
symbolstring<optional>

cancelOCOOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
newClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

cancelOpenOrders(symbol, optionsopt)

Cancel open orders< br>

Cancel all open orders on a symbol, including OCO orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-open-orders-trade

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

cancelOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
newClientOrderIdstring<optional>
recvWindownumber<optional>

cancelReplaceOrder(symbol, cancelReplaceMode, side, type, optionsopt)

Cancel and replace order< br>

Cancel an existing order and immediately place a new order instead of the canceled one.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-and-replace-order-trade

Parameters:
NameTypeAttributesDescription
symbolstring
cancelReplaceModestring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
cancelOrderIdnumber<optional>
cancelOrigClientOrderIdstring<optional>
cancelNewClientOrderIdstring<optional>
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypestring<optional>
selfTradePreventionModestring<optional>
cancelRestrictionsstring<optional>
recvWindownumber<optional>

diffBookDepth(symbol, speed)

Diff. Depth Stream

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

Stream Names: <symbol>@depth or <symbol>@depth@100ms
Update Speed: 1000ms or 100ms

https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream

Parameters:
NameTypeDescription
symbolstring
speedstring

1000ms or 100ms

exchangeInfo(optionsopt)

Exchange information< br>

Query current exchange trading rules, rate limits, and symbol information.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolsstring | array<optional>
permissionsstring | array<optional>

https://binance-docs.github.io/apidocs/websocket_api/en/#exchange-information

getOCOOpenOrders(optionsopt)

Current open OCOs < br>

Query execution status of all open OCOs.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-ocos-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

getOCOOrder(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
origClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

getOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
recvWindownumber<optional>

historicalTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>

kline(symbol, interval)

Kline/Candlestick Streams

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

Stream Name: <symbol>@kline_<interval>
Update Speed: 2000ms

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams

Parameters:
NameTypeDescription
symbolstring
intervalstring

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

klines(symbol, interval, optionsopt)

Klines < br>

Get klines (candlestick bars).

https://binance-docs.github.io/apidocs/websocket_api/en/#klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

miniTicker(symbolopt)

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 !miniTicker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

myTrades(symbolopt, optionsopt)

Account trade history< br>

Query information about all your trades, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
fromIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

newOCOOrder(symbol, side, price, quantity, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
pricenumber
quantitynumber
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
limitClientOrderIdstring<optional>
limitIcebergQtynumber<optional>
limitStrategyIdnumber<optional>
limitStrategyTypenumber<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
stopClientOrderIdnumber<optional>
stopLimitPricenumber<optional>
stopLimitTimeInForcestring<optional>
stopIcebergQtynumber<optional>
stopStrategyIdnumber<optional>
stopStrategyTypestring<optional>
newOrderRespTypenumber<optional>
selfTradePreventionModenumber<optional>
recvWindownumber<optional>

newOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ocoOrderHistory(optionsopt)

Account OCO history< br>

Query information about all your OCOs, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-oco-history-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

openOrders(symbol, optionsopt)

Current open orders< br>

Query execution status of all open orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderHistory(symbol, optionsopt)

Account order history< br>

Query information about all your orders – active, canceled, filled – filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

orderLimit(optionsopt)

Account order rate limits< br>

Query your current order rate limit.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-rate-limits-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderbook(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

partialBookDepth(symbol, levels, speed)

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

https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams

Parameters:
NameTypeDescription
symbolstring
levelsstring

5, 10, or 20

speedstring

1000ms or 100ms

ping()

Test connectivity< br>

Test connectivity to the WebSocket API.

https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity

pingUserDataStream(listenKey)

Ping user data stream.< br>

Ping a user data stream to keep it alive.

https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream

Parameters:
NameTypeDescription
listenKeystring

preventedMatches(symbolopt, optionsopt)

Account prevented matches< br>

Displays the list of orders that were expired because of STP trigger.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-prevented-matches-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
preventedMatchIdnumber<optional>
orderIdnumber<optional>
fromPreventedMatchIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

rollingWindowTicker(windowSizeopt, symbolopt)

Individual symbol or all rolling window statistics ticker

Rolling window ticker statistics, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size> or !ticker_<window_size>@arr
Window Sizes: 1h,4h
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>.

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams

Parameters:
NameTypeAttributesDefaultDescription
windowSizestring<optional>
symbolstring<optional>
null

startUserDataStream()

stopUserDataStream()

Stop user data stream.< br>

Explicitly stop and close the user data stream.

https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream

testNewOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ticker(symbolopt)

Individual symbol or all symbols ticker

24hr rollwing 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 !ticker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

ticker(optionsopt)

Rolling window price change statistics < br>

Get rolling window price change statistics with a custom window.

https://binance-docs.github.io/apidocs/websocket_api/en/#rolling-window-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

ticker24hr(optionsopt)

24hr ticker price change statistics < br>

Get 24-hour rolling window price change statistics.

https://binance-docs.github.io/apidocs/websocket_api/en/#24hr-ticker-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

tickerBook(optionsopt)

Symbol order book ticker < br>

Get the current best price and quantity on the order book.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-order-book-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

tickerPrice(optionsopt)

Symbol price ticker < br>

Get the latest market price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-price-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

time()

Check server time< br>

Test connectivity to the WebSocket API and get the current server time.

https://binance-docs.github.io/apidocs/websocket_api/en/#check-server-time

trade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#trade-streams

Parameters:
NameTypeDescription
symbolstring

trades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

uiKlines(symbol, interval, optionsopt)

UI Klines < br>

Get klines (candlestick bars) optimized for presentation.

https://binance-docs.github.io/apidocs/websocket_api/en/#ui-klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

userData(listenKey)

Parameters:
NameTypeDescription
listenKeystring

Websocket API user data stream endpoints

Methods

account(optionsopt)

Account information< br>

Query information about your account.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

aggTrade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams

Parameters:
NameTypeDescription
symbolstring

aggTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>

avgPrice(symbol)

Current average price < br>

Get current average price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-average-price

Parameters:
NameTypeDescription
symbolstring

bookTicker(symbolopt)

Individual symbol or all symbols book ticker

Pushes any update to the best bid or ask's price or quantity in real-time.

Stream Name: <symbol>@bookTicker or !bookTicker
Update Speed: Real-time

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream

Parameters:
NameTypeAttributesDescription
symbolstring<optional>

cancelOCOOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
newClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

cancelOpenOrders(symbol, optionsopt)

Cancel open orders< br>

Cancel all open orders on a symbol, including OCO orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-open-orders-trade

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

cancelOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
newClientOrderIdstring<optional>
recvWindownumber<optional>

cancelReplaceOrder(symbol, cancelReplaceMode, side, type, optionsopt)

Cancel and replace order< br>

Cancel an existing order and immediately place a new order instead of the canceled one.

https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-and-replace-order-trade

Parameters:
NameTypeAttributesDescription
symbolstring
cancelReplaceModestring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
cancelOrderIdnumber<optional>
cancelOrigClientOrderIdstring<optional>
cancelNewClientOrderIdstring<optional>
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypestring<optional>
selfTradePreventionModestring<optional>
cancelRestrictionsstring<optional>
recvWindownumber<optional>

diffBookDepth(symbol, speed)

Diff. Depth Stream

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

Stream Names: <symbol>@depth or <symbol>@depth@100ms
Update Speed: 1000ms or 100ms

https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream

Parameters:
NameTypeDescription
symbolstring
speedstring

1000ms or 100ms

exchangeInfo(optionsopt)

Exchange information< br>

Query current exchange trading rules, rate limits, and symbol information.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolsstring | array<optional>
permissionsstring | array<optional>

https://binance-docs.github.io/apidocs/websocket_api/en/#exchange-information

getOCOOpenOrders(optionsopt)

Current open OCOs < br>

Query execution status of all open OCOs.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-ocos-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

getOCOOrder(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
origClientOrderIdstring<optional>
orderListIdnumber<optional>
recvWindownumber<optional>

getOrder(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
origClientOrderIdstring<optional>
recvWindownumber<optional>

historicalTrades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>
fromIdnumber<optional>

kline(symbol, interval)

Kline/Candlestick Streams

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

Stream Name: <symbol>@kline_<interval>
Update Speed: 2000ms

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams

Parameters:
NameTypeDescription
symbolstring
intervalstring

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

klines(symbol, interval, optionsopt)

Klines < br>

Get klines (candlestick bars).

https://binance-docs.github.io/apidocs/websocket_api/en/#klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

miniTicker(symbolopt)

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 !miniTicker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

myTrades(symbolopt, optionsopt)

Account trade history< br>

Query information about all your trades, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
fromIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

newOCOOrder(symbol, side, price, quantity, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
pricenumber
quantitynumber
optionsobject<optional>
Properties
NameTypeAttributesDescription
listClientOrderIdstring<optional>
limitClientOrderIdstring<optional>
limitIcebergQtynumber<optional>
limitStrategyIdnumber<optional>
limitStrategyTypenumber<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
stopClientOrderIdnumber<optional>
stopLimitPricenumber<optional>
stopLimitTimeInForcestring<optional>
stopIcebergQtynumber<optional>
stopStrategyIdnumber<optional>
stopStrategyTypestring<optional>
newOrderRespTypenumber<optional>
selfTradePreventionModenumber<optional>
recvWindownumber<optional>

newOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ocoOrderHistory(optionsopt)

Account OCO history< br>

Query information about all your OCOs, filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-oco-history-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
fromIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

openOrders(symbol, optionsopt)

Current open orders< br>

Query execution status of all open orders.

https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderHistory(symbol, optionsopt)

Account order history< br>

Query information about all your orders – active, canceled, filled – filtered by time range.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
orderIdnumber<optional>
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>
recvWindownumber<optional>

orderLimit(optionsopt)

Account order rate limits< br>

Query your current order rate limit.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-rate-limits-user_data

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
recvWindownumber<optional>

orderbook(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

partialBookDepth(symbol, levels, speed)

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

https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams

Parameters:
NameTypeDescription
symbolstring
levelsstring

5, 10, or 20

speedstring

1000ms or 100ms

ping()

Test connectivity< br>

Test connectivity to the WebSocket API.

https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity

pingUserDataStream(listenKey)

Ping user data stream.< br>

Ping a user data stream to keep it alive.

https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream

Parameters:
NameTypeDescription
listenKeystring

preventedMatches(symbolopt, optionsopt)

Account prevented matches< br>

Displays the list of orders that were expired because of STP trigger.

https://binance-docs.github.io/apidocs/websocket_api/en/#account-prevented-matches-user_data

Parameters:
NameTypeAttributesDescription
symbolstring<optional>
optionsobject<optional>
Properties
NameTypeAttributesDescription
preventedMatchIdnumber<optional>
orderIdnumber<optional>
fromPreventedMatchIdnumber<optional>
limitnumber<optional>
recvWindownumber<optional>

rollingWindowTicker(windowSizeopt, symbolopt)

Individual symbol or all rolling window statistics ticker

Rolling window ticker statistics, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size> or !ticker_<window_size>@arr
Window Sizes: 1h,4h
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>.

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams

Parameters:
NameTypeAttributesDefaultDescription
windowSizestring<optional>
symbolstring<optional>
null

startUserDataStream()

stopUserDataStream()

Stop user data stream.< br>

Explicitly stop and close the user data stream.

https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream

testNewOrder(symbol, side, type, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
sidestring
typestring
optionsobject<optional>
Properties
NameTypeAttributesDescription
timeInForcestring<optional>
pricenumber<optional>
quantitynumber<optional>
quoteOrderQtynumber<optional>
newClientOrderIdstring<optional>
newOrderRespTypestring<optional>
stopPricenumber<optional>
trailingDeltanumber<optional>
icebergQtynumber<optional>
strategyIdnumber<optional>
strategyTypenumber<optional>
selfTradePreventionModestring<optional>
recvWindownumber<optional>

ticker(symbolopt)

Individual symbol or all symbols ticker

24hr rollwing 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 !ticker@arr
Update Speed: 1000ms

https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream

Parameters:
NameTypeAttributesDefaultDescription
symbolstring<optional>
null

ticker(optionsopt)

Rolling window price change statistics < br>

Get rolling window price change statistics with a custom window.

https://binance-docs.github.io/apidocs/websocket_api/en/#rolling-window-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

ticker24hr(optionsopt)

24hr ticker price change statistics < br>

Get 24-hour rolling window price change statistics.

https://binance-docs.github.io/apidocs/websocket_api/en/#24hr-ticker-price-change-statistics

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>
typestring<optional>

tickerBook(optionsopt)

Symbol order book ticker < br>

Get the current best price and quantity on the order book.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-order-book-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

tickerPrice(optionsopt)

Symbol price ticker < br>

Get the latest market price for a symbol.

https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-price-ticker

Parameters:
NameTypeAttributesDescription
optionsobject<optional>
Properties
NameTypeAttributesDescription
symbolstring<optional>
symbolslist<optional>

time()

Check server time< br>

Test connectivity to the WebSocket API and get the current server time.

https://binance-docs.github.io/apidocs/websocket_api/en/#check-server-time

trade(symbol)

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

https://binance-docs.github.io/apidocs/spot/en/#trade-streams

Parameters:
NameTypeDescription
symbolstring

trades(symbol, optionsopt)

Parameters:
NameTypeAttributesDescription
symbolstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
limitnumber<optional>

uiKlines(symbol, interval, optionsopt)

UI Klines < br>

Get klines (candlestick bars) optimized for presentation.

https://binance-docs.github.io/apidocs/websocket_api/en/#ui-klines

Parameters:
NameTypeAttributesDescription
symbolstring
intervalstring
optionsobject<optional>
Properties
NameTypeAttributesDescription
startTimenumber<optional>
endTimenumber<optional>
limitnumber<optional>

userData(listenKey)

Parameters:
NameTypeDescription
listenKeystring