APIError(code=-2015): Invalid API-key, IP, or permissions for action. When getting account info
When i run the python script balance = client.get_asset_balance(asset="USDT") i get the error -2015
I have 2 api´s, i dont know if that has a role there, i already checked that those are the correct keys. The permissions enabled are: reading spot and margin trading withdrawals universal transfer vanilla options
Reproduce the error: from binance.client import Client client = Client("mykey", "mykey", tld='us') balance = client.get_asset_balance(asset="USDT")
Full error lines:
Traceback (most recent call last):
File "lol.py", line 19, in
for test try this
client = Client(api_key, api_secret)
client.API_URL = "https://testnet.binance.vision/api"
but there must be a better way to convert all api to test

for test try this
client = Client(api_key, api_secret) client.API_URL = "https://testnet.binance.vision/api"but there must be a better way to convert all api to test
Thanks, looks like removing the third argument in Client object fixed it. Awesome!
Hi, I have also the same error. All the api keys new and relevant permissions are granted. BTW, I am using https://www.trbinance.com
Do you know how can I fix it? Thank you for the help. e
You should search for the "tld=" argument as i said in my last reply, check it and change it if necessary. I am sorry that i cant help you any further, good luck.
here is the answer, gotta create a testnet api key which is different to the regular api key via the binance testnet docs
https://stackoverflow.com/questions/67376632/how-to-create-binance-test-api-key
https://testnet.binance.vision/ (click generate api)