question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binanace rate limit error for fetchTickers

See original GitHub issue
  • OS: Ubuntu 16.04.3
  • Programming Language version: Node live-tickers.js
  • CCXT version: a9e763b21908f29c790f6c0279e868013c3394e9
  • Exchange: Binance
  • Method: fetchTickers

I ran a js example from ‘examples/js’ directory - $ node live-tickers.js binance

Got rate limit error – Error: binance 418 I’m a Teapot {“code”:-1003,“msg”:“Way too many requests; IP banned until 1516363116074.”}

Following is complete console output -

--------------------------------------------------------
binance 2018-01-19T11:56:35.581Z
Fetched 243 tickers:
  symbol |          price |                 datetime
----------------------------------------------------
BTC/USDT | 11579.98000000 | 2018-01-19T11:56:34.828Z
ETH/USDT |  1054.93000000 | 2018-01-19T11:56:35.217Z
NEO/USDT |   146.01700000 | 2018-01-19T11:56:35.352Z
BNB/USDT |    15.05020000 | 2018-01-19T11:56:33.205Z
LTC/USDT |   194.50000000 | 2018-01-19T11:56:35.164Z
BCH/USDT |  1800.00000000 | 2018-01-19T11:56:35.307Z
 CND/BNB |     0.01316000 | 2018-01-19T11:56:33.318Z
 NEO/BNB |     9.70700000 | 2018-01-19T11:56:34.718Z
 TRX/ETH |     0.00007927 | 2018-01-19T11:56:34.415Z
 XLM/BNB |     0.03452000 | 2018-01-19T11:56:21.864Z
 VEN/BNB |     0.38990000 | 2018-01-19T11:56:08.951Z
 LTC/BNB |    12.87000000 | 2018-01-19T11:56:34.757Z
 ICX/BNB |     0.55990000 | 2018-01-19T11:56:34.065Z
 ADX/BNB |     0.14703000 | 2018-01-19T11:56:34.284Z
 XRP/ETH |     0.00154450 | 2018-01-19T11:56:35.352Z
IOTA/BNB |     0.18926000 | 2018-01-19T11:56:34.942Z
 BCH/BNB |   119.06000000 | 2018-01-19T11:56:35.232Z
 TRX/BTC |     0.00000724 | 2018-01-19T11:56:35.232Z
 QSP/BNB |     0.03443000 | 2018-01-19T11:56:32.388Z
 CND/ETH |     0.00018801 | 2018-01-19T11:56:35.315Z
(node:14108) UnhandledPromiseRejectionWarning: Error: binance 418 I'm a Teapot {"code":-1003,"msg":"Way too many requests; IP banned until 1516363116074."}
    at binance.handleErrors (/home/ninad/apps/jackbot/ccxt/repo/ccxt/js/binance.js:827:23)
    at response.text.then.text (/home/ninad/apps/jackbot/ccxt/repo/ccxt/js/base/Exchange.js:452:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:14108) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14108) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
orkensteincommented, Jan 19, 2018

@ninadpachpute That’s because you make too much requests. Under the hood fetchTickers uses ticker/24h, which is quite “heavy” request. And you’re limited to 1200 points per minute, when fetchTickers takes 242 points at this moment:

[{'rateLimitType': 'REQUESTS', 'interval': 'MINUTE', 'limit': 1200}, 
{'rateLimitType': 'ORDERS', 'interval': 'SECOND', 'limit': 10},
{'rateLimitType': 'ORDERS', 'interval': 'DAY', 'limit': 100000}]

Add sleep(X) to avoid this. Also count your requests: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md

There’s also another problem: Binance should return 429 first, not 418. But AFAIU, it’s a known bug for this moment. Binance is quite strict about API usage…

2reactions
orkensteincommented, Jan 20, 2018

@kroitor I’m working on Binance bot now, so gonna dive into it. If you have a plan, how to implement counter in a good way, lemme know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binance fetchTickers rate limit DDoSProtection error #6401
If you fetch all tickers at once – that is heavy on the exchange, that request "weighs" a lot. The weight of fetching...
Read more >
API Frequently Asked Questions - Binance
The order limits (currently it is 50 times/10 seconds and 160,000 times/24 hours) will be dependent on the account. If the order limit...
Read more >
API Reference | Santiment Academy
There are API call rate limits applied per minute, per hour, and per month. When the rate limit is reached, an error response...
Read more >
Data Documentation | RESTful API - TraderMade
Data Documentation for the RESTful API with detailed examples for easy integration, examples include Javascript, Python, and PHP.
Read more >
Errors by Number - eBay Developers Program
Error number Severity Description 335 Serious Error 12311 Warning Short error: TUV Error Long error: TUV Error
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found