diff --git a/binance/client.py b/binance/client.py index 09b6652d6..9ad0ab41f 100755 --- a/binance/client.py +++ b/binance/client.py @@ -506,7 +506,28 @@ def get_symbol_info(self, symbol) -> Optional[Dict]: return item return None + + def get_latest_price_by_symbol(self,symbol) -> float: + """Latest price for One specific symbols. + Reference Document : https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker + + :returns: Latest Price of a coin + + .. code-block:: python + + input : BNBUSDT + output : 600.2 + + :raises: BinanceRequestException, BinanceAPIException + + """ + val=0.0 + list_price= [x['price'] for x in self.get_all_tickers() if x['symbol']==symbol] + + val = list_price[-1]['price'] + + return float(val) # General Endpoints def ping(self) -> Dict: