Get the price candlestick history (open, high, low, close) and trading volume of a spot trading pair on an exchange. Useful for charting spot price trends, technical analysis, or comparing with futures prices to calculate the basis.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Available on all API plans: Hobbyist Startup Standard Professional Enterprise
The candlestick intervals you can query differ by plan; see API Plans and Available Intervals below on this page.
Response Data
data is an array; each element is one candle, and time is the start time of the interval. Prices and trading volume are returned as strings; convert them to numbers before calculating.
200 · application/json · See the response example in the right panel.
| Field | Type | Always Returned | Description |
|---|---|---|---|
code | string | Yes | Business status code; "0" means success |
msg | string | No | Result message; contains the error message when an error occurs |
data | array of object | Yes | Array of candles; each element is one candle |
data[].time | integer (int64) | Yes | Interval start time, timestamp in milliseconds (UTC) |
data[].open | string | Yes | Open price, in the trading pair's quote asset (e.g., USDT for BTCUSDT) |
data[].high | string | Yes | Highest price within the interval |
data[].low | string | Yes | Lowest price within the interval |
data[].close | string | Yes | Close price; the latest price for an interval that has not yet closed |
data[].volume_usd | string | Yes | Trading volume within the interval, in USD |
API Plans and Available Intervals
All API plans can call this endpoint; the difference is which candlestick intervals they can query: the lower the plan, the longer the shortest available interval. For the price of each plan, see API Plans.
| API Plan | Access | Available Candlestick Intervals (interval Parameter) |
|---|---|---|
| Hobbyist | ✅ Yes | 4 hours and above: 4h, 6h, 8h, 12h, 1d, 1w |
| Startup | ✅ Yes | 30 minutes and above: 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w |
| Standard | ✅ Yes | All intervals, down to 1 minute (1m) |
| Professional | ✅ Yes | All intervals, down to 1 minute (1m) |
| Enterprise | ✅ Yes | All intervals, down to 1 minute (1m) |
For how far back each interval's history can be queried, see Intervals.
Use This Endpoint with AI
Pick a task and click Open in ChatGPT or Open in Claude: the AI reads this page first and then gives you the result. You can also click Copy and paste the full prompt into the AI tool you use.
This endpoint provides data through the REST API. Use the prompts above to have AI write the request code. For the tools available through MCP, see CoinGlass MCP.
Use Cases
| Scenario | Description |
|---|---|
| Spot Price Trend Charts | Get candles for a spot trading pair on any exchange and chart its price trend and trading volume. |
| Technical Analysis and Backtesting | Use open, high, low and close data to calculate indicators such as moving averages and volatility, and backtest spot trading strategies. |
| Calculate the Basis | Align with the futures Pair Price OHLC History by time to calculate the premium or discount of futures relative to spot. |
| Compare Prices Across Exchanges | Get spot candles for the same coin on different exchanges and compare the differences in price and trading volume. |
Related Endpoints
| Endpoint | How It Differs |
|---|---|
| Pair Price OHLC History | Price candles for futures trading pairs |
| Spot Supported Exchanges and Pairs | Look up valid values for exchange and symbol |
| Spot Pair Markets | Real-time market data for a coin's spot trading pairs on each exchange |
| Spot Pair Taker Buy/Sell History | Taker buy/sell history of the same spot trading pair |
| Spot Coin Market Data History | Daily price, circulating supply and market cap of a coin |
FAQ
What should I pass as symbol?
The exchange's native format for the spot trading pair, i.e., the instrument_id returned by the Spot Supported Exchanges and Pairs endpoint, e.g., BTCUSDT on Binance, BTC-USDT on OKX and BTC-USD on Coinbase. Do not pass a coin such as BTC, and do not pass the BTC/USDT returned by Spot Pair Markets.
I passed start_time and end_time, so why does the number of records differ from limit?
When both start and end times are passed, the number of records returned is determined by the time range. For example, with interval=1h and limit=2, a time range covering 3 hours returned 3 candles.
Which data is returned if I omit the start and end times?
If both are omitted, the time range is calculated from the current time and interval × limit, and the most recent limit candles up to now are returned; if only start_time is passed, the end time is calculated as start_time + interval × limit; an end_time later than the current time is treated as the current time.
Why do the values of the last candle keep changing?
The last candle corresponds to an interval that has not yet closed; close is the current latest price.
Learn More: Spot Candlesticks (OHLC)
What Is OHLC?
OHLC stands for the Open, High, Low and Close prices within an interval; it is the basic data for drawing candlestick charts and calculating technical indicators.
How Do Spot Prices Differ from Futures Prices?
The spot price is the trade price for buying and selling the coin directly; futures prices are affected by leveraged capital and funding rates and can be higher or lower than spot prices; the difference between the two is called the basis. Futures candles can be obtained from Pair Price OHLC History.
How Much History Is Available for Each Interval?
The shortest interval you can query depends on your API plan; for the history length of each interval, see Intervals.
