pykiteconnect
pykiteconnect copied to clipboard
Can the kite API be made faster?
The following images show the comparison between pykiteconnect and Kiteconnect REST-API for 15000 F&O instruments.
Current python client:
Creating requests session object:
Asynchronous execution:
Let me know if it can be improved further.
hm, in your first example, you're making 15,000 HTTP requests, one for each instrument?
@knadh no, list (var_name: "opl") of about 490 instruments as there is a limit of 500. var: "op_list" is a list of list of 490x31 instruments, which is being passed to all three examples.
Create requests session by default for connection reuse is available in a new release v4.2.0.
Does using the pool make API requests fasters?
@vijaykz Ideally yes since there is no overhead to create new connections, do note that if you face any issues then configure pool config - https://github.com/zerodha/pykiteconnect/blob/master/kiteconnect/connect.py#L194