Hello,
I am testing the code in the demo
client = Client(api_key, api_secret)
def process_message(msg):
print(msg)
bm = BinanceSocketManager(client)
conn_key = bm.start_trade_socket('BNBBTC', process_message)
bm.start()
and what i am getting is, error:
{'e': 'error', 'm': 'Max reconnect retries reached'}
I can normally open the page "www.binance.com/trade.html?symbol=BNB_BTC" on Google Chrome.So I think the network is normal.
Am I doing something wrong?
Please help me fix it. Thanks in advance
There are no problems with the code:
from binance.client import Client
from binance.websockets import BinanceSocketManager
client = Client('', '')
def process_message(msg):
print(msg)
bm = BinanceSocketManager(client)
conn_key = bm.start_trade_socket('BNBBTC', process_message)
bm.start()
Have you created api_key, api_secret for the application on binance.com?
@theGalex yes, I have created and used them.
I think you are banned. Please check this code after 24 hr
Thanks for your answers. When I run the program on a virtual personal server in Los Angeles, the error does not appear.The error may be due to the Great Firewall.
@Tuixote
Hi, I have the same problem on my local machine. Works fine on EC2 server.
How did you manage to solve this on your local machine?
Thanks!
@mingrui
I did not solve the problem when program worked on the local machine. I choose to run it on vps.
Hello.
I have the same problem too.
Is anybody find a solution?
Is there any region restriction?
I've used VPN but it is not working.
I also met this problem, and I'm not sure what the real reason is. I tried the similar code in my own laptop and a Linode VPS. After long period of time, it returns:
message type: error
{'e': 'error', 'm': 'Max reconnect retries reached'}
I have the exact same problem currently. Two days before it still worked on this machine. Tried different API keys but does not change anything. Are there any rules on when one gets banned??
I have the exact same problem currently. Two days before it still worked on this machine. Tried different API keys but does not change anything. Are there any rules on when one gets banned??
Yes, every action you do on binance costs a weight. look here: https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md
To create a listenKey costs 1 weight. The more you are out of range of a default user behaviour, the higher is your risk to get banned for a timeframe of 2 min to 3 days.
This is described here: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#limits
Each route has a weight which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier weight.
IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
Most helpful comment
I also met this problem, and I'm not sure what the real reason is. I tried the similar code in my own laptop and a Linode VPS. After long period of time, it returns: