-1
def withdraw():
try:
    # name parameter will be set to the asset value by the client if not passed
    result = client.withdraw(
        coin='TRX',
        address='<my trx address>',
        amount=100)
    print(result)
except BinanceAPIException as e:
    print(e)
else:
    print("Success")

So after executing above method I am getting an error as APIError(code=-2015): Invalid API-key, IP, or permissions for action. I have enabled withdrawal permission for my API key , also added IP address in Restricted addresses in binance account, still getting this error , not sure where is the exact issue.

  • always put full error message (starting at word "Traceback") in question (not in comments) as text (not screenshot, not link to external portal). There are other useful information. – furas May 29 '22 at 21:28
  • maybe you should remove IP from list to access it from every IP. – furas May 29 '22 at 21:29
  • That is the only error message I am getting as exception and no traceback. Above I have given the sample code that I have used for Withdrawal – Pooja Gupta May 30 '22 at 06:29
  • 'Restrict access to trusted IPs only (Recommended)' this is mandatory to fill IP addresses in order to enable withdrawal for API key – Pooja Gupta May 30 '22 at 06:34
  • which library are you using? does the api key work with other methods? – Alex B May 30 '22 at 19:02
  • Yes, API key is working for other methods such as get account info, buy, sell.. but for withdraw it is not working as we need authorized IP addresses, I am using python-binance for this – Pooja Gupta May 31 '22 at 09:27

1 Answers1

0

So now I have added my public IP address in 'Restrict access to trusted IPs only (Recommended)' column of Binance API key management , and it is working as expected