Coin OHLC Chart within Time Range by ID
curl --request GET \
--url https://pro-api.coingecko.com/api/v3/coins/{id}/ohlc/range \
--header 'x-cg-pro-api-key: <api-key>'[
[
1764547200000,
90832,
91905,
90406,
90406
],
[
1764633600000,
90360,
90360,
83989,
86281
]
]Coin Charts
Coin OHLC Chart within Time Range by ID
To get the OHLC chart (Open, High, Low, Close) of a coin within a range of timestamp based on particular coin ID
GET
/
coins
/
{id}
/
ohlc
/
range
Coin OHLC Chart within Time Range by ID
curl --request GET \
--url https://pro-api.coingecko.com/api/v3/coins/{id}/ohlc/range \
--header 'x-cg-pro-api-key: <api-key>'[
[
1764547200000,
90832,
91905,
90406,
90406
],
[
1764633600000,
90360,
90360,
83989,
86281
]
]Notes
- Find a coinβs API ID on its CoinGecko page, via Coins List, or this Google Sheet.
- Accepts ISO date strings (
YYYY-MM-DDorYYYY-MM-DDTHH:MM, recommended) or UNIX timestamps forfromandto. - The timestamp in the response indicates the close time of each OHLC candle.
- Interval options:
daily: up to 180 days per request (180 candles)hourly: up to 31 days per request (744 candles)
- Data available from 9 February 2018 onwards.
- For better granularity, consider Coin Historical Chart Data.
SDK Examples
const response = await client.coins.ohlc.getRange('bitcoin', {
vs_currency: 'usd',
from: '2025-12-01',
to: '2025-12-31',
interval: 'daily',
});
console.log(JSON.stringify(response, null, 2));
Authorizations
headerAuthqueryAuth
Learn how to set up your API key
Path Parameters
Coin ID.
*refers to /coins/list.
Query Parameters
Target currency of price data.
*refers to /simple/supported_vs_currencies.
Starting date in ISO date string (YYYY-MM-DD or YYYY-MM-DDTHH:MM) or UNIX timestamp.
Use ISO date string for best compatibility.
Ending date in ISO date string (YYYY-MM-DD or YYYY-MM-DDTHH:MM) or UNIX timestamp.
Use ISO date string for best compatibility.
Data interval.
Available options:
daily, hourly Response
200 - application/json
Coin OHLC chart data within time range
Was this page helpful?
βI

