Query the chain · OHLC API
Bitcoin OHLC API for OHLCV candles and price history
GET /v1/price/ohlcv returns Bitcoin OHLCV candles at 1d and 1h from 18 August 2011, in JSON or CSV, with every day starting at 00:00 UTC.
REST API · SQL · dashboards · address history from genesis
BTC
Balance trail
informational on-chain data · not financial advice
Every candle comes from one USD spot order book, never stitched from several venues, and is labeled by the start of its bucket. Each row carries time, timestamp, open, high, low, close, volume_btc and a closed flag, so the still-forming candle is never mistaken for a final one. One call returns up to 10,000 candles for 10 credits, which is more than a year of hourly data. The same series sits in SQL as the price_candles table, next to blocks, transactions, inputs and outputs, so you can join a day close to that day exchange inflows, active addresses or realized price in one query. This is informational market and on-chain data, not a trading signal or investment advice.
History from genesis queryable in seconds
On-chain data not financial advice
Why it works
What you get with OHLC API
Daily and hourly candles since 2011
Ask for interval=1d or interval=1h with from and to as a unix timestamp or an ISO date, and set limit up to 10,000. Days start at 00:00 UTC, so a daily close never shifts by 16 hours the way a UTC+8 exchange default does. Resample hourly rows to four hours or a week yourself from one consistent series.
Joined to the chain
Because candles and the indexed chain share one schema, you can join a day close to that day exchange flows, active addresses, realized price or supply in profit in a single SQL query, instead of reconciling two separate feeds.
Backfill and keep current
Fifteen years of daily candles fit in one call, and a year of hourly candles in another. The series refreshes twice an hour, and the closed flag tells you whether the latest candle is final. Your plan sets the history window: Developer reads one year back, Growth and above read back to August 2011.
Side by side
Which Bitcoin daily candle endpoints do not use a UTC day, tested 1 September 2026
We called 18 public daily-candle endpoints from one machine on 1 September 2026 and read the raw start timestamp of every candle rather than trusting its date label. Four of them do not return a UTC day at all: they start at 16:00 UTC, which is midnight in UTC+8. Every one of those four returns HTTP 200 and a column named close. Rows are the close for the UTC day of 30 August 2026, a fully closed day.
| Endpoint and parameter | Candle starts | Close for 30 Aug 2026 | Same date vs Binance 1d | UTC-day option |
|---|---|---|---|---|
| Bitstamp btcusd, step=86400 | 00:00 UTC | 77,701.70 | top of band | default |
| MEXC BTCUSDT, interval=1d | 00:00 UTC | 77,699.42 | inside | default |
| Gemini btcusd, 1day | 00:00 UTC | 77,698.53 | inside | default |
| KuCoin BTC-USDT, type=1day | 00:00 UTC | 77,687.50 | inside | default |
| Bitfinex tBTCUSD, trade:1D | 00:00 UTC | 77,684.00 | inside | default |
| Gate.io BTC_USDT, interval=1d | 00:00 UTC | 77,683.40 | inside | default |
| Binance BTCUSDT, interval=1d | 00:00 UTC | 77,682.00 | reference row | default |
| Kraken XBTUSD, interval=1440 | 00:00 UTC | 77,681.60 | inside | default |
| Bitget BTCUSDT, granularity=1Dutc | 00:00 UTC | 77,681.00 | inside | this is the fix |
| OKX BTC-USDT, bar=1Dutc | 00:00 UTC | 77,677.70 | inside | this is the fix |
| Crypto.com BTC_USD, timeframe=1D | 00:00 UTC | 77,677.62 | inside | default |
| Bybit BTCUSDT, interval=D | 00:00 UTC | 77,676.70 | inside | default |
| Coinbase BTC-USD, granularity=86400 | 00:00 UTC | 77,665.14 | bottom of band | default |
| HTX btcusdt, period=1dayutc | 00:00 UTC | 77,631.18 | 33.96 below the band | this is the fix |
| OKX BTC-USDT, bar=1D | 16:00 UTC | 78,588.50 | 906.50 above (1.167%) | yes, bar=1Dutc |
| BingX BTC-USDT, interval=1d | 16:00 UTC | 78,580.42 | 898.42 above (1.157%) | none exists |
| Bitget BTCUSDT, granularity=1day | 16:00 UTC | 78,575.00 | 893.00 above (1.150%) | yes, granularity=1Dutc |
| HTX btcusdt, period=1day | 16:00 UTC | 78,506.71 | 824.71 above (1.062%) | yes, period=1dayutc |
Thirteen of the fourteen UTC-aligned rows sit inside a band 36.56 USD wide, a spread of 4.7 basis points on a roughly 77,700 USD asset. So the four shifted rows are wrong by roughly 25 times the entire disagreement between every independent order book we could reach. The error also does not calibrate away, because it is a 16-hour phase shift rather than a level shift: on 31 August the same four rows flipped sign and sat 661.86 to 739.95 USD BELOW Binance. The spelling of the fix is inconsistent across venues, and Bitget rejects granularity=1dutc with HTTP 400 while accepting granularity=1Dutc. BingX has no UTC-day option at all: its error response enumerates 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w and 1M. HTX runs about 0.05 percent below the pack on both of its endpoints, which is a genuine venue difference rather than a boundary artifact.
What it handles
The indexed Bitcoin chain, queryable your way
Look up an address, a transaction, a UTXO, the rich list or an on-chain metric, by REST API, SQL or dashboard. The same authoritative data, reconciled block-by-block against the canonical chain, without running a node.
- Fetch OHLCV candles at daily and intraday intervals
- Backfill full price history for a backtest or model
- Join a day close to on-chain metrics in one SQL query
- Resample candles to any timeframe you need
- Read the latest candles over REST for live charts
GET /v1/address/{addr}
query result
{
"address": "bc1qxy2k…l0wdv8",
"balance_btc": 68432.10,
"balance_usd": 4612165420,
"tx_count": 1284,
"unspent_outputs": 37,
"first_seen": "2014-02-09"
}
Why BitcoinDatabase
One platform, queryable three ways
Not a raw node to sync, not an indexer to build, and not five vendors to stitch together. The fully-indexed Bitcoin blockchain, available as a REST API, as SQL, and as dashboards, on one authoritative dataset.
REST API
Typed JSON for addresses, transactions, balances, UTXOs and metrics. Drop it into apps, wallets, explorers and agents with curl, Python or any HTTP client.
SQL access
Run SQL directly against the indexed Bitcoin dataset for ad-hoc analysis, cohorts and exports, the same data the API and dashboards read from.
Compliance-first
Informational on-chain data and analytics only. Entity labels and flow tracing are framed as tooling to support a regulated team's own review, not accusations.
Good questions
Questions about OHLC API
Explore more
More ways to query Bitcoin with BitcoinDatabase
Bitcoin historical data API
Full-depth history: every block, transaction and metric back to 2009.
Learn moreBitcoin transaction volume
Raw, change-adjusted and entity-adjusted on-chain volume series from the indexed chain.
Learn moreBitcoin active addresses
Daily active address counts, historical series and entity-adjusted numbers from the indexed chain.
Learn moreQuery the Bitcoin blockchain with SQL
Write plain SQL against the whole indexed chain, no node, no ETL.
Learn moreBitcoin address balance history API
What an address held on any past date, not just what it holds now.
Learn moreOn-chain metrics
Active addresses, realized cap, SOPR, HODL waves and exchange flows.
Learn moreBuyer guides and measurements on this topic
Stop running a node. Just query Bitcoin.
Run your first query now and get on-chain data back by REST API, SQL or dashboard, with address history back to the genesis block over REST. Informational on-chain data only, not financial advice.
History from genesis over REST · SQL · dashboards · addresses, transactions, UTXOs, metrics