API Rate Limits

karlsen
karlsen edited July 15 in General
Hi Team,

Sorry for asking the same question again but I feel it is necessary.

The issue is that I am able to call the getQuote and getHistoricalData APIs around 10 times within one second, but as per the limits mentioned here - https://kite.trade/docs/connect/v3/exceptions/#api-rate-limit, it should give me a 429 error.

Have the rate limits been updated?

Thanks!
  • ANL
    ANL edited July 15
    429: Too many requests to the API (rate limiting)
    It is getting that your call is exceeding limits. You may have confused it with API calls. Check the docs clearly.



    The quote API and historical API cannot be called 10 times in one second for quotes at 1 r/s and historical at 3 r/s. Enable debug in your code to see the 429 error.
  • karlsen
    karlsen edited July 15
    Thanks for the response @ANL, that's what I am saying

    I am able to call it more than the specified limits.
    Where I should have gotten 429 error, I am getting the actual data from these APIs.

    Let me try to show you the console output..
  • karlsen
    Hi @ANL

    This is my code

    try {
    long before = System.currentTimeMillis();
    Map quotes = kiteConnect.getQuote(instrumentKeys);
    long after = System.currentTimeMillis();
    long duration = after - before;
    System.out.println(getTimestamp() + ":: Received quote within: " + duration + "ms");
    return quotes;
    } catch (IOException | KiteException e) {
    logger.error("Quote not available for some tokens, possibly API limit hit");
    throw new RuntimeException(e);
    }
    And this is the console output

    2025-07-15T13:58:01.1951678:: Received quote within: 48ms
    2025-07-15T13:58:01.2466734:: Received quote within: 50ms
    2025-07-15T13:58:01.3049277:: Received quote within: 58ms
    2025-07-15T13:58:01.3481639:: Received quote within: 44ms
    2025-07-15T13:58:01.410756:: Received quote within: 62ms
    2025-07-15T13:58:01.4546503:: Received quote within: 44ms
    2025-07-15T13:58:01.5041141:: Received quote within: 50ms
    2025-07-15T13:58:01.5451887:: Received quote within: 41ms
    2025-07-15T13:58:01.5899354:: Received quote within: 44ms
    2025-07-15T13:58:01.6387875:: Received quote within: 49ms
    2025-07-15T13:58:01.6807199:: Received quote within: 42ms
    2025-07-15T13:58:01.7316249:: Received quote within: 51ms
    2025-07-15T13:58:01.7747894:: Received quote within: 43ms
    2025-07-15T13:58:01.8163282:: Received quote within: 42ms
    2025-07-15T13:58:01.8590425:: Received quote within: 43ms
    2025-07-15T13:58:01.9000362:: Received quote within: 41ms
    2025-07-15T13:58:01.9717899:: Received quote within: 71ms
    2025-07-15T13:58:02.0203514:: Received quote within: 48ms
    2025-07-15T13:58:02.0816004:: Received quote within: 61ms
    2025-07-15T13:58:02.1245365:: Received quote within: 42ms
    2025-07-15T13:58:02.1716004:: Received quote within: 47ms
    2025-07-15T13:58:02.2021348:: Received quote within: 31ms
    2025-07-15T13:58:02.26643:: Received quote within: 64ms
    2025-07-15T13:58:02.2988136:: Received quote within: 32ms
    2025-07-15T13:58:02.3794992:: Received quote within: 81ms
    2025-07-15T13:58:02.4452943:: Received quote within: 66ms
    2025-07-15T13:58:02.4772208:: Received quote within: 32ms
    2025-07-15T13:58:02.529756:: Received quote within: 52ms
    2025-07-15T13:58:02.5733054:: Received quote within: 44ms
    2025-07-15T13:58:02.6215022:: Received quote within: 48ms
    2025-07-15T13:58:02.670028:: Received quote within: 49ms
    2025-07-15T13:58:02.7183272:: Received quote within: 48ms
    2025-07-15T13:58:02.7515897:: Received quote within: 33ms
    2025-07-15T13:58:02.8075497:: Received quote within: 56ms
    2025-07-15T13:58:02.8464478:: Received quote within: 39ms
    2025-07-15 13:58:05.896 [MessageBroker-4] ERROR - Quote not available for some tokens, possibly API limit hit
    As you can see that I am able to get the data from the API multiple times within one second. It gave me a 429 NetworkException error only after many calls.

    I should have gotten 429 much before, why is this happening?
  • ANL
    ANL edited July 16
    I have called the same quote API, and I got a 429 error after the limit was exceeded. As per the docs, you can't call more than its limits, so it's better to check your code.
  • ANL
    ANL edited July 16
    @sujith I checked again, but why does the error not appear after unlimited calls? Legacy reasons?
  • karlsen
    Thanks for the response @ANL

    My code consists only of the snippet that I pasted above.
    Moreover, I see that you struck off one line in your comment above. Did you also face the same issue where 429 error does not come even after the limit gets exceeded?
  • ANL
    ANL edited 6:39AM
    I have checked multiple times the 429 error doesn't come. I checked both the historical and quote API. They have to respond.
  • karlsen
    karlsen edited 6:47AM
    Thanks @ANL
    Will wait for @sujith 's reply
Sign In or Register to comment.