Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions binance/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,28 @@ def get_symbol_info(self, symbol) -> Optional[Dict]:
return item

return None

def get_latest_price(self,symbol) -> int:
"""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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is defined here for now reason

list_price= [x['price'] for x in self.get_all_tickers() if x['symbol']==symbol]

for i in list_price:
val=float(i)
return val
# General Endpoints

def ping(self) -> Dict:
Expand Down