Coin OHLC Chart by ID
curl --request GET \
--url https://pro-api.coingecko.com/api/v3/coins/{id}/ohlc \
--header 'x-cg-pro-api-key: <api-key>'[
[
1779199200000,
76769,
76889,
76744,
76818
],
[
1779201000000,
76712,
76712,
76321,
76422
]
]Coin Charts
Coin OHLC Chart by ID
To get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin ID
GET
/
coins
/
{id}
/
ohlc
Coin OHLC Chart by ID
curl --request GET \
--url https://pro-api.coingecko.com/api/v3/coins/{id}/ohlc \
--header 'x-cg-pro-api-key: <api-key>'[
[
1779199200000,
76769,
76889,
76744,
76818
],
[
1779201000000,
76712,
76712,
76321,
76422
]
]Notes
- Find a coinβs API ID on its CoinGecko page, via Coins List, or this Google Sheet.
- The timestamp in the response indicates the close time of each OHLC candle.
- Auto-granularity (candle body):
- 1β2 days: 30 minutes
- 3β30 days: 4 hours
- 31 days and beyond: 4 days
- Paid plan subscribers can use
interval=dailyorinterval=hourly:daily: available for 1 / 7 / 14 / 30 / 90 / 180 dayshourly: available for 1 / 7 / 14 / 30 / 90 days
- For better granularity, consider Coin Historical Chart Data.
The last completed UTC day (00:00) is available 35 minutes after midnight (00:35 UTC).
SDK Examples
const response = await client.coins.ohlc.get('bitcoin', {
vs_currency: 'usd',
days: '1',
});
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.
Data up to number of days ago.
Available options:
1, 7, 14, 30, 90, 180, 365, max Data interval, leave empty for auto granularity.
Available options:
daily, hourly Decimal place for currency price value.
Available options:
full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 Response
200 - application/json
Coin OHLC chart data
Was this page helpful?
Coin Historical Chart Data within Time Range by Token AddressπΌ Coin OHLC Chart within Time Range by ID
βI

