GET
/
coins
/
{id}
/
contract
/
{contract_address}
/
market_chart
/
range
Coin Historical Chart Data within Time Range by Token Address
curl --request GET \
  --url https://pro-api.coingecko.com/api/v3/coins/{id}/contract/{contract_address}/market_chart/range \
  --header 'x-cg-pro-api-key: <api-key>'
{
  "prices": [
    [
      1704067241331,
      42261.0406175669
    ],
    [
      1704070847420,
      42493.2764087546
    ],
    [
      1704074443652,
      42654.0731066594
    ]
  ],
  "market_caps": [
    [
      1704067241331,
      827596236151.196
    ],
    [
      1704070847420,
      831531023621.411
    ],
    [
      1704074443652,
      835499399014.932
    ]
  ],
  "total_volumes": [
    [
      1704067241331,
      14305769170.9498
    ],
    [
      1704070847420,
      14130205376.1709
    ],
    [
      1704074443652,
      13697382902.2424
    ]
  ]
}

Tips

  • You may obtain the asset platform and contract address via several ways:
    • refers to respective coin page and find ‘contract address’.
    • refers to /coins/list endpoint (include platform = true).
  • Supports ISO date strings (YYYY-MM-DD or
    YYYY-MM-DDTHH:MM, recommended for best compatibility) or UNIX timestamps.

Note

  • You may leave the interval params as empty for automatic granularity:
    • 1 day from current time = 5-minutely data
    • 1 day from any time (except current time) = hourly data
    • 2 - 90 days from any time = hourly data
    • above 90 days from any 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)
  • Data availability:
    • interval=5m: Available from 9 February 2018 onwards
    • interval=hourly: Available from 30 Jan 2018 onwards
  • Cache / Update Frequency:
    Based on days range (all the API plans)
    • 1 day = 30 seconds cache
    • 2 -90 days = 30 minutes cache
    • 90 days = 12 hours cache
    • The last completed UTC day (00:00) is available 35 minutes after midnight on the next UTC day (00:35). The cache will always expire at 00:40 UTC

Authorizations

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

Path Parameters

id
string
default:ethereum
required

asset platform ID *refers to /asset_platforms

Example:

"ethereum"

contract_address
string
default:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
required

the contract address of token

Example:

"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"

Query Parameters

vs_currency
string
default:usd
required

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

Example:

"usd"

from
string
default:2024-01-01
required

starting date in ISO date string (YYYY-MM-DD or YYYY-MM-DDTHH:MM) or UNIX timestamp. use ISO date string for best compatibility

to
string
default:2024-12-31
required

ending date in ISO date string (YYYY-MM-DD or YYYY-MM-DDTHH:MM) or UNIX timestamp. use ISO date string for best compatibility

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

The response is of type object.