Hi Upstox team,
Currently I am using request module to query the API URLs inorder to retreive the JSON responses.
Ex:-
def getFullMarket_GET(symbolList):
url = 'https://api.upstox.com/v2/market-quote/quotes'
headers = \
{
'accept': 'application/json',
'Authorization': f'Bearer {accessToken}'
}
params = \
{
'symbol': symbolList
}
try:
response = requests.get(url=url, headers=headers, params=params)
except requests.exceptions.RequestException as e:
print(f'An error occurred: {e}')
return None
return response.json()
But while fetching the Market data using above code, it takes on an average of almost 1 second for single symbol.
I am trying to fetch market depth from above API, and using the same to place IOC LIMIT orders in realtime.
For trading in options 1 second of delay is too much, half of my IOC orders are getting cancelled due to this.
I was wondering if āUpstox Generated SDKāsā will work faster than the above code.
Please suggest a better way of handling this.
Thanks