BitcoinDatabase.com
All posts
Buyer guides

Best Bitcoin OHLCV Data API for Backtesting and Quant Research

We pulled the same Bitcoin daily candle from nine public sources in one minute. Seven venues agreed to within 36.56 USD, or 4.7 basis points. One parameter on one exchange moved the same date 886.80 USD, and both calls returned HTTP 200.

By the BitcoinDatabase team

September 2026 · 8 min read

Query Console
btc
try:

Hit Run to query the fully-indexed Bitcoin blockchain.

BTC

30-day trend

informational on-chain data · not financial advice

REST API · SQL · dashboards, one indexed dataset. Querying the indexed Bitcoin blockchain ...

The short answer

Pick one Bitcoin OHLCV source and never mix two, because the exchanges barely disagree and the day boundary does. We pulled the same daily candle from nine public sources on 1 September 2026: seven venues that start the day at 00:00 UTC closed the 30 August 2026 candle inside a band 36.56 USD wide, a spread of 4.7 basis points on a roughly 77,700 USD asset. Change one parameter on a single venue, OKX bar=1D instead of bar=1Dutc, and the close for that same date moves 886.80 USD, about 24 times the entire disagreement between all seven order books. Both requests return HTTP 200. Nothing warns you.

If you are buying a Bitcoin OHLCV feed for a backtest, the question you are probably asking is which provider has the most accurate prices. It is the wrong question. We measured it, and at daily resolution the accuracy differences between major venues are so small that they will not decide anything about your strategy. What will decide things is a class of bug that no vendor comparison chart covers, because it is not about price at all: it is about what a row means.

What we measured

On 1 September 2026 we called ten public candle endpoints from one machine within the same minute and asked each for recent daily BTC candles. Nine returned HTTP 200. We then normalized every response to UTC calendar days and compared the fully closed day of 30 August 2026. The sources were Binance (both the USDT and USDC pairs), Coinbase, Kraken, Bitstamp, Bybit, Gemini, OKX, CoinGecko and CryptoCompare.

The first result is the boring one, and it is genuinely good news. Seven of those venues start their daily candle at exactly 00:00:00 UTC, and they agree closely:

Source and parameterCandle startsClose, UTC 30 Aug 2026Response time
Bitstamp BTC/USD, step=8640000:00 UTC77,701.700.597 s
Gemini BTCUSD, 1day00:00 UTC77,698.530.679 s
Binance BTCUSDC, interval=1d00:00 UTC77,682.540.276 s
Binance BTCUSDT, interval=1d00:00 UTC77,682.000.386 s
Kraken XBTUSD, interval=144000:00 UTC77,681.600.057 s
OKX BTC-USDT, bar=1Dutc00:00 UTC77,677.700.305 s
Bybit BTCUSDT, interval=D00:00 UTC77,676.700.261 s
Coinbase BTC-USD, granularity=8640000:00 UTC77,665.140.025 s
OKX BTC-USDT, bar=1D16:00 UTC78,588.500.305 s
CoinGecko /coins/bitcoin/ohlc, days=7no daily bucket existsnot returned0.159 s
CryptoCompare /data/v2/histodayn/aHTTP 401 without a key0.016 s

Excluding the two shaded rows, the closes span 77,665.14 to 77,701.70. That is 36.56 USD, or 4.7 basis points. We checked two more closed days and got the same picture: 18.20 USD on 29 August and 31.49 USD on 31 August. The widest disagreement on any single field across all three days was the daily low on 31 August, at 136.70 USD or 17.7 basis points, and that is expected, because a low is one order book's worst single fill rather than a consensus price. Opens and closes cluster tightly because they are struck at a moment when arbitrage has had all day to work.

One more detail worth recording, since people ask: on the same exchange and the same day, Binance BTCUSDT closed at 77,682.00 and BTCUSDC at 77,682.54. Fifty four cents. The quote asset is not your problem.

Why is my OKX daily Bitcoin candle different from Binance?

Because OKX bar=1D does not return a UTC day. We read the raw timestamps rather than trusting the labels, and every OKX daily candle begins at 16:00:00 UTC, which is midnight in UTC+8. Its "30 August" candle covers 30 August 16:00 UTC through 31 August 16:00 UTC, a window that overlaps a Binance 30 August candle by only eight hours.

The size of the resulting error, comparing OKX bar=1D against Binance interval=1d under the same date string, was 594.10 USD on 29 August (0.759 percent), 906.50 USD on 30 August (1.167 percent) and 497.51 USD on 31 August (0.633 percent). Pass bar=1Dutc instead and OKX drops straight back inside the band that every other venue agrees on, at 77,677.70 for 30 August. The exchange was never an outlier. One character in a query string was.

This is the shape of failure worth designing against. Both calls succeed. Both return well formed JSON. The column is called close in both. If you join two vendors on a date string, you get a dataset that is quietly wrong in a way no schema check and no unit test will catch, which is the argument for treating a research dataset as something to monitor for silent drift rather than something you validate once and trust forever.

Can I get daily Bitcoin OHLC from the CoinGecko API?

Not from the OHLC endpoint, and this surprises people. The bucket width is chosen by the days parameter, not by you. We measured every documented value on 1 September 2026:

days parameterRows returnedActual bucket width
days=14830 minutes
days=7424 hours
days=301804 hours
days=90234 days
days=365924 days

