I have a python code which works fine the entire day but I want to run it in morning like around 9:20 to 9:30. For the past few days it has stopped to work, the same code used to work a week earlier. This error occurs when I try to get the ltp of nifty 50 at 9:20. The error is urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7). Any ideas what is causing this and how can I get rid of it?
b = kite.ltp("NSE:NIFTY 50")['NSE:NIFTY 50']['last_price']
You need to hand this time-out with a re-try. This thread will be of help.