Analyze onchain token and pool data across 250+ networks, track DEX OHLCV and trade history, and monitor wallet distribution with token holder charts from CoinGecko API.
Onchain analytics gives you a direct view into what’s happening on the blockchain - whether you’re tracking DEX liquidity and trading activity, analyzing token holder distribution, or building dashboards that surface real-time pool metrics across 250+ networks.This guide walks you through the CoinGecko API endpoints that matter most for DeFi and onchain analytics workflows, and ties them together into a complete workflow at the end:
Onchain token and pool data across 250+ supported networks via GeckoTerminal
DEX OHLCV, liquidity, and trade history for granular market analysis
Token holder charts to track wallet distribution and concentration over time
Estimated reading time: 12 minutes
Want to get started even faster? Copy the contents of this page from defi-onchain-analytics.md and paste it directly into your AI tool for instant context.
Navigate the API faster with AI
Install the CoinGecko SKILL to give your AI coding agent built-in knowledge of every endpoint, parameter, and workflow. Setup takes less than 3 minutes.
🔗 More endpoint details hereThe fastest way to get real-time prices for any onchain token by contract address - including tokens not yet listed on CoinGecko’s main platform. Supports querying multiple token addresses in a single call.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/simple/networks/eth/token_price/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x6b175474e89094c44da98b954eedeac495271d0f" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
network (path)
The blockchain network (e.g., eth, solana, base, arbitrum)
🔗 More endpoint details hereReturns comprehensive market data for an onchain token - price, volume, FDV, market cap, price changes across multiple timeframes, and transaction counts.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933?include=top_pools" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
network (path)
The blockchain network
address (path)
Token contract address
include
Add top_pools to see the most active pools for this token
🔗 More endpoint details hereGet rich metadata for any onchain token - description, socials, websites, and GeckoTerminal analytics score. Essential for building token profile pages or research dashboards.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/info" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Response highlights:
{ "data": { "attributes": { "name": "USD Coin", "symbol": "USDC", "coingecko_coin_id": "usd-coin", "description": "USDC is a fully collateralized US dollar stablecoin...", "websites": ["https://www.circle.com/en/usdc"], "gt_score": 92.34, "discord_url": "https://...", "twitter_handle": "circle" } }}
The coingecko_coin_id field bridges onchain data to CoinGecko’s main API - use it to cross-reference with /coins/{id} for community data, developer metrics, and more.
🔗 More endpoint details hereReturns detailed data for a specific liquidity pool - reserve (TVL), volume, price, transaction counts, and price change metrics. The core endpoint for analyzing pool health and activity.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640?include=base_token,quote_token,dex" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
address (path)
The pool contract address
include
Add base_token, quote_token, dex for full pool context
🔗 More endpoint details hereSurfaces the hottest liquidity pools across all networks - useful for spotting early DeFi momentum and new token launches gaining traction.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/trending_pools?include=base_token,dex,network&duration=24h" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
include
Add base_token, quote_token, dex, network for richer context
🔗 More endpoint details hereThe most powerful pool discovery endpoint - filter pools by volume, liquidity, age, network, DEX, and more. Ideal for building custom screeners or finding pools that match specific criteria.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/pools/megafilter?networks=eth,solana&volume_24h_usd_min=100000&reserve_usd_min=50000&sort=volume_24h_usd_desc" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
networks
Filter by specific chains (e.g., eth,solana,base)
volume_24h_usd_min / volume_24h_usd_max
Set volume thresholds to find active pools
reserve_usd_min / reserve_usd_max
Filter by liquidity depth
sort
Sort by volume_24h_usd_desc, reserve_usd_desc, h24_price_change_percent_desc, etc.
pool_age_min / pool_age_max
Filter by pool age in hours - useful for finding new pools
🔗 More endpoint details hereReturns OHLCV candle data for a specific pool - with day, hour, minute, and second timeframes and customizable aggregation periods. The foundation for DEX candlestick charts and technical analysis.Example request (5-minute candles for a Uniswap V3 ETH/USDC pool):
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv/minute?aggregate=5&limit=100¤cy=usd" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
timeframe (path)
Choose second, minute, hour, or day
aggregate
Combine candles (e.g., 5 for 5-minute, 4 for 4-hour candles)
limit
Up to 1000 data points per request
before_timestamp
Paginate backward in time for historical data
currency
usd for fiat-denominated or token for base-token denomination
🔗 More endpoint details hereSimilar to pool OHLCV, but aggregated across all pools for a given token. Use this when you want a token’s overall price action rather than a single pool’s perspective.Example request (daily candles for PEPE):
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933/ohlcv/day?aggregate=1&limit=30¤cy=usd" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
timeframe (path)
Choose second, minute, hour, or day
aggregate
Combine candles for wider timeframes
currency
usd for fiat or token for base-token denomination
Pool OHLCV reflects a single pool’s price action, while Token OHLCV aggregates across all pools for that token. Use Token OHLCV for a broader market view, and Pool OHLCV for DEX-specific analysis.
🔗 More endpoint details hereReturns the last 300 trades in the past 24 hours for a specific pool - useful for monitoring execution, analyzing trade size distribution, or triggering alerts on large swaps.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/trades?trade_volume_in_usd_greater_than=10000" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
trade_volume_in_usd_greater_than
Filter out noise - only see trades above your threshold
🔗 More endpoint details hereReturns the last 300 trades across all pools for a given token - gives you a complete picture of trading activity regardless of which pool the trade happened in.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933/trades?trade_volume_in_usd_greater_than=5000" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Key parameters:
Parameter
Why It Matters
trade_volume_in_usd_greater_than
Filter by minimum trade size in USD
Use pool trades when analyzing a specific trading venue. Use token trades when you need a cross-pool view of all trading activity for a token.
🔗 More endpoint details hereReturns the top token holders with their wallet addresses, balances, and ownership percentages. Essential for analyzing token concentration, tracking whale wallets, and assessing distribution health.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933/top_holders" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
🔗 More endpoint details hereReturns the historical holder count over time - track how the number of unique wallets holding a token changes. A rising holder count often signals growing adoption, while a declining count may indicate distribution concerns.Example request:
curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933/holders_chart?timeframe=one_month" \ -H "x-cg-pro-api-key: YOUR_API_KEY"
Combine top holders data with the holders chart for a complete distribution analysis - top holders shows current concentration, while the chart reveals the adoption trend over time.
Here’s how these endpoints fit into a typical DeFi and onchain analytics workflow:
Get token prices - Use /onchain/simple/networks/{network}/token_price/{addresses} for real-time onchain pricing
Research token fundamentals - Query token data and token info endpoints for market metrics and metadata
Discover active pools - Check /onchain/networks/trending_pools or use megafilter for custom screening
Analyze pool liquidity - Pull pool details to assess reserve depth, volume, and transaction activity
Chart price action - Fetch pool or token OHLCV for candlestick charts at any granularity
Monitor trades - Use pool or token trades endpoints to track recent swap activity
Assess token distribution - Query top holders and holders chart to evaluate concentration and adoption trends
Integrate with CoinGecko MCP Server
Connect your AI agent directly to CoinGecko’s API using our MCP server - enabling real-time crypto data queries from tools like Claude Desktop, Cursor, and more.
Have feedback or need help? Reach out to eason.lim@coingecko[dot]com