GET
/
coins
/
{id}
/
market_chart
Coin Historical Chart Data by ID
curl --request GET \
  --url https://pro-api.coingecko.com/api/v3/coins/{id}/market_chart \
  --header 'x-cg-pro-api-key: <api-key>'
{
  "prices": [
    [
      1711843200000,
      69702.3087473573
    ],
    [
      1711929600000,
      71246.9514406015
    ],
    [
      1711983682000,
      68887.7495158568
    ]
  ],
  "market_caps": [
    [
      1711843200000,
      1370247487960.09
    ],
    [
      1711929600000,
      1401370211582.37
    ],
    [
      1711983682000,
      1355701979725.16
    ]
  ],
  "total_volumes": [
    [
      1711843200000,
      16408802301.8374
    ],
    [
      1711929600000,
      19723005998.215
    ],
    [
      1711983682000,
      30137418199.6431
    ]
  ]
}

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.
  • You may use tools like epoch converter to convert human readable date to UNIX timestamp.

Note

  • You may leave the interval params as empty for automatic granularity:
    • 1 day from current time = 5-minutely data
    • 2 - 90 days from current time = hourly data
    • above 90 days from current time = daily data (00:00 UTC)
  • For non-Enterprise plan subscribers who would like to get hourly data, please leave the interval params empty for auto granularity.
  • The 5-minutely and hourly interval params are also exclusively available to Enterprise plan subscribers, bypassing auto-granularity:
    • interval=5m: 5-minutely historical data (responses include information from the past 10 days, up until now).
    • interval=hourly: hourly historical data (responses include information from the past 100 days, up until now).
  • Cache / Update Frequency:
    • Every 30 seconds for all the API plans (for last data point).
    • The last completed UTC day (00:00) data is available 10 minutes after midnight on the next UTC day (00:10).

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 market data *refers to /simple/supported_vs_currencies.

Example:

"usd"

days
string
default:1
required

data up to number of days ago You may use any integer or max for number of days

interval
enum<string>

data interval, leave empty for auto granularity

Available options:
5m,
hourly,
daily
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 historical market data include price, market cap, and 24hr volume (granularity auto)

prices
number[][]
market_caps
number[][]
total_volumes
number[][]