Solution for error code-429

DaneshBansal
Hi all
I am using two API's in one account and using multiple instances on same API. While I am setting up connection on API, i am getting below error.

Reading excel sheet3...
Complete reading excel sheet3
NEW PREFIX FOR TODAY IS: NIFTY25430
STRATEGY_STOP_TIME FOR TODAY IS: 09:40:00
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
Reconnect attempt: 1
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
Reconnect attempt: 2

I tried adding a new API, but still getting the same issue. Pls help me find a solution to this issue.

Regards

Danesh Bansal
  • Sravanthi_bh
    Sravanthi_bh edited April 28
    This happens when you are exceeding the maximum allowed limit for WebSocket connection. you may check out the similar discussion here.
  • DaneshBansal
    Hi. Thanks a lot for your response. Kindly help me with following info:

    a) Is this limit per account or per api.
    b) How to increase this limit.

    Regards

    Danesh
  • Sravanthi_bh
    To learn more, please refer to the API rate limits documentation."
  • DaneshBansal
    Thanks a lot for your prompt responses. Pls ignore my little knowledge, I am not able to figure out which of teh specified limits is getting exceeded. If it is web-socket connection, i dont see any specified limit on that.

    I have even tried adding a new API, it does not help. How can I come out of this issue.

    Regards
  • Sravanthi_bh
    Make sure, you have not spun-up multiple instances of the same program. This thread explains more.
  • DaneshBansal
    Hi Sravanthi. Thanks a ton for response. But my issue is still open. I am facing issue in establishing continuous connection through API, i believe its called web socket connection. Whats the maximum limit for following parameters, if any.
    a) Web socket connections per API.
    b) Web socket connections per kite account
    c) No. of unique hardware which can establish connection per API
    d) No. of unique hardware which can establish connection per kite account

    Regards

    Danesh
  • Sravanthi_bh
    A&B- One can open a max of 3 websocket connections per API key.
    C&D- No such limitations

  • DaneshBansal
    ok. thanks. now, last question. how do u define web socket connection. Does it mean a) 3 instances of my code per api or b) i can have connection from 3 machines and each machine can have multiples instances of a code running in parallel.
  • Sravanthi_bh
    Each instance will count individually as the limit of 3. You may refer to the similar discussion here.
  • DaneshBansal
    Hi. In my account(code-QUN 225), there are 9 API's with a total on 25 instances running. They are 7 API's with 3 web socket connections and 2 API's are with 2 web socket connection each, thus a total of 25 web socket connections in the account. Whenver I am trying to connect 26th connection(on the API's with 2 web socket connections each), I start getting RANDOM disconnection on the working connections. PRACTICALLY, I SEE AN ACCOUNT WISE LIMIT OF 25 WEB SOCKET CONNECTIONS. The error message is as follows:

    ck counter: 207
    Tick time: 2025-05-14 12:16:00
    Tick counter: 208
    Tick time: 2025-05-14 12:16:00
    Tick counter: 209
    Tick time: 2025-05-14 12:16:00
    Tick counter: 210
    Tick time: 2025-05-14 12:16:01
    Connection error: 1006 - connection was closed uncleanly (None)
    Connection closed: 1006 - connection was closed uncleanly (None)
    Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
    Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
    Reconnect attempt: 1
    connected
    2025-05-15
    Tick counter: 211
    Tick time: 2025-05-14 12:16:37
    Tick counter: 212
    Tick time: 2025-05-14 12:16:38

    The above message starts moving from one existing connection to another one and so on.

    Pls advise solution to this.

    ZERODHA TEAM, I AM STRUGGLING WITH THIS ISSUE FOR MORE THAN 2 WEEKS. PLS DONT PROVIDE GENERIC COMMENTS. PLS CHECK IN MY ACCOUNT AND SHARE TEH PRECISE SOLUTION.

    Regards

    Danesh


  • DaneshBansal
    Awaiting response
  • Sravanthi_bh
    We have asked the concerned team to take a look at this.
  • DaneshBansal
    it has been weeks. pls expedite
  • sujith
    There is a RMS limit for 25 Websocket connections per client ID to uphold the fair usage policy. You need to make sure you are within that limit.
  • sujith
    Each connection allows to subscribe for up to 3000 instruments concurrently. Hence concurrently you can subscribe for up to 75000 instruments. It is more than enough for any kind of usage.
  • DaneshBansal
    DaneshBansal edited May 19
    Hi. This information is in contradiction to your 5th May response. psl refer to below.

    My clarification:
    Hi Sravanthi. Thanks a ton for response. But my issue is still open. I am facing issue in establishing continuous connection through API, i believe its called web socket connection. Whats the maximum limit for following parameters, if any.
    a) Web socket connections per API.
    b) Web socket connections per kite account
    c) No. of unique hardware which can establish connection per API
    d) No. of unique hardware which can establish connection per kite account

    Your response:

    A&B- One can open a max of 3 websocket connections per API key.
    C&D- No such limitations

    First you guys provided wrong information and then slept over my subsequrent clarifications. How fair it is?
  • sujith
    @DaneshBansal,
    We apologize for the inconvenience. @Sravanthi_bh was thinking in the Kite Connect perspective. This is a client level restriction outside of Kite Connect. We just got to know from the concerned team after an elaborate back and forth discussion.
Sign In or Register to comment.