API websocket endpoints
- Source
Methods
account(optionsopt)
Account information< br>
Query information about your account.
https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
Name | Type | Description |
---|---|---|
symbol | string |
- Source
aggTrades(symbol, optionsopt)
Aggregate trades < br>
Get aggregate trades.
https://binance-docs.github.io/apidocs/websocket_api/en/#aggregate-trades
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Description |
---|---|---|
symbol | string |
- Source
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
Name | Type | Attributes | Description |
---|---|---|---|
symbol | string | <optional> |
- Source
cancelOCOOrder(symbol, optionsopt)
Query OCO< br>
Check execution status of an OCO.
https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-oco-trade
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||
options | object | <optional> | Properties
|
- Source
cancelOrder(symbol, optionsopt)
Cancel order< br>
Cancel an active order.
https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-order-trade
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cancelReplaceMode | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
side | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Description |
---|---|---|
symbol | string | |
speed | string | 1000ms or 100ms |
- Source
exchangeInfo(optionsopt)
Exchange information< br>
Query current exchange trading rules, rate limits, and symbol information.
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
getOCOOrder(optionsopt)
Query OCO< br>
Check execution status of an OCO.
https://binance-docs.github.io/apidocs/websocket_api/en/#query-oco-user_data
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
getOrder(symbol, optionsopt)
Query order< br>
Check execution status of an order.
https://binance-docs.github.io/apidocs/websocket_api/en/#query-order-user_data
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||
options | object | <optional> | Properties
|
- Source
historicalTrades(symbol, optionsopt)
Historical trades < br>
Get historical trades.
https://binance-docs.github.io/apidocs/websocket_api/en/#historical-trades-market_data
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Description |
---|---|---|
symbol | string | |
interval | string | m -> minutes; h -> hours; d -> days; w -> weeks; M -> months: |
- Source
klines(symbol, interval, optionsopt)
Klines < br>
Get klines (candlestick bars).
https://binance-docs.github.io/apidocs/websocket_api/en/#klines
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||
interval | string | ||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol | string | <optional> | null |
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | <optional> | |||||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
newOCOOrder(symbol, side, price, quantity, optionsopt)
Place new OCO< br>
Send in a new OCO order.
https://binance-docs.github.io/apidocs/websocket_api/en/#place-new-oco-trade
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
side | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
price | number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
quantity | number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
newOrder(symbol, side, type, optionsopt)
Place new order< br>
Send in a new order.
https://binance-docs.github.io/apidocs/websocket_api/en/#place-new-order-trade
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
side | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
orderbook(symbol, optionsopt)
Order book< br>
Get current order book.
https://binance-docs.github.io/apidocs/websocket_api/en/#order-book
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Description |
---|---|---|
symbol | string | |
levels | string | 5, 10, or 20 |
speed | string | 1000ms or 100ms |
- Source
ping()
Test connectivity< br>
Test connectivity to the WebSocket API.
https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity
- Source
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
Name | Type | Description |
---|---|---|
listenKey | string |
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | <optional> | |||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
windowSize | string | <optional> | ||
symbol | string | <optional> | null |
- Source
startUserDataStream()
Start a new user data stream.
https://binance-docs.github.io/apidocs/websocket_api/en/#start-user-data-stream-user_stream
- Source
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
- Source
testNewOrder(symbol, side, type, optionsopt)
Test new order< br>
Test a new order.
https://binance-docs.github.io/apidocs/websocket_api/en/#test-new-order-trade
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
side | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol | string | <optional> | null |
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
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
- Source
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
Name | Type | Description |
---|---|---|
symbol | string |
- Source
trades(symbol, optionsopt)
Recent trades< br>
Get recent trades.
https://binance-docs.github.io/apidocs/websocket_api/en/#recent-trades
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||
options | object | <optional> | Properties
|
- Source
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
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symbol | string | ||||||||||||||||||
interval | string | ||||||||||||||||||
options | object | <optional> | Properties
|
- Source
userData(listenKey)
Listen to User data stream
https://binance-docs.github.io/apidocs/spot/en/#user-data-streams
Name | Type | Description |
---|---|---|
listenKey | string |
- Source