Historical Data
This guide describes how to fetch historical data of instruments easily using the SDK.
Get Historical Candle Data
Python SDK Usage
Fetch historical candle data for an instrument using this get_historical_candle_data
method.
Request Schema
Name | Type | Description |
---|---|---|
exchange * | string | Stock exchange |
segment * | string | Segment of the instrument such as CASH, FNO etc. |
trading_symbol * | string | Trading Symbol of the instrument as defined by the exchange |
start_time * | string | Time in YYYY-MM-DD HH:mm:ss or epoch milliseconds format from which data is required |
end_time * | string | Time in YYYY-MM-DD HH:mm:ss or epoch milliseconds format till when data is required |
interval_in_minutes | string | Interval in minutes for which data is required |
*
required parameters
Response Payload
All prices in rupees
Response Schema
Name | Type | Description |
---|---|---|
candles | array[array] | This contains the list of candles. Each candle has candle timestamp (epoch second), open (float), high (float), low (float), close (float) , volume (int) in that order. |
start_time | string | Start time in yyyy-MM-dd HH:mm:ss |
end_time | string | End time in yyyy-MM-dd HH:mm:ss |
interval_in_minutes | int | Interval in minutes |
Candle Interval | Max Duration per Request | Historical Data Available |
---|---|---|
1 min | 7 days | Last 3 months |
5 min | 15 days | Last 3 months |
10 min | 30 days | Last 3 months |
1 hour (60 min) | 150 days | Last 3 months |
4 hours (240 min) | 365 days | Last 3 months |
1 day (1440 min) | 1080 days (~3 years) | Full history |
1 week (10080 min) | No Limit | Full history |