Skip to content

Commit

Permalink
feat(client): add get_symbol_ticker_window
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiei committed Oct 21, 2024
1 parent 277761e commit e092d16
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions binance/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,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.
Expand Down Expand Up @@ -8551,6 +8590,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__
Expand Down

0 comments on commit e092d16

Please sign in to comment.