Answers for "how to get coins in binance"

0

how to get coins in binance

pip install python-binance

import binance

binance_api_client = binance.Client()
coins_exchange = binance_api_client.get_exchange_info()

usdt_coins = []
for symbol in coins_exchange["symbols"]:
    if( "USDT" == symbol["symbol"][-4:] and
        "BULLUSDT" != symbol["symbol"][-8:] and
        "BEARUSDT" != symbol["symbol"][-8:] and
        "GBPUSDT" != symbol["symbol"][-7:] and
        "UPUSDT" != symbol["symbol"][-6:] and 
        "DOWNUSDT" != symbol["symbol"][-8:] and 
        "SPOT" in symbol["permissions"]
        ):
        usdt_coins.append(symbol["symbol"][0:-4])
print("coins number: ", len(usdt_coins))
print(",".join(usdt_coins))

with open('coins.txt', 'w') as f:
    f.write(",".join(usdt_coins))
Posted by: Guest on September-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language