Closed dseravalli closed 6 years ago
I think this is due to concurrent requests. Binance must only allow 6 concurrent HTTP requests? Works fine If I write the code in a way that waits for previous request to finish first. Not sure why it was working before....
Recommend using websocket chart endpoint if possible
I am, this is just to grab all the symbol’s candlesticks once on app startup
Turns out it wasnt concurrent requests...getting it now with just one.
Best solution is to keep a daemon running that's listening to all the charts, and writing that data to json file so you always have it up to date. This is a job for Websockets.
Turns out this was a Docker networking glitch and nothing to do with this library or Binance.
Author
i got same issue how u solve it ?
My bot was running fine and all of a sudden I started getting errors from the candlesticks endpoint but it's not returning a standard Binance error that I'm used to (like when I hit a rate limit). It's returning a generic ECONNREFUSED.
I don't think this is rate limit related though. Immediately after running this test script I can hit the API with Postman and it works fine. The rate limit is supposed to be 1200/minute and I'm nowhere near that. Also this code worked fine hours ago. Is it possible they've implemented a per second rate limit now?
Error received:
Here's a test script. For me, any value of
i
over 6 will error every request over 6. So there's always six success and then all errors basically.