How to use CoinMarketCap API — a practical guide

If you're here, you probably want working code in five minutes. That's exactly what this guide does.

Five steps to get started

  1. 1
    Register at pro.coinmarketcap.com for a key.
  2. 2
    Send header X-CMC_PRO_API_KEY.
  3. 3
    Call /v1/cryptocurrency/quotes/latest.

Shortest snippet that will actually run

curl -H "X-CMC_PRO_API_KEY: YOUR_KEY" \
  "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC,ETH&convert=ILS"

Common mistakes (the honest list)

Store history yourself — the basic plan returns no history.
Use convert=ILS — no manual conversion.