Skip to main content
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=daily or interval=hourly:
    • daily: available for 1 / 7 / 14 / 30 / 90 / 180 days
    • hourly: 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

x-cg-pro-api-key
string
header
required

Learn how to set up your API key

Path Parameters

id
string
default:bitcoin
required

Coin ID. *refers to /coins/list.

Query Parameters

vs_currency
string
default:usd
required

Target currency of price data. *refers to /simple/supported_vs_currencies.

days
enum<string>
default:1
required

Data up to number of days ago.

Available options:
1,
7,
14,
30,
90,
180,
365,
max
interval
enum<string>

Data interval, leave empty for auto granularity.

Available options:
daily,
hourly
precision
enum<string>

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