---
name: coingecko-ingestion
description: "How to get CoinGecko data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load a CoinGecko price snapshot into pandas and Parquet

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

## Access
- Use a free Demo API key for the published Demo allowance. Put it in COINGECKO_API_KEY.
- A shared keyless public endpoint also exists, but it does not carry the Demo allowance.
- The Demo plan has no commercial license and requires attribution.

## Request
```bash
curl -H 'x-cg-demo-api-key: '$COINGECKO_API_KEY 'https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum&vs_currencies=usd&include_last_updated_at=true'
```

## Format
JSON object keyed by coin id; each value contains the requested quote currency and optional last_updated_at Unix timestamp.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""CoinGecko Demo simple-price snapshot -> pandas -> Parquet. Attribution is required."""
import os
import requests
import pandas as pd

headers = {"x-cg-demo-api-key": os.environ["COINGECKO_API_KEY"]}
params = {"ids": "bitcoin,ethereum", "vs_currencies": "usd", "include_last_updated_at": "true"}
r = requests.get("https://api.coingecko.com/api/v3/simple/price", headers=headers, params=params, timeout=30)
r.raise_for_status()
df = pd.DataFrame.from_dict(r.json(), orient="index").rename_axis("coin_id").reset_index()
df["last_updated_at"] = pd.to_datetime(df["last_updated_at"], unit="s", utc=True)
df.to_parquet("coingecko_price_snapshot.parquet", index=False)
print(len(df), "coins; updated", df["last_updated_at"].max())
```
Needs a personal API key; not run.

## Limits
- Demo: 100 calls per minute and 10,000 calls per month.
- Rate limits and monthly call limits depend on the plan.

## Quirks
- Use the Demo header x-cg-demo-api-key; paid Pro keys use a different root URL and header.
- Refresh stored or cached API data at least every 24 hours.
- Coin ids such as bitcoin are not ticker symbols.

## Terms and attribution
- The Demo plan does not include a commercial license.
- Display Powered by CoinGecko attribution.
- CoinGecko discourages storage; if data is stored, refresh it at least every 24 hours and protect it.
- Terms page: https://support.coingecko.com/articles/1043089972-what-are-the-differences-between-commercial-and-custom-licenses

## Sources
- https://www.coingecko.com/en/api/pricing: "a stable rate limit of 100 calls/min and a monthly cap of 10,000 calls"
- https://www.coingecko.com/en/api_terms: "Powered by CoinGecko"
- https://www.coingecko.com/en/api_terms: "We do not encourage caching or storage of Data."

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.