There is no setting that returns a one day candle. If you assumed one row equals one day at days=365, you built a series where each row is really four days, and it will still plot beautifully. You have to resample it yourself, and resampling a 4 hour bucket into a UTC day is fine, while resampling a 4 day bucket into days is not possible at all. Separately, CryptoCompare's histoday endpoint, for years the default free daily source in tutorials, now returns HTTP 401 without an API key. If you are following an old guide, that is why it stopped working.

Which Bitcoin OHLCV data source should I use for a backtest?

Answer first: if your strategy executes on one venue, use that venue's own candles, because its wicks are the fills you would actually have received and its outages are outages you would actually have suffered. If you are modelling Bitcoin the asset rather than a venue, pick one consistent source and hold it for the life of the study. The choice between Coinbase and Kraken will not change your Sharpe ratio. Silently switching from one to the other halfway through your history might.

A few practical notes from the measurements above. Coinbase answered in 0.025 seconds and Kraken in 0.057, which makes both pleasant to backfill from. Free exchange endpoints are genuinely excellent for single venue daily candles, and we would rather say that than pretend otherwise; if a public endpoint covers your use case, use it. Where they stop being enough is breadth and joins. An exchange gives you its own trades and nothing else, so the moment your research question involves what was happening on the chain while the price moved, you are stitching sources again, and now you are back to the boundary problem but across two very different systems.

That join is the specific reason our Bitcoin OHLC API keeps candles in the same schema as the indexed chain. A day close and that day's active address count, exchange reserve balance or adjusted transaction volume come back from one query on one timeline, so there is no date key to misalign. For price at a specific moment rather than a bucket, such as valuing a disposal for tax, the Bitcoin price API answers at block time, and full chain history back to 2009 lives on the Bitcoin historical data API.

How do I download OHLCV data for Bitcoin?

Request the interval and date range you want and take the response as JSON or CSV, one row per candle with open, high, low, close and volume. A year of hourly candles is about 8,760 rows, which is one request rather than a paged crawl. Two things to fix before you store anything: confirm the timestamp is the candle's start rather than its end, and confirm what timezone that start is in. Those two checks would have caught every problem described in this article.

Does OHLCV data include perpetual futures?

Not in spot candles, and the distinction matters more than it sounds. Perpetual futures prices, funding rates and open interest live on derivatives venues and behave differently from spot, particularly during liquidations, when a perp can wick far past any spot print. If your model reads funding as a signal, you need a derivatives feed as well; do not assume a spot OHLCV endpoint carries it, and do not blend the two into one series.

The honest summary

Bitcoin's price is one of the most replicated numbers in finance, and our measurement says the market agrees with itself to within about five basis points at daily close across seven independent order books. That level of agreement means the price is not the risky part of your dataset. The risky parts are the conventions wrapped around it: which 24 hours a row covers, whether a bucket is really a day, whether the timestamp marks the start or the end, and whether the endpoint quietly changed what it returns since the tutorial you copied. Every error we found today was silent, returned HTTP 200, and was fixable by reading a raw timestamp instead of a label.

One caveat on our own numbers, since we ask it of everyone else: this is three closed days from nine sources measured in a single minute, and response times are one sample from one US machine. A volatile week would widen the venue spreads, and a benchmark run properly would sample latency many times. The day boundary finding does not depend on the sample size, because 16:00 UTC is 16:00 UTC every day, but the basis point figures should be read as a snapshot rather than a constant.

Query the Bitcoin blockchain yourself

Pull balances, UTXOs, transactions, on-chain metrics and fund flows from the fully indexed Bitcoin blockchain by REST API, SQL and dashboards. Indexed since 2009, new blocks within seconds, no node to run.

Keep reading

More from the BitcoinDatabase blog

Guides

How to Get Bitcoin OHLC Data: OHLCV Candles and Price History

How to get Bitcoin OHLC data: what OHLCV candles are, where daily and intraday price history comes from, and how to pull it over an API or SQL and join it to on-chain activity.

Read
Buyer guides

Best Bitcoin On-Chain Data API for Quant Research Teams

For research work the deciding factor is reproducibility, not metric count. Checked first-hand on 21 August 2026: Glassnode's 49 dollar Advanced plan does not include API access and its Professional tier has no published price, while coinmetrics.io now 301-redirects to Talos with pricing behind a demo request. Plus why a fixed adjustment factor for on-chain volume breaks: two blocks six days apart needed corrections of 17.03x and 4.87x.

Read
Buyer guides

Best Bitcoin Mining Pool Data APIs for Research and Mining Analytics Teams

Bitcoin has no pool field, so every mining pool chart is a guess from a coinbase text tag or a payout address match. We ran both methods over the same 144 consecutive blocks: the tag resolved 96.53 percent, the address list 82.64 percent, and one pool moved from 3.47 to 6.94 percent of the identical window because five blocks spelled its tag with a lowercase letter. Plus an honest comparison of the free and paid options, all called first-hand.

Read
Guides

How to Download Bitcoin Blockchain Data: Datasets, CSV and SQL

How to get Bitcoin blockchain data for research: syncing a full node, what public Bitcoin datasets actually contain, how big the chain is in 2026, and how to pull transactions and balances as CSV without indexing it yourself.

Read

Query the whole Bitcoin blockchain

BitcoinDatabase indexes the public Bitcoin blockchain block by block and returns balances, UTXOs, transactions, on-chain metrics and fund flows by REST API, SQL and dashboards, with no node to run.

REST + SQL + dashboards · indexed since 2009 · new blocks within seconds

Informational on-chain data only · not financial, investment or legal advice · AML features are compliance tooling to support your own review.