Pair Price OHLC History

Get the price candlestick history (open, high, low, close) and trading volume of a futures trading pair on an exchange. Useful for charting price trends, technical analysis, or aligning by time with data such as open interest and funding rates.

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 interval available. 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 for the last 30 days.
Draw a candlestick chart
Have AI write code that draws a candlestick chart with trading volume.
Understand this endpoint
Have AI explain the parameters and response fields in plain language.

Want AI to query real-time data without writing code? Connect CoinGlass MCP in Claude or Cursor and ask in plain language, for example: “What were the highest and lowest prices of the BTCUSDT perpetual contract on Binance over the last 24 hours?”

Use Cases

ScenarioDescription
Price Trend ChartsGet candles for a futures 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 trading strategies.
Align with Derivatives DataAlign with Open Interest OHLC History and Funding Rate OHLC History by time to analyze how price relates to open interest and funding rates.
Compare Prices Across ExchangesGet candles for the same coin on different exchanges and compare the price differences.

Related Endpoints

EndpointHow It Differs
Open Interest OHLC HistoryOpen interest candles for the same trading pair
Funding Rate OHLC HistoryFunding rate candles for the same trading pair
Supported Exchanges and PairsLook up valid values for exchange and symbol
Spot Pair Price OHLC HistoryPrice candles for spot trading pairs

FAQ

What should I pass as symbol?

A trading pair, not a coin; for example, the BTC perpetual contract is BTCUSDT on Binance and BTC-USDT-SWAP on OKX. If the trading pair is wrong, the response has code "400" and a message saying that the trading pair does not exist on that exchange; go by what the Supported Exchanges and Pairs endpoint returns.

I passed start_time and end_time, so why does the number of records differ from limit?

When both start and end times are provided, 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.

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.

What happens if the time range is wrong?

end_time must be greater than start_time; otherwise the response has code "400", and msg also gives the earliest start_time your account is allowed, e.g., “Invalid time range: the earliest allowed start_time is 1730263925000, and end_time must be greater than start_time.”

Learn More: Futures 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 Futures Prices Differ from Spot Prices?

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. Spot candles can be obtained from Spot 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, e.g., Binance, OKX. For the exchanges you can query, see the Supported Exchanges and Pairs endpoint.

string
required
Defaults to BTCUSDT

Trading pair symbol, e.g., BTCUSDT. Exchanges write trading pairs differently; for the pairs you can query, see the Supported Exchanges and Pairs endpoint.

string
required
Defaults to 1d

Candlestick interval, 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 both start_time and end_time are provided, 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