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 contains an array of candles. Each candle is an array of numbers representing [timestamp, open, high, low, close, volume].
JSON
{
"status": "success",
"data": {
"candles": [
[1678886400000, 2500.00, 2501.50, 2499.50, 2501.00, 500],
[1678886460000, 2501.00, 2502.00, 2500.50, 2501.80, 650]
]
}
}
Supported Intervals & Maximum Time Range¶
| Interval Label | Value | Max Fetch Range |
|---|---|---|
| 1 Second | 1second | 1 Day |
| 5 Seconds | 5second | 1 Day |
| 10 Seconds | 10second | 1 Day |
| 15 Seconds | 15second | 1 Day |
| 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¶
- All timestamps are in IST and Unix epoch milliseconds.
- Ensure your requested time range does not exceed the allowed maximum for the chosen interval.
- If requesting multiple scrips, all returned candles will be grouped under a single
candlesarray.