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>'
[
  [
    1709395200000,
    61942,
    62211,
    61721,
    61845
  ],
  [
    1709409600000,
    61828,
    62139,
    61726,
    62139
  ],
  [
    1709424000000,
    62171,
    62210,
    61821,
    62068
  ]
]

Tips

  • You may obtain the coin ID (API ID) via several ways:
    • refers to respective coin page and find β€˜API ID’.
    • refers to /coins/list endpoint.
    • refers to Google Sheets here.
  • For historical chart data with better granularity, you may consider using /coins/{id}/market_chart endpoint.

Note

  • The timestamp displayed in the payload (response) indicates the end (or close) time of the OHLC data.
  • Data granularity (candle’s body) is automatic:
    • 1 - 2 days: 30 minutes
    • 3 - 30 days: 4 hours
    • 31 days and beyond: 4 days
  • Cache / Update Frequency:
    • Every 15 minutes for all the API plans
    • The last completed UTC day (00:00) is available 35 minutes after midnight on the next UTC day (00:35).
  • Exclusive daily and hourly candle interval parameter for all paid plan subscribers (interval = daily, interval=hourly)
    • β€˜daily’ interval is available for 1 / 7 / 14 / 30 / 90 / 180 days only.
    • β€˜hourly’ interval is available for 1 / 7 / 14 / 30 / 90 days only.

Authorizations

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

Path Parameters

id
string
default:bitcoin
required

coin ID *refers to /coins/list.

Example:

"bitcoin"

Query Parameters

vs_currency
string
default:usd
required

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

Example:

"usd"

days
enum<string>
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

Get coin's OHLC

The response is of type number[][].

⌘I