TL;DR
Use /simple/price for real-time portfolio valuation, /coins/{id}/history for cost basis on specific dates, /coins/markets for bulk market data, /coins/{id}/market_chart for historical performance charts, and /simple/supported_vs_currencies to power multi-currency reporting.Portfolio tracking starts with accurate, up-to-date pricing — whether you’re building a personal dashboard, a multi-wallet aggregator, or a tax reporting tool that needs historical cost basis calculations. This guide walks you through the CoinGecko API endpoints that matter most for portfolio tracking workflows, and ties them together into a complete workflow at the end:
- Real-time prices and market cap to value your holdings across 35M+ coins
- Historical snapshots to calculate cost basis and unrealized gains over time
- Multi-currency support across fiat and crypto pairs for global reporting
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.
Endpoint Overview
| Endpoint | What It Gives You | Best For |
|---|---|---|
| /simple/price | Real-time prices with optional market cap, volume, and 24h change | Live portfolio valuation |
| /simple/token_price/{id} | Token prices by contract address | Tracking ERC-20 and other contract-based tokens |
| /coins/markets | Bulk market data for multiple coins in a single call | Portfolio dashboard with rankings and sparklines |
| /coins/{id}/history | Price snapshot on a specific date | Cost basis calculation on purchase dates |
| /coins/{id}/market_chart | Price, market cap, and volume over a given number of days | Historical performance charts |
| /coins/../contract/../market_chart | Chart data by token contract address over a given number of days | Performance tracking for tokens by address |
| /simple/supported_vs_currencies | Full list of supported fiat and crypto currencies | Multi-currency portfolio reporting |
| /onchain/simple/networks/../token_price/.. | Onchain token prices across any supported network | Tracking DEX tokens not listed on CoinGecko |
Replace
Don’t have one yet? Get your API key here.
YOUR_API_KEY in the examples below with your actual CoinGecko API key.Don’t have one yet? Get your API key here.
Real-Time Portfolio Valuation — /simple/price
🔗 More endpoint details here
The fastest way to value your holdings. Query multiple coins in a single request and get prices alongside market cap and 24h changes — everything you need for a live portfolio view.
Example request:
| Parameter | Why It Matters |
|---|---|
ids / symbols | Query by CoinGecko ID or ticker symbol — batch multiple coins in one call |
vs_currencies | Get prices in multiple currencies simultaneously (e.g., usd,eur,btc) |
include_market_cap | Display market cap alongside each holding |
include_24hr_change | Show daily gain/loss percentage per asset |
precision | Control decimal precision for display formatting |
Token Prices by Contract Address — /simple/token_price/{id}
🔗 More endpoint details here
When your portfolio includes ERC-20 tokens or other contract-based assets, you can look up prices directly by contract address — no need to know the CoinGecko ID.
Example request:
| Parameter | Why It Matters |
|---|---|
id (path) | The asset platform (e.g., ethereum, polygon-pos, solana) |
contract_addresses | Comma-separated token contract addresses |
vs_currencies | Target currencies for pricing |
include_market_cap | Useful for weighting tokens in your portfolio |
Bulk Market Data — /coins/markets
🔗 More endpoint details here
When you need more than just prices — market cap rankings, 24h highs/lows, sparkline charts, and multi-timeframe price changes — this endpoint delivers everything in one call for up to 250 coins per page.
Example request:
| Parameter | Why It Matters |
|---|---|
ids | Filter to only your portfolio coins — avoids fetching unnecessary data |
sparkline | Includes 7-day sparkline data for inline mini-charts |
price_change_percentage | Include 1h,24h,7d,30d for multi-timeframe performance at a glance |
per_page | Up to 250 results per page — reduces the number of calls needed |
Cost Basis Calculation
/coins/{id}/history
🔗 More endpoint details here
Returns a price snapshot for a specific date — exactly what you need to calculate cost basis on the date you purchased an asset.
Example request (Bitcoin price on January 15, 2024):
| Parameter | Why It Matters |
|---|---|
date | The historical date in dd-mm-yyyy format |
localization | Set to false to reduce response size |
The
For example, January 15, 2024 is
date parameter uses dd-mm-yyyy format (not ISO format).For example, January 15, 2024 is
15-01-2024./coins/{id}/market_chart
🔗 More endpoint details here
When you need continuous historical data — for example, to chart your portfolio’s value over time or calculate time-weighted returns. Just pass a days parameter and get the full latest data directly, similar to CoinGecko’s web charts.
Example request:
| Parameter | Why It Matters |
|---|---|
days | Lookback window: 1, 7, 14, 30, 90, 180, 365, or max |
vs_currency | Target currency for the historical data |
interval | Use daily for consistent day-level data points, or leave empty for auto granularity |
Multi-Currency Support — /simple/supported_vs_currencies
🔗 More endpoint details here
Returns the full list of supported fiat and crypto currencies you can use as the vs_currencies parameter across all pricing endpoints. Essential for building currency selectors in your portfolio UI.
Example request:
vs_currencies to /simple/price or vs_currency to /coins/markets.
Putting It All Together
Here’s how these endpoints fit into a typical portfolio tracking workflow:- Set up currency preference — Query
/simple/supported_vs_currenciesto populate a currency selector - Import holdings — Use
/coins/marketsor/simple/priceto validate and price initial holdings - Live valuation — Poll
/simple/pricewith all your coin IDs for real-time portfolio value - Calculate cost basis — Use
/coins/{id}/historyto look up prices on each purchase date - Chart performance — Pull
/coins/{id}/market_chartto plot portfolio value over time - Track DeFi tokens — Use
/simple/token_price/{id}or the onchain simple price endpoint for contract-based assets
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

