CoinMarketCapCoinMarketCap
PricingAPI StatusGet an API Key

© 2026 CoinMarketCap. All rights reserved.

xgithub
  • Overview
  • API Reference
  • AI Agent Hub
  • Changelog
  • FAQ

Get Historical Price Data with the CoinMarketCap API

Use this workflow when you need historical market data for charts, analytics, or backtesting.

Choose the right endpoint

  • Use GET /v3/cryptocurrency/quotes/historical when you want a historical quote series
  • Use GET /v2/cryptocurrency/ohlcv/historical when you need candlestick data with open, high, low, close, and volume

Historical quotes example

This example fetches the last 7 daily quote points for Bitcoin in USD.

TerminalCode
curl -G 'https://pro-api.coinmarketcap.com/v3/cryptocurrency/quotes/historical' \ --data-urlencode 'id=1' \ --data-urlencode 'count=7' \ --data-urlencode 'interval=daily' \ --data-urlencode 'convert=USD' \ -H 'Accept: application/json' \ -H 'X-CMC_PRO_API_KEY: YOUR_API_KEY'

Use this when you want a time series of quote snapshots.

OHLCV example

This example fetches 7 daily OHLCV candles for Bitcoin in USD.

TerminalCode
curl -G 'https://pro-api.coinmarketcap.com/v2/cryptocurrency/ohlcv/historical' \ --data-urlencode 'id=1' \ --data-urlencode 'time_period=daily' \ --data-urlencode 'count=7' \ --data-urlencode 'convert=USD' \ -H 'Accept: application/json' \ -H 'X-CMC_PRO_API_KEY: YOUR_API_KEY'

Use this when you need chart-ready candle data with open, high, low, close, and volume.

What to choose

  • Choose quotes/historical for historical snapshots and simpler price-series workflows
  • Choose ohlcv/historical for candlestick charts and technical-analysis pipelines

Common mistakes

  • Using OHLCV when all you need is a simpler historical quote series
  • Forgetting to specify count when you are not sending an explicit time window
  • Using symbol in production when id would be more stable

Good next steps

  • Use /v1/cryptocurrency/map if you need to look up stable IDs first
  • Use Get latest crypto prices if you only need the current state
  • Use Choose an endpoint if you want to compare historical paths with other market-data workflows
On this page
  • Choose the right endpoint
  • Historical quotes example
  • OHLCV example
  • What to choose
  • Common mistakes
  • Good next steps