CyberPunkMetalHead / Binance-News-Sentiment-Bot

This is a fully functioning Binance trading bot that takes into account the news sentiment for the top 100 crypto feeds. If you like this project consider donating though the Brave browser to allow me to continuously improve the script.
MIT License
1.57k stars 290 forks source link

APIError(code=-2015): Invalid API-key, IP, or permissions for action. #52

Closed crus-glitch closed 3 years ago

crus-glitch commented 3 years ago

I know this one seems obvious but nothing I have done has worked... This is all on binance.us

The bot works fine for testnet but when I switch to live I get this error (using small test values to see if it will execute at all):

image

I set 'testnet' to 'False and I have tried both setting the environment variables on windows to the api key/secret as well as copying and pasting it directly as a string like this:

api_key_live = "randomapikeycharacters" api_secret_live = "randomapikeycharacters"

I tried generating a new api key and switching some settings around but nothing seemed to work and don't know what else to try. Does anyone have live trades working on binance.us?

CyberPunkMetalHead commented 3 years ago

I’m not using it with the Binance US api but as far as I’m aware it should have the same endpoints.

According to the error it could be a number of things.

Are you using a spot account? And also, have you enabled the market orders as permissions for your api key?

finally, have a look at this suggestion on stack overflow, let me what the issue was please.

https://stackoverflow.com/questions/64870237/binance-future-api-apierrorcode-2015-invalid-api-key-ip-or-permissions-f

crus-glitch commented 3 years ago

This tld='us' was all I needed to do to fix it. Thanks!

client = Client(api_key_live, api_secret_live, tld='us')