get_candles
Get OHLC candles for a symbol. Returns open/high/low/close buckets for an asset over a configurable lookback window, sampled at a configurable resolution. Use for candlestick charts and volatility measures that need the intra-bucket range rather than a single close.
Only sources that store individual ticks can produce OHLC. Requesting
candles for an asset priced from a derived or snapshot source returns
400.
See the Time Window & Resolution
section for the format of window and resolution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | No | Ends the window at this instant instead of now, so a past period can be read. RFC3339, and not the zero time. A future instant bounds a window that is still filling. Absent reads live data. | |
| symbol | No | Asset symbol to fetch candles for (e.g. `SOL`, `BTC`). | |
| window | No | Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`). | |
| asset_id | No | Backend asset ID. Mutually exclusive with `symbol`: exactly one of the two is required, and naming both is a 400. | |
| resolution | No | Candle size (e.g. `1m`, `5m`, `1h`). | |
| asset_class | No | Asset class to resolve the symbol in. Defaults to `spot` (one of: spot, perp) |