Hi, While connecting to API, Code is raising the below exception
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /orders/regular (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
I tried to connect from different computer, Connection is establishing without any exception. So, I am wondering if my IP is blocked for any reason at your end ?
I have added delay too like below code. But it's taking too much time(2-3 minutes) to get the response.
I disconnected my broadband and connected to my mobile hotspot and tried the same, Things are working fine and I am getting the response in 1-2 seconds. What might be the issue?
while True: try: stock_instrument_token = kite.ohlc(NSE_Stock)[NSE_Stock]["instrument_token"]
except (ReadTimeout, SSLError) as error: print(error) time.sleep(3) continue
I disconnected my broadband and connected to my mobile hotspot and tried the same, Things are working fine and I am getting the response in 1-2 seconds. What might be the issue?
while True:
try:
stock_instrument_token = kite.ohlc(NSE_Stock)[NSE_Stock]["instrument_token"]
except (ReadTimeout, SSLError) as error:
print(error)
time.sleep(3)
continue
break