CoinGecko API
Comprehensive free crypto data — prices, market caps, volume and metadata for thousands of coins.
What it does
CoinGecko’s API gives you prices, market caps, volume, historical charts, coin metadata, exchange and NFT data, and global market stats for thousands of cryptocurrencies across hundreds of exchanges. It is one of the most widely used free crypto data sources.
Base URL
Authentication
The free Demo plan now requires a free API key — sign up and pass it as the x-cg-demo-api-key header (or ?x_cg_demo_api_key=). Paid Pro plans use x-cg-pro-api-key and the pro-api.coingecko.com host.
Code examples
curl -s "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum&vs_currencies=usd" \ -H "x-cg-demo-api-key: $CG_KEY"
import requests
r = requests.get(
"https://api.coingecko.com/api/v3/coins/markets",
params={"vs_currency": "usd", "order": "market_cap_desc", "per_page": 10},
headers={"x-cg-demo-api-key": KEY}, timeout=10)
for c in r.json():
print(c["symbol"], c["current_price"], c["price_change_percentage_24h"])Rate limits & quotas
Demo plan: roughly 30 calls/minute and a monthly cap around 10,000 calls. Historical range endpoints are limited to the last 365 days on Demo. Pro plans raise the rate to 500+/min and unlock full history. Cache prices — you rarely need sub-minute freshness.
Key response fields
| current_price | Latest price in the requested vs_currency |
| market_cap / total_volume | Cap and 24h volume |
| price_change_percentage_24h | 24h move, percent |
| prices[] (market_chart) | [timestamp_ms, price] pairs for charting |
| id vs symbol | Use the CoinGecko id (e.g. bitcoin), not the ticker, in requests |
Common errors
| 401 / 400 | Missing or wrong demo/pro key header. |
| 429 | Rate limit exceeded — slow down and cache. |
| 404 | Unknown coin id — look it up via /coins/list. |
| 10002 / 10005 | Plan does not permit that endpoint or date range. |
When to use it (and alternatives)
The default free choice for prices and charts when you can tolerate ~1-minute freshness. For a higher free call budget without a key see CoinPaprika; for exchange-grade real-time data use Binance or Kraken market endpoints.
FAQ
Does CoinGecko still have a no-key free tier?
No — since 2024 the free Demo plan requires a free API key. It is still free, just gated behind sign-up and a lower rate limit.
Why does my coin request return an empty object?
You probably passed a ticker (btc) instead of the CoinGecko id (bitcoin). Fetch /coins/list once and map symbols to ids.
How far back does historical data go on the free plan?
The Demo plan caps market_chart/range at the last 365 days. Full history needs a paid plan.
New to APIs?
Short guides for working with this API — and any other.