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.
| Item | Details |
|---|---|
| Common values | 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w; a few endpoints accept different values, as stated on each endpoint page |
| Hobbyist | 4h and above |
| Startup | 30m and above |
| Standard and above | All intervals; see the table below for minute-level history length |
| Time span | Approximately 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.
| interval | Meaning | Hobbyist | Startup | Standard | Professional |
|---|---|---|---|---|---|
1m | 1 minute | — | — | 6 days | 12 days |
3m | 3 minutes | — | — | 20 days | 40 days |
5m | 5 minutes | — | — | 30 days | 60 days |
15m | 15 minutes | — | — | 90 days | 180 days |
30m | 30 minutes | — | 90 days | 180 days | 360 days |
1h | 1 hour | — | 180 days | 360 days | 720 days |
2h | 2 hours | — | 180 days | 360 days | 720 days |
4h | 4 hours | 180 days | 180 days | 360 days | 720 days |
6h | 6 hours | 360 days | 360 days | 360 days | 720 days |
8h | 8 hours | 360 days | 360 days | 360 days | 720 days |
12h | 12 hours | 360 days | 360 days | 360 days | 720 days |
1d | 1 day | Full history | Full history | Full history | Full 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.
| Parameters | Time Span | Suited For |
|---|---|---|
interval=1h&limit=24 | Last 1 day | Intraday changes |
interval=4h&limit=42 | Last 7 days | Trends over the week |
interval=1d&limit=365 | Last 1 year | Long-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
| Field | Description |
|---|---|
time | The 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 / close | The value at the start and at the end of the interval |
high / low | The 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
- API Plans and Permissions: Historical data length for each API plan
- Timestamps and Pagination: Fetch long history in segments
- Aggregated Open Interest OHLC History: Open interest candlestick API
- Pair Price OHLC History: Futures price OHLC history
