Error 429 : Too many requests\Network exception

BK0273
BK0273 edited June 9 in API clients
Am using Auto trading for 2 to 3 months now. Below is what am doing.

1. Have created a pinescript indicator in TradingView which generates an alert to trigger buy and sell options as per my indicator signals.
2. These alerts connects to nextlevelbot.com using the webhook URL provided by nextlevelbot.com
3. I have created zerodha API. The webhook URL connects with zerodha API and executes buy/sell signals in zerodha.

This was working fine with some intermittent issues but recently i have been facing many order rejections daily from zerodha giving below error
429 - "{\n \"status\": \"error\",\n \"message\": \"Too many requests\",\n \"error_type\": \"NetworkException\",\n \"src\": \"cf\"\n}
because of which my orders are not executed in zerodha causing me serious issues.

Do I get these errors because zerodha has introduced some API limits from its side ? or
I understand there is a limit of 10 requests per sec, with zerodha API. So does it mean that zerodha is getting more than 10 requests per sec from nextlevelbot.com and hence am getting these errors ? because from my ID/my API Key am sending just one request in 1 minute, that too not every minute. May be 20 -30 orders per day am sending

Can you suggest a better/stable approach to achieve Auto trading in zerodha and Trading view. I don't want to shift from either of these.

Do you think I wont get these errors if I use some different webhook provider than nextlevelbot.com or if I create my custom webhook URL to call zerodha API's then i wont get these errors and that could be a better/stable approach.

your guidance will be highly helpful.
  • Nivas
    You may refer to the similar discussion here.
  • BK0273
    Sir, thank you for your response. I had gone through this thread prior to writing to you. But this does not help answering my query. My query is simple, does zerodha API has a limit for requests coming from same IP ? Everywhere i see limit of 10 requests per second. I just need confirmation if this limit is for 10 requests coming from same IP ?
  • BK0273
    or this limit means 10 requests per second hitting zerodha API irrespective of IP ?
  • Nivas
    if this limit is for 10 requests coming from same IP
    No, this is not IP-based. You may check this out.
  • BK0273
    Thanks, this helps. then why am i getting too many requests/Network exception errors when am sending not more than 1 request per minute from my ID/API key. Is this because zerodha is getting 10 requests / per second from other IDs. This is difficult to digest, coz this means overall zerodha API cannot handle more than 10 requests per second with such a large user base this will be the case most frequently then, its scary
  • Nivas
    As discussed in this thread, it would be a good idea to debug your program to identify the root cause and then take the appropriate action.
Sign In or Register to comment.