---
name: coinmarketcap-ingestion
description: "How to get CoinMarketCap data into a pandas DataFrame in memory (the provider's terms limit storage or leave it unclear): access, the request, the format, limits, quirks and terms."
---

# Analyze a CoinMarketCap quote response in memory

Source entry: https://signal-lab-jet.vercel.app/datasets/coinmarketcap
Provider: https://coinmarketcap.com
Checked against the provider's documentation: 2026-10-29

## Access
- A Basic API key is required for this snippet. Put it in COINMARKETCAP_API_KEY.
- CoinMarketCap also runs a public API that needs no key; this skill uses the keyed Basic API.

## Request
```bash
curl -H 'X-CMC_PRO_API_KEY: '$COINMARKETCAP_API_KEY 'https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest?symbol=BTC,ETH&convert=USD'
```

## Format
JSON: status metadata plus data keyed by symbol; v2 can return a list for each symbol, and quote is keyed by conversion currency.

## Load into pandas (in memory)
Needs Python 3 with requests and pandas. The provider's terms limit storage or leave it unclear, so this snippet does not write a file.
```python
"""CoinMarketCap latest quotes -> pandas in memory. Check your plan before storage or display."""
import os
import requests
import pandas as pd

headers = {"X-CMC_PRO_API_KEY": os.environ["COINMARKETCAP_API_KEY"]}
params = {"symbol": "BTC,ETH", "convert": "USD"}
r = requests.get("https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest",
                 headers=headers, params=params, timeout=30)
r.raise_for_status()
body = r.json()
rows = []
for symbol, assets in body["data"].items():
    for asset in assets:
        rows.append({"id": asset["id"], "symbol": symbol,
                     "price_usd": asset["quote"]["USD"]["price"],
                     "last_updated": asset["quote"]["USD"]["last_updated"]})
df = pd.DataFrame(rows)
df["last_updated"] = pd.to_datetime(df["last_updated"], utc=True)
print(len(df), "quotes; credits", body["status"].get("credit_count"))
```
Needs a personal API key; not run.

## Limits
- Basic: 15,000 call credits per month and 50 requests per minute.
- Endpoints consume call credits; one HTTP request need not equal one credit.

## Quirks
- The snippet does not persist the response.
- Use the numeric id when a ticker symbol is ambiguous.
- The response status object reports credit_count.

## Terms and attribution
- The API pricing table lists the free Basic plan's license as "Commercial use".
- CoinMarketCap's general site terms limit use to personal, non-commercial use unless a separate agreement applies, so read the API terms for your plan before you rely on either.
- API permissions, attribution, caching and display depend on the API agreement and plan; check them before persisting or publishing data.
- Terms page: https://pro.coinmarketcap.com/user-agreement-commercial/

## Sources
- https://coinmarketcap.com/api/pricing/: "60+ 15,000 — Basic email Commercial use 1 50 requests per minute 60 seconds"
- https://coinmarketcap.com/api/pricing/: "Explore CoinMarketCap's API with our free plan by signing up, or just use our public API that doesn't require an API key."
- https://coinmarketcap.com/terms/: "strictly for your personal, non-commercial use unless you enter into a separate agreement with us for your commercial use"

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
