Historical Data¶
The Historical Data API provides time-series OHLCV (Open, High, Low, Close, Volume) data for instruments across various intervals. This is ideal for charting, analysis, and building trading strategies.
| Request Type | Path | Description |
|---|---|---|
| GET | /market/historical/{interval} | Fetches historical OHLCV data. |
Get Historical Data¶
Endpoint
Path Parameters
| Parameter | Description |
|---|---|
interval | The time interval for each candle. See the table of Supported Intervals below. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scrip-codes | string | Yes | A comma-separated list of instrument identifiers. Example: NSE_3045,NFO_51011 |
start_time | int64 | Yes | Start timestamp (Unix epoch milliseconds, inclusive). |
end_time | int64 | Yes | End timestamp (Unix epoch milliseconds, exclusive). |
Example Request
Bash
curl --location 'https://api.indstocks.com/market/historical/1minute?scrip-codes=NSE_3045&start_time=1750055540000&end_time=1750141940000' \
--header 'Authorization: YOUR_ACCESS_TOKEN'
Response Format The response uses a success boolean. data is keyed by scrip code, and each scrip's candles is an array of objects.
| Candle field | Description |
|---|---|
ts | Candle timestamp, Unix epoch seconds (IST). |
o | Open price |
h | High price |
l | Low price |
c | Close price |
v | Volume |
JSON
{
"success": true,
"data": {
"NSE_1594": {
"candles": [
{ "ts": 1782877500, "o": 1007, "h": 1013.9, "l": 999.3, "c": 1000.4, "v": 2847163 },
{ "ts": 1782881100, "o": 1000.4, "h": 1002, "l": 996.7, "c": 999.6, "v": 1389042 }
]
}
}
}
Multiple scrip codes
If you request multiple scrip-codes, each one gets its own key under data with its own candles array — they are not merged into a single list.
Supported Intervals & Maximum Time Range¶
| Interval Label | Value | Max Fetch Range |
|---|---|---|
| 1 Minute | 1minute | 7 Days |
| 2 Minutes | 2minute | 7 Days |
| 3 Minutes | 3minute | 7 Days |
| 4 Minutes | 4minute | 7 Days |
| 5 Minutes | 5minute | 7 Days |
| 10 Minutes | 10minute | 7 Days |
| 15 Minutes | 15minute | 7 Days |
| 30 Minutes | 30minute | 7 Days |
| 1 Hour | 60minute | 14 Days |
| 2 Hours | 120minute | 14 Days |
| 3 Hours | 180minute | 14 Days |
| 4 Hours | 240minute | 14 Days |
| 1 Day | 1day | 1 Year |
| 1 Week | 1week | 1 Year |
| 1 Month | 1month | 1 Year |
Notes¶
start_time/end_timequery parameters are in IST and Unix epoch milliseconds; thetsfield inside each returned candle is in Unix epoch seconds.- Ensure your requested time range does not exceed the allowed maximum for the chosen interval.
- If requesting multiple scrips, each scrip code gets its own
candlesarray underdata— they are not merged into a single list.
See Also¶
- Market Quotes — live snapshot instead of historical candles
- Instruments — look up the
SECURITY_IDused to buildscrip-codes - Error Bucket —
DataExceptionfor invalid interval/time-range parameters