Search code examples
pythonapibinancecryptocurrency

APIError(code=-2015): Invalid API-key, IP, or permissions for action for Withdrawal using Binance


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.


Solution

  • 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