Built into AlgoGP (data)Free
Market dataCrypto No key needed

Coinbase Exchange API guide

Coinbase Exchange publishes its candles, trades and order book through a public REST API that needs no account and no key. It is the cleanest free source of crypto prices quoted in actual US dollars rather than a stablecoin, which is why AlgoGP’s generated code uses it by default for crypto.

Last verified

Quick answer

Coinbase Exchange publishes free, keyless candles at api.exchange.coinbase.com (/products/BTC-USD/candles, up to 300 per request, granularities 1m to 1d) in real US dollars. Trading is a different API: Coinbase Advanced Trade, which authenticates with CDP keys that sign a JWT per request.

Coinbase Exchange API at a glance

Pricing
Free, no key
Availability
Worldwide (market data)
Paper trading
Not applicable (data only)
Integration type
Public, no key
In AlgoGP
Built in: data adapter (Free)
Candles
GET https://api.exchange.coinbase.com/products/BTC-USD/candles
Bar sizes
1m, 5m, 15m, 1h, 6h, 1d (4h and weekly are built from these)
Per request
Up to 300 candles
History
BTC-USD from 2015; newer listings from their launch

The candles endpoint

Request /products/{product}/candles?granularity=86400&start=…&end=… with ISO-8601 start and end. granularity is in seconds and must be one of 60, 300, 900, 3600, 21600, 86400. Each row is [time, low, high, open, close, volume] — note the unusual column order — newest first.

Products use a dash: BTC-USD, ETH-USD, SOL-EUR. A window longer than 300 candles must be paged; AlgoGP’s market_data.py walks the range in 300-candle chunks and de-duplicates by timestamp.

Rate limits and caveats

  • Public endpoints are limited per IP (on the order of ten requests per second); send a User-Agent and back off on 429.
  • Minutes with no trades produce no candle, so thin pairs have gaps rather than zero-volume bars.
  • There is no 4-hour or weekly granularity; build them by aggregating 1h and 1d bars.

What about trading on Coinbase?

Placing orders goes through the Coinbase **Advanced Trade API**, authenticated with Coinbase Developer Platform keys that sign each request as a short-lived JWT. AlgoGP does not ship a Coinbase order adapter yet; pair Coinbase data with the Alpaca, Kraken or Binance broker, or extend brokers.py yourself.

Use Coinbase Exchange in AlgoGP

Open a project, go to the APIs & keys tab and, under Platforms, pick Coinbase Exchange as the market data source (market_data.py). The choice is saved to config.json as a new strategy version:

{
  "platforms": {
    "data": "coinbase",
    "broker": "alpaca"
  }
}
In-app backtests always use AlgoGP’s normalized history so results stay comparable; this choice decides what backtest.py and live.py connect to when you run the exported code.

Coinbase Exchange needs no API key: the generated code calls its public endpoints directly.

Coinbase Exchange API: frequently asked questions

Is the Coinbase price API free?

Yes. The Exchange market-data endpoints (products, candles, trades, order book) are public and free, with per-IP rate limits.

Do I need a Coinbase API key for historical data?

No. Keys are only for account data and trading. Candles need no authentication.

Why do Coinbase candles look different from Binance’s?

They are different venues: Coinbase quotes USD, Binance mostly USDT, and each has its own trades. Differences of a few basis points are normal.

Turn Coinbase Exchange data into a tested strategy

Backtest an idea in the browser, then export Python whose live loop reads candles straight from Coinbase Exchange with your own key.

  • Generated Coinbase Exchange candle fetcher, closed bars only
  • An AI copilot that writes and revises the rules
  • Pair it with Alpaca, Binance, OANDA or another broker

Free plan, no card required.

Coinbase Exchange alternatives

Independent guide. AlgoGP is not affiliated with Coinbase Exchange. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.