OHLC Quotes
API to retrieve the OHLC (Open, High, Low, Close) quotes for one or more instruments. Provides OHLC snapshots of up to 500 instruments in one go.
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Query Parameters
Name | Required | Type | Description |
---|---|---|---|
instrument_key | true | string | Comma separated list of instrument keys. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
interval | true | string | Interval 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. |
Notice of Deprecation
The parameter (symbol
) is deprecated and will be removed in future versions. We've renamed it (instrument_key
) for a more meaningful and significant name.
Responses
- 200
- 4XX
Response Body
{
"status": "success",
"data": {
"NSE_EQ:NHPC": {
"ohlc": {
"open": 53.4,
"high": 53.8,
"low": 51.75,
"close": 52.05
},
"last_price": 52.05,
"instrument_token": "NSE_EQ|INE848E01016"
}
}
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Typically success for successful operations. |
data | object | Data object holding OHLC information |
data.ohlc | object | Data object with OHLC information |
data.ohlc.open | number | The open price of the trading session |
data.ohlc.high | number | The high price of the trading session |
data.ohlc.low | number | The low price of the trading session |
data.ohlc.close | number | The most recent closing price of the symbol |
data.last_price | number | The last traded price of symbol |
data.instrument_token | string | Key of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
Error codes
Error code | Description |
---|---|
UDAPI1087 | One of either symbol or instrument_key is invalid - The provided symbol or instrument_key does not confirm to the accepted format. |
UDAPI1028 | Invalid interval - The specified interval doesn't match any of the recognized values. |
UDAPI1027 | interval is required - You must specify the 'interval' for this operation. |
UDAPI100043 | Data of only 500 instrument keys can be requested in single API call - Limit your request to 500 instrument keys at a time. |
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.
Loading...