Polling Binance fetchTickers every 5 seconds triggers a ban
See original GitHub issueI tried use param {enableRateLimit: true} to handle rate limit.
A strange thing about ‘binance’: when I call fetchTickers() to polling tickers (e.g., every 5 seconds), it will throw an error
{"code":-1003,"msg":"Way too many requests; IP banned until 1514883415037."}
This should not happened, 5 seconds should not trigger limit. Is there some extra info to explain this? I tried find information from ccxt and binance api docs, no idea.
Ref to: #929
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:15 (13 by maintainers)
Top Results From Across the Web
API Frequently Asked Questions - Binance
However, if you are sending a request that could be perceived as malicious, it could also result in a ban of a longer...
Read more >Exchanges — ccxt 2.4.71 documentation
Most exchanges allow up to 1 or 2 requests per second. Exchanges may temporarily restrict your access to their API or ban you...
Read more >Change Log – Binance API Documentation - GitHub Pages
Please use WebSocket Streams for live updates to avoid polling the API. ... WebSocket connections have a limit of 5 incoming messages per...
Read more >python/ccxt/binance.py - searchcode
Please use the websocket for live updates to avoid polling the API. ... 523 '-3022': AccountSuspended, # You account's trading is banned.
Read more >CCXT | PDF | Java Script | Software - Scribd
Most exchanges allow up to 1 or 2 requests per second. Exchanges may temporarily restrict your access to their API or ban you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi!
Binance uses a Machine Learning rate-limiting algorithm that scores your requests against an average user and accounts for the weight of each call.
From Binance:
From their tech team:
Next, if you go here: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#24hr-ticker-price-change-statistics
You will notice that they have a special weight for the “all tickers” endpoint:
They say, that if you’re fetching all tickers, the rate limit should be multiplied by the amount of active traded symbols. They have 234 active symbols, so, it looks like you should not be polling their tickers more than once in 234 seconds. It’s a unique endpoint in terms of rate limiting. Unfortunately, there isn’t an easy workaround for this, if you’re mixing your requests. If you are only doing one type of
fetchTickers()
request, then you can raise the rateLimit to 234 000 milliseconds (once in 234 seconds).Let me know if this answers your question or not.
Hi, @eMDi101 ! Thanks for the notice! The thing is: we are talking of the
allBookTickers
endpoint. The library of sammchardy uses theallPrices
endpoint – that one does not return full info, it will output price info only, without 24h ohlcv.Now, in ccxt we support both endpoints, the
allBookTickers
+ theallPrices
, but for the tickers we useallBookTickers
by default because it gives us 24h stats – that is more than just prices: https://github.com/ccxt/ccxt/blob/master/python/ccxt/binance.py#L98Next, if you look carefully through each endpoint here:
… you will quickly notice two things:
allPrices
andallBookTickers
are now renamed to new endpoints, therefore both ccxt and sammchardy are outdated, but we are working on the update in ccxt (will be there in several hours).We are also going to switch to price-only tickers by default for Binance in one of the upcoming releases. Will update you here.