Returns candlestick data for a cryptocurrency over a specified time period. Use this to build price charts and analyze price movements. Returns arrays of [timestamp, open, high, low, close] values.
From spec: Get OHLC chart (Open, High, Low, Close) data for a coin. Data granularity is automatic (cannot be adjusted): 1 day from current time = 5 minute interval data; 1 - 90 days from current time = hourly data; above 90 days from current time = daily data (00:00 UTC).
Usage Tips
- Required parameters: vs_currency (e.g., 'usd'), days (1/7/14/30/90/180/365)
- Coin ID must be a valid CoinGecko identifier (e.g., 'bitcoin', 'ethereum')
- Rate limits apply - cache data appropriately
- Data granularity depends on the days parameter
Parameters (3)
days(integer, query, required)
Data up to number of days ago (1, 7, 14, 30, 90, 180, 365)
id(string, path, required)
Coin id
vs_currency(string, query, required)
The target currency of market data
Examples (1)
Get Bitcoin OHLC data for past 7 daysprobe-gate
Demonstrates fetching candlestick/OHLC data for Bitcoin to build price charts