Coinbase CDP icon

Coinbase CDP

Interact with Coinbase CDP Advanced Trade API

Public → Get Public Product Candles

AI-generated

Summary

Retrieve historical market data for a specified product from the Coinbase API based on the provided parameters.

Inputs

  • product_id (required) — The ID of the product.
  • start — The start time of the requested candles.
  • end — The end time of the requested candles.
  • granularity — The granularity (in seconds) for the candle data.
  • limit — The maximum number of candle data points to retrieve.
  • requestOptions — Additional options for the request, including batching and SSL settings.

Output shape

a list of candle data points

Returned data includes historical candles for the specified product ID within the defined time range. If 'limit' is not specified, a default maximum will be applied.

Examples

Example 1: Retrieve 50 candles for BTC-USD from the last week

Set 'product_id' to 'BTC-USD', 'start' to 'one week ago', 'end' to 'now', and 'limit' to 50.

Discussion