Hi, You will have to use historical data API to get open and close of previous day. Open is previous day's open which you will get it in previous day candle data and for a previous close, you need to fetch current day's candle and check for close price.
You can check out historical data documentation.
You need to subscribe for the same to use it.
Can you please clear some thing about "instrument_token"?
Is this specific for exchange and its trading symbol?
Check out this thread.
Instrument token belongs to the unique id allotted by the Zerodha to the respective Symbol i.e. SBIN, TATAMOTARS.
Is this correct? Please confirm.
I tried for historical data documentation but it returns failed to open streams.
Yes, instrument tokens are unique id which is provided by Zerodha.
Historical API requires an add-on subscription. Have you subscribed for the same?
by using following url.
https://api.kite.trade/instruments/historical/5633/day?from=2017-10-06&to=2017-10-06&api_key=xxxxxx&access_token=xxxxx
Is this access token mandatory? Or, Can we get the historical data without using access token?
All HTTP API calls in Kite Connect are authenticated using access_token.
You need accesss_token to fetch historical data.
Now how to get exactly last open market day data? Suppose, today I need last open market day data, and yesterday market was closed.
Please suggest.
You will have to use historical data API to get open and close of previous day.
Open is previous day's open which you will get it in previous day candle data and for a previous close, you need to fetch current day's candle and check for close price.
From and To are the attributes related to the DATE, But My requirement is to get last market opening day data.
What changes are required for the above mentioned URL to get the last market opening day data?
You can check out this thread.
How to get current ohlc high and low price from quote Api.
You can go through kite connect documentation here.