Skip to main content

Set up your API key

Build faster with AI

TL;DR
Use /coins/{id}/history for point-in-time tax event prices, /coins/{id}/market_chart/range for historical time series, /coins/{id}/ohlc/range for OHLC benchmarks, and /simple/price with include_last_updated_at for timestamped NAV snapshots.
Replace YOUR_API_KEY in the examples below with your actual key. Get one here →

Pipeline Setup

1

Map assets — /coins/list

Build a lookup table mapping your internal identifiers to CoinGecko coin IDs and contract addresses.
Coins List →
2

Validate currencies — /simple/supported_vs_currencies

Confirm your reporting currencies are supported before building queries.
Supported Currencies →
Cache this list at pipeline startup. Unsupported currencies return empty results without an error.

Historical Data

1

Tax event prices — /coins/{id}/history

Fair market value at a specific date — the core endpoint for tax reporting and trade reconciliation.
Coin Historical Data →
Prices are returned in all supported fiat currencies simultaneously — no separate calls needed for multi-jurisdiction reports.
The date parameter uses dd-mm-yyyy format (not ISO). Data is a snapshot at 00:00:00 UTC.
2

Historical time series — /coins/{id}/market_chart/range

Price, market cap, and volume as [timestamp, value] arrays for a custom date range — maps directly to database columns.
Market Chart Range →
For tokens tracked by contract address, use Contract Market Chart Range — same schema, queried by address instead of coin ID.
3

OHLC benchmarks — /coins/{id}/ohlc/range

Daily or hourly OHLC candles for a custom date range — use closing price as end-of-day valuation, or open/close spread for volatility reporting.
OHLC Range →
Response format: [timestamp, open, high, low, close] — consistent five-element arrays.
For simpler lookbacks without custom date ranges, use /coins/{id}/ohlc with a days parameter.

Daily Snapshots

1

Timestamped NAV — /simple/price

Current prices with last_updated_at — the audit timestamp confirming when CoinGecko last updated the price.
Simple Price →
Schedule this call daily for end-of-day NAV records.