CoinbaseCollector

class src.boatwright.Data.OHLCV.Historical.CoinbaseCollector.CoinbaseCollector(quote_symbol='USD', debug=False, key=None, secret_key=None)

Collects OHLCV data from Coinbase using the official coinbase-advanced-py SDK.

Parameters:
  • quote_symbol (str) – Quote currency, e.g. “USD”

  • debug (bool) – Enable debug/verbose logging

  • key (str) – Coinbase CDP API key (defaults to value in config.json)

  • secret_key (str) – Coinbase CDP API secret (defaults to value in config.json)

collect(symbol, start, end, granularity_unit='MINUTE', verbose=False)

Makes a series of API calls to Coinbase to collect historical OHLCV data and returns it as a single pd.DataFrame.

Parameters:
  • symbol (str) – Base asset symbol, e.g. “BTC”

  • start (datetime) – Collection start datetime

  • end (datetime) – Collection end datetime

  • granularity_unit (str) – “MINUTE”, “HOUR”, or “DAY”

  • verbose (bool) – Print progress to terminal

Returns:

DataFrame with columns: timestamp, open, high, low, close, volume, datetime

Return type:

DataFrame