Get OHLC candlestick data
get_ohlc_candlesFetch open, high, low, and close (OHLC) candlestick data for any cryptocurrency, with the candle interval automatically adjusted to your chosen time window.
Instructions
Get open/high/low/close candles for a coin. CoinGecko picks the candle width from the window: 30 minutes up to 2 days, 4 hours up to 30 days, 4 days beyond that. The chosen width is reported in the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Look-back window in days: 1, 7, 14, 30, 90, 180, 365, or 'max'. | 7 |
| coin_id | Yes | CoinGecko coin id, e.g. 'bitcoin'. | |
| vs_currency | No | Quote currency, e.g. 'usd'. | usd |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | Yes | Look-back window requested, in days. | |
| candles | Yes | Candles, oldest first. | |
| coin_id | Yes | CoinGecko coin id. | |
| vs_currency | Yes | Currency the candles are denominated in. | |
| candle_count | Yes | Number of candles returned. | |
| candle_interval | Yes | Candle width CoinGecko chose for this window. |