GET /coins/{coin_id}/ohlc
Auth X-Hub-Key from API_HUB_KEYExecute
GET /run/coingecko/coins/{coin_id}/ohlcCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing freeOHLC candles as [timestamp, open, high, low, close] rows.
Measured 2026-10-15: the documented 'interval' query parameter is rejected outright — 'daily' and 'hourly' both return HTTP 400 {'error': 'invalid interval parameter'} at days=1 and days=7. It is therefore deliberately NOT declared as a Param (the prober subs a type default when example is None and would send a bogus value). Omit interval and let the server choose; the route answers 200 for days=1/7/30. days=max is paid-tier (HTTP 401, error_code 10012).
Parameters
| name | in | type | description | |
|---|---|---|---|---|
coin_id | path | str | required | Coin id (slug). example: bitcoin |
vs_currency | query | str | required | Quote currency. default: usdexample: usd |
days | query | str1 | 7 | 14 | 30 | 90 | 180 | 365 | required | Look-back window in days. 'max' is rejected for the public tier (HTTP 401, error_code 10012 'exceeds the allowed time range', measured 2026-10-15). default: 7example: 7 |
Response
type: array
pagination: none
sample: {
"[0]": "array[5]"
}
Safe request
Reads the credential from API_HUB_KEY; it never appears in the URL.
curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/coingecko/coins/bitcoin/ohlc?vs_currency=usd&days=7"