# bnb_price_checker.py
# Lấy giá BNB/USDT hiện tại từ API Spot của Binance

from binance.client import Client

# Không cần khóa bí mật/khóa API cho dữ liệu công khai
client = Client(api_key=None, api_secret=None)

def get_bnb_price():
try:
ticker = client.get_symbol_ticker(symbol="BNBUSDT")
price = float(ticker["price"])
print(f"Giá BNB/USDT hiện tại: {price} USDT")
return price
except Exception as e:
print("Lỗi khi lấy giá:", e)

if __name__ == "__main__":
get_bnb_price()$BNB