Get Candles
get_candlesRetrieve OHLCV candle data for any instrument with customizable interval and date range. Supports inline return for recent candles or file output for bulk historical data.
Instructions
OHLCV candles for an instrument. Default: daily candles for the last year. Inline mode returns at most 1500 most recent candles (truncated flag). With outputPath the server fetches the WHOLE range, splitting it into chunks within API limits (day candles up to 6 years per request, 1min up to 1 day), and writes everything to the file. priceUnit: bonds are quoted in % of nominal, futures in points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Period end, ISO 8601 (default: now) | |
| from | No | Period start, ISO 8601 (default: 1 year ago) | |
| interval | No | day | |
| outputPath | No | Write the full result to this file (path relative to the output root: TINKOFF_OUTPUT_DIR or server cwd) instead of returning it inline. The response becomes a short summary {savedTo, records, bytes, sample}. Use for bulk data to keep the context clean. For get_candles/get_operations this also enables full-history fetching (chunking/pagination). | |
| instrumentId | Yes | Instrument UID | |
| outputFormat | No | File format; default json (or csv if outputPath ends with .csv). csv writes the main flat array of the response. |