☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
November 2021
sujith
November 2021
shivesh1987
November 2021
rakeshr
HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
shivesh1987
November 2021
edited November 2021
in
Python client
Hi,
I am executing my python code in loop. example loop with 10000.. So starting its running fine and after sometime its giving issue as below
HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
rakeshr
November 2021
Can you let us know, which API end-point is throwing this time-out?
shivesh1987
November 2021
Sir I am using below code. 10 - 12 loop executing properly and after that getting this issue..
import kiteSettings
import time
from kiteconnect import KiteConnect
import logging
def Test1(symbol):
#time
.sleep(1)
kite = KiteConnect(kiteSettings.api_key)
kite.set_access_token(kiteSettings.access_token)
f1=kite.quote(symbol)
return f1;
# testing
m=100
for x in range(100000):
m=m-1
print(m)
#time
.sleep(1)
symbol='NFO:AARTIIND21DECFUT','NFO:AARTIIND22JANFUT'
f2=Test1(symbol)
stock1="NFO:AARTIIND21DECFUT"
bid1=(f2.get(stock1).get("depth").get("buy")[0].get("price"))
offer1=(f2.get(stock1).get("depth").get("sell")[0].get("price"))
stock2="NFO:AARTIIND22JANFUT"
bid2=(f2.get(stock2).get("depth").get("buy")[0].get("price"))
offer2=(f2.get(stock2).get("depth").get("sell")[0].get("price"))
print(bid1)
print(offer1)
print(bid2)
print(offer2)
sujith
November 2021
You can use the
Websocket API
. The Quote API is not suitable for polling.
shivesh1987
November 2021
edited November 2021
In quote only can I increase the default timeout and how ?
shivesh1987
November 2021
Also Sir if possible can you please modify above code and send to me by using Websocket API as I am little new in python.
Please send if you can send a sample code sir, it will be very helpful to me.
Thanks
Shivesh
shivesh1987
November 2021
Sir Can you please help here. To use Websocket API, can i use in same platform. what changes required to do sir ?
rakeshr
November 2021
You can go through the
WebSocket usage example here
.
sujith
November 2021
@shivesh1987
,
We don't provide coding support on this forum. You can take a look at the sample code
here
.
This forum is dedicated only for Kite Connect related technical queries.
shivesh1987
November 2021
Hi sir,
Will it work for market close also. I m executing but getting below error
ReactorNotRestartable
sujith
November 2021
It does work after market. You will receive the first tick that is cached, after market.
You can go through
pykiteconnect FAQs
to know more about the issue.
Sign In
or
Register
to comment.
import kiteSettings
import time
from kiteconnect import KiteConnect
import logging
def Test1(symbol):
#time.sleep(1)
kite = KiteConnect(kiteSettings.api_key)
kite.set_access_token(kiteSettings.access_token)
f1=kite.quote(symbol)
return f1;
# testing
m=100
for x in range(100000):
m=m-1
print(m)
#time.sleep(1)
symbol='NFO:AARTIIND21DECFUT','NFO:AARTIIND22JANFUT'
f2=Test1(symbol)
stock1="NFO:AARTIIND21DECFUT"
bid1=(f2.get(stock1).get("depth").get("buy")[0].get("price"))
offer1=(f2.get(stock1).get("depth").get("sell")[0].get("price"))
stock2="NFO:AARTIIND22JANFUT"
bid2=(f2.get(stock2).get("depth").get("buy")[0].get("price"))
offer2=(f2.get(stock2).get("depth").get("sell")[0].get("price"))
print(bid1)
print(offer1)
print(bid2)
print(offer2)
Please send if you can send a sample code sir, it will be very helpful to me.
Thanks
Shivesh
We don't provide coding support on this forum. You can take a look at the sample code here.
This forum is dedicated only for Kite Connect related technical queries.
Will it work for market close also. I m executing but getting below error
ReactorNotRestartable
You can go through pykiteconnect FAQs to know more about the issue.