Skip to main content

OHLC Quotes V3โ€‹

This API retrieves Open, High, Low, Close (OHLC) quotes for one or more instruments. V3 introduces the following enhancements:

  • live_ohlc: Provides the current OHLC candle.
  • prev_ohlc: Delivers the previous minute's OHLC candle.
  • volume: Includes trading volume data.
  • ts: Returns the OHLC candle's start time.

Requestโ€‹

curl --location 'https://api.upstox.com/v3/market-quote/ohlc?instrument_key=NSE_EQ%7CINE669E01016&interval=1d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.

Query Parametersโ€‹

NameRequiredTypeDescription
instrument_keytruestringComma separated list of instrument keys. For the regex pattern applicable to this field, see the Field Pattern Appendix.
intervaltruestringInterval to get ohlc data.
Possible values: 1d, I1, I30.
Here 1d is 1 day, I1 and I30 are 1-minute and 30-minute intervals respectively.
Responses

Response Bodyโ€‹

{
"status": "success",
"data": {
"NSE_FO:NIFTY2543021600PE": {
"last_price": 303.9,
"instrument_token": "NSE_FO|51834",
"prev_ohlc": {
"open": 303.9,
"high": 304.3,
"low": 303.85,
"close": 304.3,
"volume": 300,
"ts": 1744019880000
},
"live_ohlc": {
"open": 304.45,
"high": 304.45,
"low": 302.75,
"close": 303.9,
"volume": 2250,
"ts": 1744019940000
}
}
}
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobjectData object holding OHLC information
data.last_pricenumberThe last traded price of symbol
data.instrument_tokenstringKey of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix.
data.prev_ohlc.opennumberPrevious trading session open price
data.prev_ohlc.highnumberPrevious trading session high price
data.prev_ohlc.lownumberPrevious trading session low price
data.prev_ohlc.closenumberPrevious trading session close price
data.prev_ohlc.volumenumberTotal volume traded in previous trading session
data.prev_ohlc.tsnumberStart time of previous trading session
data.live_ohlc.opennumberCurrent trading session open price
data.live_ohlc.highnumberCurrent trading session high price
data.live_ohlc.lownumberCurrent trading session low price
data.live_ohlc.closenumberCurrent trading session close price
data.live_ohlc.volumenumberTotal volume traded in current trading session
data.live_ohlc.tsnumberStart time of current trading session

Sample Codeโ€‹

Get ohlc (open, high, low, close) market quotesโ€‹

curl --location 'https://api.upstox.com/v3/market-quote/ohlc?instrument_key=NSE_EQ%7CINE669E01016&interval=1d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

Get ohlc (open, high, low, close) market quotes for multiple instrument keysโ€‹

curl --location 'https://api.upstox.com/v3/market-quote/ohlc?instrument_key=NSE_EQ%7CINE669E01016%2CNSE_EQ%7CINE848E01016&interval=1d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
Loading...