Intervals

CoinGlass historical endpoints use the interval parameter to specify the length of time each candle represents. Which intervals are available and how much history you can query depend on your API plan.

Key Facts
ItemDetails
Common values1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w; a few endpoints accept different values, as stated on each endpoint page
Hobbyist4h and above
Startup30m and above
Standard and aboveAll intervals; see the table below for minute-level history length
Time spanApproximately interval × limit

Available Values and API Plans

The interval parameter of most candle-based endpoints supports the values in the table below. A few endpoints accept a different range of values (e.g., only 1m and 5m); refer to the parameter descriptions on each endpoint page.

The number of days in the table is the longest history that API plan can query; “—” means the API plan does not support that interval.

intervalMeaningHobbyistStartupStandardProfessional
1m1 minute——6 days12 days
3m3 minutes——20 days40 days
5m5 minutes——30 days60 days
15m15 minutes——90 days180 days
30m30 minutes—90 days180 days360 days
1h1 hour—180 days360 days720 days
2h2 hours—180 days360 days720 days
4h4 hours180 days180 days360 days720 days
6h6 hours360 days360 days360 days720 days
8h8 hours360 days360 days360 days720 days
12h12 hours360 days360 days360 days720 days
1d1 dayFull historyFull historyFull historyFull history

The history length data comes from the CoinGlass API pricing page. The pricing page lists a 2-hour interval; whether an endpoint supports 2h is determined by the available values of the interval parameter on its endpoint page. History length for Enterprise can be customized as needed; see Enterprise Customization.

interval and limit Determine the Time Span

The time span returned by one request is approximately interval × limit. When you need a longer range, query in segments with start_time and end_time; see Timestamps and Pagination.

ParametersTime SpanSuited For
interval=1h&limit=24Last 1 dayIntraday changes
interval=4h&limit=42Last 7 daysTrends over the week
interval=1d&limit=365Last 1 yearLong-term research
import os
import requests

# Bitcoin market-wide open interest for the last 7 days, one candle every 4 hours
resp = requests.get(
    "https://open-api-v4.coinglass.com/api/futures/open-interest/aggregated-history",
    headers={"CG-API-KEY": os.environ["COINGLASS_API_KEY"]},
    params={"symbol": "BTC", "interval": "4h", "limit": 42},
    timeout=10,
)
print(len(resp.json()["data"]))

Candle Fields

FieldDescription
timeThe start time of the candle's interval, a timestamp in milliseconds (UTC). For example, with interval=30m, a record whose time is 15:30 represents the 15:30–16:00 interval
open / closeThe value at the start and at the end of the interval
high / lowThe highest and lowest values within the interval

The last candle corresponds to an interval that has not ended yet, so its values will keep changing. Intervals that have already ended may also be updated due to data backfilling; there is currently no uniform waiting time after which data is “final”.

FAQ

Is the interval of funding rate data the same as the settlement period?

No. interval only determines the length of time aggregated into one candle; the funding rate settlement period is set by each exchange.

Why does the response contain fewer candles than limit?

When the requested time range exceeds the history length your API plan can query, the part beyond it is not returned. Compare with the “Available Values and API Plans” table above, or see API Plans and Permissions.

Learn More About Crypto Candlestick Data

What Does OHLC Mean?

OHLC is short for Open, High, Low and Close. CoinGlass doesn't only turn prices into candles: metrics such as open interest and funding rate are also returned in OHLC form, for example in Open Interest OHLC History and Funding Rate OHLC History.

How Do I Get 1-Minute Historical Data?

Intervals from 1m to 15m require an API plan of Standard or above: Standard can query the last 6 to 90 days, and Professional the last 12 to 180 days; for longer minute-level history, contact us via Enterprise Customization.

How Far Back Can Daily Data Go?

All API plans can query the full history of daily (1d) data, which suits long-horizon backtesting, bull and bear cycle comparisons, and annual research.

Related Docs