Hi, I have built a small trading application in python using Kite API. I use my application to trade instead of the kite web interface. The application does usual activities, like logging in, fetching the instruments, fetching index and option ltp's, check order status, modify and place order, check position. The application runs in a loop and makes around 5 - 7 requests per second.
Few months ago I started to see a delay of approx 14 seconds every few minutes where my application will pause intermittently in between api executions. Then around Sept 16th 2025 the issue disappeared completely and I also noticed the api responses became very fast, lightening fast actually. Now once again since yesterday evening, 16th October 2025. I am seeing the usual delay of around 14 seconds every 2-4 minutes of execution. Even the initial api login and fetching instrument takes time. I have checked everything on my end. Not sure what is wrong. This is blocking my trade making it very difficult to continue. Appreciate any suggestions or insights. Thank you.
update. Just now 18 oct 0.12 am, after almost 2 days, I see the api calls have become fast again and the delay issue has disappeared. So clearly it is something happening on Kite servers. Who knows if the problem returns again tomorrow and how long long it will last, few days, few weeks or months. This is a very serious issue for the api usage and yet I see no announcements or discussions on this. What am I missing, I cant be the only one impacted.
If I make just 1 call to get the orders every 1 sec, I see the delay happen every 15 minutes. Seems like the frequency of delay is directly related to the number of api calls. As the number of api call increases the delay happens more frequently. Right now for my use case I am seeing freeze of of 14-15 sec every 4 mins approx. Little bit variation is always there.
Starting Loop.. Glich time : 0:00:15.420665 Time Since Last Glitch : 0:04:36.972792 Glich time : 0:00:15.324776 Time Since Last Glitch : 0:09:06.481872 Glich time : 0:00:15.380680 Time Since Last Glitch : 0:04:32.719631 Glich time : 0:00:15.412339 Time Since Last Glitch : 0:04:32.570644 Glich time : 0:00:15.363051 Time Since Last Glitch : 0:04:30.456377
I have been using kite api regularly for more than 2 years now, this issue was not there earlier. If someone can explain how this is done may be I can make additional changes in my code to deal with it. But If the expectation with the api now is to just be able to make 2-3 calls every second to avoid very frequent delays then that makes it practically useless for any application.
We have checked this and verified it at our end, and we didn't observe any delay in the websocket tick data. The API calls used in your application should be within the API rate limit. Please run a single standalone API request and check the latency at your end.
Hi @salim_chisty , Thanks for checking. I have checked everything on my end. Even shifted to Websocket implementation for ticks data instead of LTP call and removed multiple Python versions. To rule out Network related issues I added my Laptop to Router QoS but dint see any difference. I tried my application from 2 different pcs and still have the same problem. Doesn't look like anything to do with my Application. If issue was on my end then most likely it should stay continuous.
Yesterday, Muhurat Trading day, everything was working fine and perfect and today morning again the same issue. What changed, nothing on my end. The days on which the issue is observed even API Login and Token generation takes considerable time and you are staring at the screen for few seconds. The days on which issue is not there, API Login is blazing fast in milliseconds. I have also noticed that sometimes during your maintenance when the margin api call is blocked the API's are working fast and the intermittent issue is not there.
This is not about latency issue with any one api call. I have already mentioned about it, running just one standalone api call. The issue is that every few minutes randomly the api responses are blocked which halts the application. After how many minutes to halt seems to directly related to the number of api calls being made every second. With just one api call it halts every 15 or 30 minutes. With 5-6 api calls it halts every 2-4 or 4-8 minutes.
What happens when Rate Limit is reached. Do you throw an exception or block the calls for some time. I have not seen any Rate limit related exceptions/errors being thrown. Rate Limit is not the issue here. If the application gets blocked for 2-3 seconds its understandable but stopping for 14-15 seconds intermittently every few minutes completely takes away the trade opportunity.
This is from PC 1 Fetching Instruments.. WebSocket connected done.. Starting Loop.. Glich (Primary) : 0:00:14.993386 Time Since : 0:07:43.102005 at : 10 : 24 : 43 Glich (Primary) : 0:00:15.077773 Time Since : 0:03:54.969391 at : 10 : 28 : 38 Glich (Primary) : 0:00:14.958730 Time Since : 0:03:59.130869 at : 10 : 32 : 37 Glich (Primary) : 0:00:15.020236 Time Since : 0:04:00.127754 at : 10 : 36 : 37 Glich (Primary) : 0:00:15.954777 Time Since : 0:03:54.447518 at : 10 : 40 : 31 Glich (Primary) : 0:00:04.514856 Time Since : 0:02:35.238090 at : 10 : 43 : 18
This is from PC 2 Fetching Instruments.. WebSocket connected done.. Starting Loop.. Glich (Primary) : 0:00:04.425839 Time Since : 0:04:14.983734 at : 14 : 8 : 11 Glich (Primary) : 0:00:14.756786 Time Since : 0:00:39.711210 at : 14 : 8 : 40 Glich (Primary) : 0:00:14.819855 Time Since : 0:04:50.308209 at : 14 : 13 : 30 Glich (Primary) : 0:00:14.793865 Time Since : 0:04:51.333097 at : 14 : 18 : 22 Glich (Primary) : 0:00:14.786979 Time Since : 0:04:54.957704 at : 14 : 23 : 16 Glich (Primary) : 0:00:14.803563 Time Since : 0:04:51.785746 at : 14 : 28 : 8
Since the instrument file contains a large amount of data, it is recommended to fetch it once in the morning, store it locally, and reuse it throughout the day instead of polling it again and again. There is a throttling period for 400 and 403 response codes. For details, please refer to the official documentation — API Rate Limits and Throttling Period.
Hi @salim_chisty Instruments are fetched once, they are not part of the loop. The output above is from 2 different PC's. I am handling following exceptions in my code. None of these are getting triggered which could add to the delay. My API calls are within the limits. Is there anything else which I should be checking in my code. Is it possible to know the right reason ? TokenException, OrderException, InputException, NetworkException, DataException, GeneralException, KiteException
We've conducted tests by submitting multiple API requests across different time frames, and we haven't been able to replicate the delay you're seeing. Since Kite Connect is leveraged by a vast number of users and platforms, a server-side issue would typically generate widespread reports, which we haven't received concerning this specific matter.
This suggests the delay might be originating elsewhere, possibly within your application's processing or network layer.
To efficiently diagnose the root cause, a great first step is to isolate the problem. The next time you experience the delay, try submitting a quick, independent API request immediately. If that test request performs normally, you'll know for sure that the issue resides within your codebase. From there, you can narrow down the exact point of the performance bottleneck.
Thanks @Nivas and @salim_chisty Today I noticed that all other external api calls in my system were taking around 42 seconds except Kite API which worked fine except those intermittent delays every few minutes. Shifting to mobile network than my usual internet resolved that issue with other non kite api calls. I dint check yet for kite though. So now I have a lead that something in my router or internet service provider is messing up with api calls not sure how Kite managed to work fine all along when no other api will respond below 42 seconds. So I will be investigating those now over the weekend and figure out. If I manage to find root cause which solves the problem then I will post an update for anyone following this
Kite issue is finally resolved for me. For testing. I changed to a different Internet provider and it worked. Then for existing Internet changed the login password in the router and that triggered something and after that the issue is resolved there as well.
Starting Loop..
Glich time : 0:00:15.420665 Time Since Last Glitch : 0:04:36.972792
Glich time : 0:00:15.324776 Time Since Last Glitch : 0:09:06.481872
Glich time : 0:00:15.380680 Time Since Last Glitch : 0:04:32.719631
Glich time : 0:00:15.412339 Time Since Last Glitch : 0:04:32.570644
Glich time : 0:00:15.363051 Time Since Last Glitch : 0:04:30.456377
I have been using kite api regularly for more than 2 years now, this issue was not there earlier. If someone can explain how this is done may be I can make additional changes in my code to deal with it. But If the expectation with the api now is to just be able to make 2-3 calls every second to avoid very frequent delays then that makes it practically useless for any application.
The API calls used in your application should be within the API rate limit. Please run a single standalone API request and check the latency at your end.
I have checked everything on my end. Even shifted to Websocket implementation for ticks data instead of LTP call and removed multiple Python versions. To rule out Network related issues I added my Laptop to Router QoS but dint see any difference. I tried my application from 2 different pcs and still have the same problem. Doesn't look like anything to do with my Application. If issue was on my end then most likely it should stay continuous.
Yesterday, Muhurat Trading day, everything was working fine and perfect and today morning again the same issue. What changed, nothing on my end. The days on which the issue is observed even API Login and Token generation takes considerable time and you are staring at the screen for few seconds. The days on which issue is not there, API Login is blazing fast in milliseconds. I have also noticed that sometimes during your maintenance when the margin api call is blocked the API's are working fast and the intermittent issue is not there.
This is not about latency issue with any one api call. I have already mentioned about it, running just one standalone api call. The issue is that every few minutes randomly the api responses are blocked which halts the application. After how many minutes to halt seems to directly related to the number of api calls being made every second. With just one api call it halts every 15 or 30 minutes. With 5-6 api calls it halts every 2-4 or 4-8 minutes.
What happens when Rate Limit is reached. Do you throw an exception or block the calls for some time. I have not seen any Rate limit related exceptions/errors being thrown. Rate Limit is not the issue here. If the application gets blocked for 2-3 seconds its understandable but stopping for 14-15 seconds intermittently every few minutes completely takes away the trade opportunity.
This is from PC 1
Fetching Instruments..
WebSocket connected
done..
Starting Loop..
Glich (Primary) : 0:00:14.993386 Time Since : 0:07:43.102005 at : 10 : 24 : 43
Glich (Primary) : 0:00:15.077773 Time Since : 0:03:54.969391 at : 10 : 28 : 38
Glich (Primary) : 0:00:14.958730 Time Since : 0:03:59.130869 at : 10 : 32 : 37
Glich (Primary) : 0:00:15.020236 Time Since : 0:04:00.127754 at : 10 : 36 : 37
Glich (Primary) : 0:00:15.954777 Time Since : 0:03:54.447518 at : 10 : 40 : 31
Glich (Primary) : 0:00:04.514856 Time Since : 0:02:35.238090 at : 10 : 43 : 18
This is from PC 2
Fetching Instruments..
WebSocket connected
done..
Starting Loop..
Glich (Primary) : 0:00:04.425839 Time Since : 0:04:14.983734 at : 14 : 8 : 11
Glich (Primary) : 0:00:14.756786 Time Since : 0:00:39.711210 at : 14 : 8 : 40
Glich (Primary) : 0:00:14.819855 Time Since : 0:04:50.308209 at : 14 : 13 : 30
Glich (Primary) : 0:00:14.793865 Time Since : 0:04:51.333097 at : 14 : 18 : 22
Glich (Primary) : 0:00:14.786979 Time Since : 0:04:54.957704 at : 14 : 23 : 16
Glich (Primary) : 0:00:14.803563 Time Since : 0:04:51.785746 at : 14 : 28 : 8
There is a throttling period for 400 and 403 response codes. For details, please refer to the official documentation — API Rate Limits and Throttling Period.
Instruments are fetched once, they are not part of the loop. The output above is from 2 different PC's.
I am handling following exceptions in my code. None of these are getting triggered which could add to the delay. My API calls are within the limits. Is there anything else which I should be checking in my code. Is it possible to know the right reason ?
TokenException,
OrderException,
InputException,
NetworkException,
DataException,
GeneralException,
KiteException
This suggests the delay might be originating elsewhere, possibly within your application's processing or network layer.
To efficiently diagnose the root cause, a great first step is to isolate the problem. The next time you experience the delay, try submitting a quick, independent API request immediately. If that test request performs normally, you'll know for sure that the issue resides within your codebase. From there, you can narrow down the exact point of the performance bottleneck.