Kite quote connection failing while webstream going on

sanjayatzerodha
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.

thanks


  • SRIJAN
    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.
  • sanjayatzerodha
    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.
  • SRIJAN
    SRIJAN edited March 2022
    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.
  • sanjayatzerodha
    Thanks Srijan. It worked using try-except as you suggested. I want to thank you and appreciate for your support and help. God Bless you.
This discussion has been closed.