ReadTimeout: HTTPSConnectionPool for kite.quote api

UE6253
After much of an effort to get quote, now api started giving ReadTimeout after few quotes. Whats wrong now ?


File "D:\workspace_pyCharm\Module_Get_Live_Data_From_Zerodha.py", line 33, in getAllQuotesFromZerodha
quote = self.kite.quote(fullid)

File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 546, in quote
data = self._get("market.quote", {"i": ins})

File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 697, in _get
return self._request(route, "GET", params)

File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 745, in _request
raise e

File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 742, in _request
proxies=self.proxies)

File "C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 622, in send
r = adapter.send(request, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 526, in send
raise ReadTimeout(e, request=request)

ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
  • rakeshr
    @UE6253
    We are looking for permanent solution for time being, you can use Try and catch for this exception.Like this:
    try:
    Your logic here
    except ReadTimeout:
    pass
  • UE6253
    I already have that to continue the loop but looking to understand why it is happening and how can I fix it. I would be relying to get timely quote to execute FO orders so cannot have some cycle missed. It take 2 min to get 50 quotes and its a big time for day trading...
  • sujith
    You can also try websocket connection to get live market data.
  • UE6253
    Sujith, I have another open issue on websocket , its not working for me.
Sign In or Register to comment.