Skip to main content
GET
/
coins
/
{id}
/
ohlc
/
range
Coin OHLC Chart within Time Range by ID
curl --request GET \
  --url https://pro-api.coingecko.com/api/v3/coins/{id}/ohlc/range \
  --header 'x-cg-pro-api-key: <api-key>'
[
  [
    1764547200000,
    90832,
    91905,
    90406,
    90406
  ],
  [
    1764633600000,
    90360,
    90360,
    83989,
    86281
  ]
]

Notes

  • Find a coin’s API ID on its CoinGecko page, via Coins List, or this Google Sheet.
  • Accepts ISO date strings (YYYY-MM-DD or YYYY-MM-DDTHH:MM, recommended) or UNIX timestamps for from and to.
  • The timestamp in the response indicates the close time of each OHLC candle.
  • Interval options:
    • daily: up to 180 days per request (180 candles)
    • hourly: up to 31 days per request (744 candles)
  • Data available from 9 February 2018 onwards.
  • For better granularity, consider Coin Historical Chart Data.

SDK Examples

const response = await client.coins.ohlc.getRange('bitcoin', {
  vs_currency: 'usd',
  from: '2025-12-01',
  to: '2025-12-31',
  interval: 'daily',
});

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

Authorizations

x-cg-pro-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 price data. *refers to /simple/supported_vs_currencies.

from
string
default:2025-12-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:2025-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>
default:daily
required

Data interval.

Available options:
daily,
hourly

Response

200 - application/json

Coin OHLC chart data within time range