Spot Pair Price OHLC History

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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.

Update frequencyReal-time

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.

FieldTypeAlways ReturnedDescription
codestringYesBusiness status code; "0" means success
msgstringNoResult message; contains the error message when an error occurs
dataarray of objectYesArray of candles; each element is one candle
data[].timeinteger (int64)YesInterval start time, timestamp in milliseconds (UTC)
data[].openstringYesOpen price, in the trading pair's quote asset (e.g., USDT for BTCUSDT)
data[].highstringYesHighest price within the interval
data[].lowstringYesLowest price within the interval
data[].closestringYesClose price; the latest price for an interval that has not yet closed
data[].volume_usdstringYesTrading 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 PlanAccessAvailable Candlestick Intervals (interval Parameter)
Hobbyist✅ Yes4 hours and above: 4h, 6h, 8h, 12h, 1d, 1w
Startup✅ Yes30 minutes and above: 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w
Standard✅ YesAll intervals, down to 1 minute (1m)
Professional✅ YesAll intervals, down to 1 minute (1m)
Enterprise✅ YesAll 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.

Get data with Python
Have AI write a Python function that gets the daily candles of Binance BTCUSDT spot for the last 30 days.
Calculate the spot-futures basis
Have AI write code that compares the close prices of spot and futures on the same exchange and calculates the basis.
Understand this endpoint
Have AI explain the parameters and response fields in plain language.

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

ScenarioDescription
Spot Price Trend ChartsGet candles for a spot trading pair on any exchange and chart its price trend and trading volume.
Technical Analysis and BacktestingUse open, high, low and close data to calculate indicators such as moving averages and volatility, and backtest spot trading strategies.
Calculate the BasisAlign with the futures Pair Price OHLC History by time to calculate the premium or discount of futures relative to spot.
Compare Prices Across ExchangesGet spot candles for the same coin on different exchanges and compare the differences in price and trading volume.

Related Endpoints

EndpointHow It Differs
Pair Price OHLC HistoryPrice candles for futures trading pairs
Spot Supported Exchanges and PairsLook up valid values for exchange and symbol
Spot Pair MarketsReal-time market data for a coin's spot trading pairs on each exchange
Spot Pair Taker Buy/Sell HistoryTaker buy/sell history of the same spot trading pair
Spot Coin Market Data HistoryDaily 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.

Query Params
string
required
Defaults to Binance

Exchange name, required, e.g., Binance, OKX, Coinbase. For the exchanges you can query, see the key names returned by the Spot Supported Exchanges and Pairs endpoint.

string
required
Defaults to BTCUSDT

Spot trading pair, required, e.g., BTCUSDT. Pass the instrument_id listed under that exchange in the Spot Supported Exchanges and Pairs endpoint; exchanges write pairs differently, e.g., BTC-USDT on OKX and BTC-USD on Coinbase.

string
required
Defaults to 1d

Candlestick interval, required, e.g., 1h. Options: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w. The shortest interval you can use depends on your API plan: 4h for Hobbyist, 30m for Startup, and 1m for Standard and above.

int32
≤ 1000
Defaults to 1000

Number of candles to return; default 1000, accepts 1–1000. When you pass both start_time and end_time, the number of records returned is determined by the time range and does not necessarily equal limit.

int64

Start time, timestamp in milliseconds (UTC), e.g., 1790812800000 (2026-10-01 00:00 UTC). The time of the returned candles satisfies start_time ≤ time < end_time: the start time is included and the end time is excluded.

int64

End time, timestamp in milliseconds (UTC), e.g., 1792022400000 (2026-10-15 00:00 UTC). The time of the returned candles satisfies start_time ≤ time < end_time: the start time is included and the end time is excluded. For example, with interval=1d, the two example times above return 14 candles, from October 1 to October 14.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json