I’m trying to use the python-binance wrapper on my testnet API key. I have no problem performing get_server_time() or get_order_book(). But when I tried to perform get_account(), it raised an exception stating the following error:
Invalid API-key, IP, or permissions for action.
Not only get_account() failed, but other API like get_account_status(), get_all_orders(), get_trade_fee(), etc fails too. If I switch the API key to my actual Binance account API key, these APIs work fine. Why?
I wanted to perform demo trades using Binance API. Is this the right path?
check for api key, ip, or permissions. go to api management and press edit restrictions. for me it was ip restriction problem.
The method get_server_time() and get_order_book() can work fine because these two endpoints do not need the API key to enable the service. (For your reference, here is the API doc: https://binance-docs.github.io/apidocs/spot/en/#check-server-time )
For this particular issue, please check the points listed in the attached link below. Hope it’s helpful for you.
why do I see this error "Invalid API-key, IP, or permissions for action."
Note that python-binance is developed by the community. If you have any enquiry regarding the package, please check with the original developers, thanks.
Thank you for your answer. I figured out that it was my own code at fault. In python-binance package, it is necessary to set testnet parameter in the Client class to True. Noobs mistake.