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.
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?
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.
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?
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.
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..
This is my code And this is the console output 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?
As per the docs, you can't call more than its limits, so it's better to check your code.I have called the same quote API, and I got a 429 error after the limit was exceeded.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?
Will wait for @sujith 's reply