TL;DR
CoinGecko is one of the largest cryptocurrency data aggregators, tracking over 10,000 coins across 500+ exchanges. Their free API provides real-time and historical prices, market capitalization, trading volume, developer statistics, community metrics, and more. The demo endpoint works without any API key for basic queries — Bitcoin's current price in USD is just one call away.
Quick start: https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
No API key needed — just make a request!
How to Use This API
1. Get Current Price of a Coin
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
Returns {"bitcoin":{"usd":67543.21}}. Check multiple coins at once: ids=bitcoin,ethereum,cardano&vs_currencies=usd,eur.
2. Get Detailed Coin Data
https://api.coingecko.com/api/v3/coins/bitcoin
Returns a massive JSON object with price, market cap, volume, all-time high, developer stats (GitHub stars, forks), community stats (Twitter followers, Reddit subscribers), and more.
3. Market Chart (Last 7 Days)
https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=usd&days=7
Returns timestamped price and market cap data points for charting. days can be 1, 7, 30, 90, 180, 365, or max.
4. JavaScript — Real-time Price Tracker
async function getPrices(coins) {
const ids = coins.join(',');
const resp = await fetch(
`https://api.coingecko.com/api/v3/simple/price?ids=${ids}&vs_currencies=usd,eur`
);
return resp.json();
}
setInterval(async () => {
const prices = await getPrices(['bitcoin', 'ethereum', 'solana']);
for (const [coin, data] of Object.entries(prices)) {
console.log(`${coin}: $${data.usd} / €${data.eur}`);
}
}, 60000); // Update every minute
5. Python — Price Alert Bot
import requests
import time
def get_price(coin='bitcoin'):
url = ('https://api.coingecko.com/api/v3/simple/price'
f'?ids={coin}&vs_currencies=usd')
return requests.get(url).json()[coin]['usd']
target = 70000
while True:
price = get_price('bitcoin')
print(f"BTC: ${price:,.2f}")
if price >= target:
print(f"ALERT: Bitcoin reached ${price}!")
time.sleep(300) # check every 5 min
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
Frequently Asked Questions
- What are the rate limits without an API key?
- 10-30 calls per minute for the free demo tier. The rate limit varies by endpoint. Registering for a free API key increases this to 50 calls per minute.
- How many coins does CoinGecko track?
- Over 10,000 cryptocurrencies across 500+ exchanges. Data includes price, market cap, volume, circulating supply, and all-time highs.
- Does it support historical data?
- Yes. The
/coins/{id}/market_chartendpoint returns time-series data. The/coins/{id}/historyendpoint returns data for a specific date (date=30-12-2025format). - What's the difference between CoinGecko and CoinMarketCap?
- Both are major crypto data aggregators. CoinGecko's free tier is more generous (no key needed for basic queries) and includes additional metrics like developer activity and community stats.
- Can I get trending coins?
- Yes! Use
/api/v3/search/trendingto get the top 7 trending coins on CoinGecko's platform, based on search volume and social activity. - How do I find a coin's ID for the API?
- Use the
/api/v3/coins/listendpoint to get the complete mapping of coin names to IDs. Or use the search endpoint:/api/v3/search?query=bitcoin.
API Details
- API URL
https://api.coingecko.com/api/v3- Documentation
- www.coingecko.com/en/api/documentation
- Category
- Finance
- Authentication
- Not Required (demo tier) — free API key available for higher limits
- Geographic Coverage
- Global
What You Can Build
- Cryptocurrency portfolio tracker with real-time price updates
- Price alert system — get notified when a coin hits your target
- Trading dashboard comparing multiple coins across currencies
- Historical chart viewer for price trend analysis
- Crypto market overview — top gainers, losers, and trending coins