Hi guys,
I m trying to execute this:
status = client.get_account_status()
and return me this error:
C:\Users\nikho\OneDrive\Escritorio\GHB\PROGRAMACION\TRADE>python try1.py
Traceback (most recent call last):
File “try1.py”, line 6, in
status = client.get_account_status()
File “C:\Users\nikho\AppData\Local\Programs\Python\Python38\lib\site-packages\binance\client.py”, line 1880, in get_account_status
if not res[‘success’]:
KeyError: ‘success’
My api key and secret are correctly. Also dont allow me to use another functions like: client.get_my_trades() or client.get_asset_details(). I guess is the same problem
When there is an error, the res dictionary won’t have a success key at all, so checking for it’s existence will raise KeyError. The code should either be changed to if not res.get('success'):, or wrap the dictionary access in a try/catch and handle the KeyError.
Now having said that, I am experiencing what I think is a related issue in that my API Key and Secret work fine for anything related to market data, e.g. the REST API and Websocket endpoints allow me to query prices - but anything related to account, like getting the account status, submitting test orders, etc. reject the API key as invalid. Any thoughts as to what would cause that? It is definitely not library related. I’ve verified my IP is included in the trust ips section, and I’ve enabled spot trading, but to no avial.
I created a separate post shortly after replying here that provides more detail:
But in short - I tried the binance example and all signed requests reject the API key, and I highly doubt the key/secret are the problem as I’ve created an entirely new pair just to be safe and it still does not work.