diff --git a/binance/client.py b/binance/client.py index 35785088..26ca54c3 100755 --- a/binance/client.py +++ b/binance/client.py @@ -1324,6 +1324,45 @@ def get_symbol_ticker(self, **params): """ return self._get('ticker/price', data=params, version=self.PRIVATE_API_VERSION) + + def get_symbol_ticker_window(self, **params): + """Latest price for a symbol or symbols. + + https://binance-docs.github.io/apidocs/spot/en/#rolling-window-price-change-statistics + + :param symbol: + :type symbol: str + + :returns: API response + + .. code-block:: python + + { + "symbol": "LTCBTC", + "price": "4.00000200" + } + + OR + + .. code-block:: python + + [ + { + "symbol": "LTCBTC", + "price": "4.00000200" + }, + { + "symbol": "ETHBTC", + "price": "0.07946600" + } + ] + + :raises: BinanceRequestException, BinanceAPIException + + """ + return self._get('ticker', data=params, version=self.PRIVATE_API_VERSION) + + def get_orderbook_ticker(self, **params): """Latest price for a symbol or symbols. @@ -9122,6 +9161,10 @@ async def get_symbol_ticker(self, **params): return await self._get('ticker/price', data=params, version=self.PRIVATE_API_VERSION) get_symbol_ticker.__doc__ = Client.get_symbol_ticker.__doc__ + async def get_symbol_ticker_window(self, **params): + return await self._get('ticker', data=params, version=self.PRIVATE_API_VERSION) + get_symbol_ticker_window.__doc__ = Client.get_symbol_ticker_window.__doc__ + async def get_orderbook_ticker(self, **params): return await self._get('ticker/bookTicker', data=params, version=self.PRIVATE_API_VERSION) get_orderbook_ticker.__doc__ = Client.get_orderbook_ticker.__doc__