Delay in fetching Open data - previous close returned

Sashank_Chittipeddi
Hello,

I used the following code to get the open data and then do calculations on it.

r=requests.get('https://api.kite.trade/quote/ohlc?api_key=xxx8&access_token=xxx&i=NSE:ASIANPAINT')
data=r.json()
data=pd.DataFrame(data['data'])
#extract the opening price like below -
data['NSE:ASIANPAINT']['ohlc']['open']

ran the code immediately after market open - at 0915 a.m

However, during my review today, discovered that the above formula returned the close data as against open.

I want to know if I can run the above code at 0915. If not, what is the appropriate time to run it? a few seconds delay?

Thanks!
Sign In or Register to comment.