Hello, I have code which do following access in parallel. 1) access bank nifty data using self.kite.quote(['NSE:NIFTY BANK']) 2) web streaming FnO data of ~20 strikes
Occassionaly it happens that not able to fetch bank nifty price and it says failed to establish connection. Please see the screen shot below. But the web stream data keeps coming in. I am not sure what is going wrong. Can you please guide.
Check if you are crossing the rate limits. Quote APIs have rate limit of 1r/s.
If not,it might be some network error.
Just use try-except block to handle the exception.
Thanks Srijan. I am making 1 request per 20-seconds so should not be rate limits. Let me use try-except to handle. Is there any example available for try-except for kite exceptions? Thanks for your guidance.
The exception you are getting is not an exception from kite. It's actually requests exception. You can search on how to use try-except block in python on internet.
If not,it might be some network error.
Just use try-except block to handle the exception.