Coinbase CDP icon

Coinbase CDP

Interact with Coinbase CDP Advanced Trade API

Products → Get Product Candles

AI-generated

Summary

Retrieve historical candlestick data for a specific product based on the specified time range and granularity.

Inputs

  • start — Start time for fetching candles, formatted as an ISO 8601 string.
  • end — End time for fetching candles, formatted as an ISO 8601 string.
  • granularity — Time interval between candlesticks, in seconds.
  • ProductID-HERE (required) — The ID of the Product to retrieve candles for.
  • requestOptions — Optional request settings like batching, timeout, and SSL handling.

Output shape

a list of candlestick data objects

The output will contain candlestick data including open, high, low, close values, and timestamps. Possible batching and timeouts are configurable.

Examples

Example 1: Fetch hourly candles for BTC-USD from the last week.

Set start to last week's date, end to now, granularity to '3600', and provide the Product ID 'BTC-USD'.

Discussion