Skip to main content
GET
/
coins
/
{id}
/
market_chart
Coin Historical Chart Data by ID
curl --request GET \
  --url https://api.coingecko.com/api/v3/coins/{id}/market_chart \
  --header 'x-cg-demo-api-key: <api-key>'
{
  "prices": [
    [
      1779027899041,
      77953.82550382407
    ],
    [
      1779028199661,
      78052.87543398788
    ]
  ],
  "market_caps": [
    [
      1779027899041,
      1560631481361.8042
    ],
    [
      1779028199661,
      1562027330524.267
    ]
  ],
  "total_volumes": [
    [
      1779027899041,
      18688431751.857048
    ],
    [
      1779028199661,
      18974828816.446976
    ]
  ]
}

Notes

  • Find a coin’s API ID on its CoinGecko page, via Coins List, or this Google Sheet.
  • Auto-granularity when interval is not specified:
    • 1 day from current time = 5-minutely data
    • 2–90 days = hourly data
    • Above 90 days = daily data (00:00 UTC)
  • Override with the interval parameter:
    • daily: daily historical data
    • hourly: hourly data, up to the past 100 days
    • 5m: 5-minutely data, up to the past 10 days (Enterprise only)
The last completed UTC day (00:00) data is available 10 minutes after midnight (00:10 UTC).
Historical data via the Demo API is restricted to the past 365 days. Subscribe to a paid plan for the full range.

SDK Examples

const response = await client.coins.marketChart.get('bitcoin', {
  vs_currency: 'usd',
  days: '1',
});

console.log(JSON.stringify(response, null, 2));

Authorizations

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

Path Parameters

id
string
default:bitcoin
required

Coin ID. *refers to /coins/list.

Query Parameters

vs_currency
string
default:usd
required

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

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:
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

Coin historical chart data

prices
number[][]
required

Price data points as [timestamp, price] pairs

market_caps
number[][]
required

Market cap data points as [timestamp, market_cap] pairs

total_volumes
number[][]
required

Total volume data points as [timestamp, volume] pairs