Get OHLCV candles for a product
Returns historical OHLCV candles for the given product, ordered oldest-first.
timeframe is the candle bucket size, not a history length.
The server picks an appropriate Coinbase Advanced Trade granularity
and a sensible lookback per timeframe so the chart shows ~100–300 candles:
timeframe | Granularity (Advanced Trade) | Candles returned | Total span |
|---|---|---|---|
1m | ONE_MINUTE | 240 | 4 hours |
5m | FIVE_MINUTE | 288 | 24 hours |
15m | FIFTEEN_MINUTE | 192 | 2 days |
1h | ONE_HOUR | 168 | 1 week |
4h | TWO_HOUR | 144 | 12 days |
1d | ONE_DAY | 90 | 3 months |
1w | ONE_DAY | 180 | ~6 months |
1M | ONE_DAY | 270 | ~9 months |
1Y | ONE_DAY | 290 | ~10 months |
Coinbase Advanced Trade caps a single response at ~300 candles and
has no native FOUR_HOUR / weekly / monthly / yearly granularity.
4h is approximated with TWO_HOUR candles, and the longer
labels use daily candles with progressively wider lookbacks.
The legacy granularity query param is accepted but ignored — the
server derives it from timeframe to prevent the two from drifting.
Authorizations
HMAC-SHA256 authentication. Sign every request and send X-API-KEY, X-API-SIGNATURE, X-API-TIMESTAMP and X-API-NONCE (see the Authentication guide). Each route also requires a specific claim on your API key (e.g. read:orders, write:orders, read:account, read:market-data).
Query Parameters
Trading pair id (e.g. BTC-USDC).
"BTC-USDC"
Candle bucket size. The server picks the Coinbase granularity and a sensible lookback for each value — see the operation description for the table.
1m, 5m, 15m, 1h, 4h, 1d, 1w, 1M, 1Y "1h"
Ignored — kept for backward compatibility. The server derives the effective granularity from timeframe. Older clients can still send a CandlesGranularity value; new code should just omit this.
ONE_MINUTE, FIVE_MINUTES, FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS, ONE_DAY, THIRTY_MINUTES, TWO_HOURS, FOUR_HOURS 