get_historical_candles
Fetch historical OHLCV candles for an Upstox instrument with interval or unit settings and date ranges to support charting, analysis, and backtesting.
Instructions
Get historical OHLCV candles (Upstox v3). Returns [timestamp, open, high, low, close, volume]. Use interval (legacy names) OR unit+interval_value. Units: minutes 1-300, hours 1-5, days/weeks/months 1. Max range per request: 1 month for minutes 1-15; 1 quarter for minutes >15 and hours; 1 decade for days. from_date is optional (defaults to to_date).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"instrument_key": "<instrument_key>",
"to_date": "<to_date>"
},
"name": "get_historical_candles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | ||
| to_date | Yes | YYYY-MM-DD | |
| interval | No | ||
| from_date | No | YYYY-MM-DD | |
| instrument_key | Yes | e.g. NSE_EQ|INE002A01018 | |
| interval_value | No | with unit: minutes 1-300, hours 1-5, others 1 |