Get Candles
get_candlesRetrieve OHLCV candle data for any ticker. Use outputPath to fetch full history beyond the 1000-bar limit via chunked requests.
Instructions
OHLCV candles. timeFrame: M1/M5/M15/M30/H1/H4/D/W/MN. The API caps one request at 1000 bars; inline calls return the most recent ~1000 TRADING bars of the range (truncated flag set when the range was not fully covered). Pass outputPath to fetch the FULL period via chunked requests (streamed to disk, deduplicated, with progress). Bond prices are quoted in % of face value, not currency.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End, ISO 8601 (default: now) | |
| from | No | Start, ISO 8601 (default: 30 days ago) | |
| ticker | Yes | Ticker, e.g. SBER | |
| classCode | No | Board class code (resolved via find_instrument when omitted) | |
| timeFrame | No | D | |
| outputPath | No | Write the full result to this file (path relative to the output root: BCS_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 this also enables full-history fetching (chunking beyond the 1000-bar API limit). | |
| outputFormat | No | File format; default json (or csv if outputPath ends with .csv). csv writes the main flat array of the response. |