candles: Get historical rates (candles)

API: coinbase.com:coinbase-pro-api
Endpoint: /products/{product_id}/candles
Response format: application/json
Auth: none
Method: GET
Last Status: 200
Latency: 142ms

Description

Returns historical OHLCV (Open, High, Low, Close, Volume) candle data for technical analysis and charting. Use this to analyze price trends, build charts, and calculate indicators over time.

From spec: Get historic rates for a product. Rates are returned in an array of [time, low, high, open, close, volume] buckets.

Usage Tips

- Granularity options: 60, 300, 900, 3600, 21600, 86400 seconds - Each candle: [timestamp, low, high, open, close, volume] - Maximum 300 candles per request - Timestamps are Unix epoch in seconds

Parameters (4)

end (string, query, optional)

End time in ISO 8601 format

granularity (integer, query, optional)

Time slice in seconds (60, 300, 900, 3600, 21600, 86400)

Constraints: {'enum': [60, 300, 900, 3600, 21600, 86400]}

product_id (string, path, required)

Product ID (e.g., BTC-USD)

start (string, query, optional)

Start time in ISO 8601 format

Examples (1)

Get BTC-USD hourly candlestick data probe-gate

Demonstrates retrieving historical OHLCV candle data for 1-hour timeframes, useful for building price charts and technical analysis.

curl 'https://api.exchange.coinbase.com/products/BTC-USD/candles?granularity=3600'
import requests

resp = requests.get(
    "https://api.exchange.coinbase.com/products/BTC-USD/candles",
    params={
        'granularity': '3600',
    },
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("coinbase-pro")
result = api.fetch("products/{product_id}/candles", granularity=3600)

for item in result:
    print(item)
const resp = await fetch("https://api.exchange.coinbase.com/products/BTC-USD/candles?granularity=3600");
const data = await resp.json();

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-04-16 01:16:56.047507 200 142ms
2026-04-15 04:14:09.868032 200 108ms
2026-04-14 03:28:22.988697 200 277ms
2026-04-12 13:06:50.790124 200 128ms
2026-04-10 01:06:04.649191 200 86ms
2026-04-09 01:49:29.028309 200 317ms
2026-04-08 07:26:55.339211 200 150ms
2026-04-07 00:28:44.457333 200 339ms
2026-04-05 21:03:20.958578 200 2729ms