Skip to main content

Set up your API key

Build faster with AI

TL;DR
Use /simple/price for live valuation, /coins/{id}/history for cost basis on purchase dates, /coins/markets for dashboard data, and /coins/{id}/market_chart for performance charts.
Replace YOUR_API_KEY in the examples below with your actual key. Get one here →

Portfolio Workflow

1

Set up currency preference — /simple/supported_vs_currencies

Fetch all supported fiat and crypto currencies to populate a currency selector in your UI.
Supported Currencies →
Pass the user’s choice as vs_currencies to pricing endpoints.
2

Live valuation — /simple/price

Poll spot prices for all holdings. Batch multiple coins in one call — minimal overhead for frequent polling.
Simple Price →
Multiply each price by your holding quantity, then sum for total portfolio value.
3

Token prices by contract — /simple/token_price/{id}

For ERC-20 and other contract-based tokens — look up prices by contract address instead of coin ID.
Simple Token Price →
For onchain tokens not listed on CoinGecko, use Onchain Simple Price — returns prices by contract address across any supported network.
4

Dashboard data — /coins/markets

Rich market data for up to 250 coins per page — rankings, sparklines, highs/lows, and multi-timeframe changes.
Coins Markets →
5

Cost basis — /coins/{id}/history

Price snapshot on a specific date — calculate cost basis for each purchase.
Coin Historical Data →
The date parameter uses dd-mm-yyyy format (not ISO). Data returned is a snapshot at 00:00:00 UTC.
6

Performance charts — /coins/{id}/market_chart

Price, market cap, and volume over time — for charting portfolio value and calculating time-weighted returns.
Coin Market Chart →
For tokens tracked by contract address, use Contract Address Market Chart — same data, queried by address instead of coin ID.