Skip to content

Commit e75d88f

Browse files
authored
Merge pull request binance-exchange#1 from Lcstyle/Lcstyle-patch-1-add-BSM-SymbolMiniTicker-socket
add Symbol miniTicker stream to Binance Socket Manager
2 parents f07a39f + 55ed233 commit e75d88f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

binance/streams.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,36 @@ def aggtrade_futures_socket(self, symbol: str, futures_type: FuturesType = Futur
576576
577577
"""
578578
return self._get_futures_socket(symbol.lower() + '@aggTrade', futures_type=futures_type)
579+
580+
def symbol_miniTicker_socket(self, symbol: str):
581+
"""Start a websocket for a symbol's miniTicker data
579582
583+
https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md#individual-symbol-mini-ticker-stream
584+
585+
:param symbol: required
586+
:type symbol: str
587+
588+
:returns: connection key string if successful, False otherwise
589+
590+
Message Format
591+
592+
.. code-block:: python
593+
594+
{
595+
"e": "24hrMiniTicker", // Event type
596+
"E": 123456789, // Event time
597+
"s": "BNBBTC", // Symbol
598+
"c": "0.0025", // Close price
599+
"o": "0.0010", // Open price
600+
"h": "0.0025", // High price
601+
"l": "0.0010", // Low price
602+
"v": "10000", // Total traded base asset volume
603+
"q": "18" // Total traded quote asset volume
604+
}
605+
606+
"""
607+
return self._get_socket(symbol.lower() + '@miniTicker')
608+
580609
def symbol_ticker_socket(self, symbol: str):
581610
"""Start a websocket for a symbol's ticker data
582611

0 commit comments

Comments
 (0)