Hello, i’m running a script in python and works fine for several hours, and suddenly stop running and this error appears…
BinanceAPIException: APIError(code=0): Invalid JSON error message from Binance:
403 Forbidden403 Forbidden
'''this is the part of the code that make the error call
def get_symbols(pair: str):
#client = binance.Client()
exchange_info = client.futures_exchange_info()
symbols = [x[‘symbol’] for x in exchange_info[‘symbols’]]
selected_symbols = list(filter(lambda x: x.endswith(pair),symbols))
selected_symbols = [x for x in selected_symbols if ‘BUSD’ not in x]
“”“selected_symbols = [x for x in selected_symbols if ‘DOWN’ not in x]
selected_symbols = [x for x in selected_symbols if ‘BULL’ not in x]
selected_symbols = [x for x in selected_symbols if ‘BEAR’ not in x]”“”
selected_symbols = [i for i in selected_symbols if all(j not in i for j in exclude)]
#print(f’{len(symbols)} {len(selected_symbols)} {selected_symbols}')
return selected_symbols