CCXT vs a hosted data API: which for crypto history?
CCXT is a free library that asks each exchange for candles. A hosted API stores them for you. See when each fits, plus measured exchange differences.
CCXT is the better fit when you want one free library for many exchanges, or when you also want to place trades. A hosted data API is the better fit when you want years of bars already stored. For scale: Binance BTCUSDT perpetual hourly bars since September 2019 come to 62,359 bars. If one page held 1,000 bars, the example size in the CCXT manual, that would take 63 requests. Coinbase BTC-USD hourly bars since July 2015 are 98,564 bars, or 99 requests.
Real exchanges often serve fewer bars per request, and some serve less history. Exchanges also disagree on price: in our test, Coinbase BTC-USD spot closed a median 3.26 bp (about 0.03%) above Binance BTCUSDT perpetuals over 62,342 paired hours, and the gap changed sign in 2026. This guide shows both problems. It describes past data, not a forecast.
What does CCXT do well?
CCXT is an open-source library that gives developers one way to talk to many exchanges. It claims 100+ exchanges and prediction markets and uses the free MIT license. It covers market data and trading. It also has an official MCP server, which lets an AI app call it. MCP is a standard way for AI apps to use outside tools. Its market-data tools list exchanges, search markets, and get tickers, order books, candles and trades. Public market data needs no setup. Trading and fund transfers are off by default.
If you want to try five exchanges in one script, or send an order, CCXT is built for it. A hosted data API is not.
Why is downloading long history harder than it looks?
The fetchOHLCV call downloads exchange candles. OHLCV means open, high, low, close and volume: the four prices and the amount traded. CCXT's own tutorial says a historical download needs paging and rate-limit handling. One call normally returns a limited page, not years of bars.
Then the exchange sets its own limits. The CCXT manual warns that its per-exchange features list is still a work in progress, so you check each exchange's candle limit yourself. Other published examples:
| Source | Published limit |
|---|---|
| Hyperliquid's candle request | Only the most recent 5,000 candles |
| Freqtrade docs (a bot that uses CCXT) | Binance open interest history is limited to roughly 30 days |
| CCXT's MCP server | Some exchanges block cloud, VPN or US addresses, so you may need a proxy |
| CCXT's MCP server | Loading the markets of a large exchange can take several seconds; the result is cached for 24 hours |
At one bar per hour, 5,000 candles is a little under 7 months. Freqtrade is a free trading bot. Its docs say historical data only goes back as far as the exchange supplies it. For Hyperliquid's own archive files, see how to download Hyperliquid historical data.
Do two exchanges give the same Bitcoin price?
No, and CCXT will not choose for you. You pick the exchange adapter and the market symbol. A symbol like BTC/USDT on a spot market is not a USDT perpetual (a futures contract that never expires). CCXT's candle tutorial uses a BTC/USDT spot example, which does not tell you how USDT perpetual markets behave.
We measured one pair. We lined up Coinbase BTC-USD spot hourly closes with Binance BTCUSDT perpetual hourly closes at the same close time. The gap is 10,000 × (Coinbase close ÷ Binance close − 1), in basis points (bp). A basis point is one hundredth of one percent. Positive means Coinbase was higher.
Over 62,342 paired hours from September 2019 to October 20, 2026, the median gap was 3.26 bp, which is about 0.03%. The middle 90% of hours fell between −12.36 bp and 15.05 bp. Here it is by year:
| Year | Paired hours | Median gap (bp) | 5th to 95th percentile (bp) |
|---|---|---|---|
| 2019 (from Sep 8) | 2,741 | 5.90 | −20.39 to 29.77 |
| 2020 | 8,781 | 2.83 | −22.82 to 25.14 |
| 2021 | 8,760 | 1.42 | −15.09 to 15.35 |
| 2022 | 8,760 | 4.99 | −9.51 to 11.82 |
| 2023 | 8,757 | 4.39 | −7.79 to 15.67 |
| 2024 | 8,784 | 0.70 | −12.46 to 10.07 |
| 2025 | 8,755 | 5.33 | −3.95 to 11.13 |
| 2026 (to Oct 20) | 7,004 | −1.01 | −11.07 to 8.29 |
The two series were close on the median. But the middle 90% of hours ranged by tens of basis points in some years. The gap even changed sign in 2026. USD and USDT are different units, and spot and perpetual contracts are different products. This is not a trading spread: it leaves out bid and ask prices, fees, funding and slippage. For more, see why Bitcoin prices differ between exchanges.
So whichever tool you use, write down the exchange, market type and quote currency with every dataset. If a test mixes sources, you will not know which price you measured.
When does CCXT fit, and when does a hosted API fit?
| Question | CCXT | A hosted API such as Comparand |
|---|---|---|
| Price of the tool | Free library | Free bar tools on any key; a key needs a plan or $5 pay as you go |
| Many exchanges | 100+ adapters | Dozens of exchanges; most are price bars only |
| Placing trades | Yes | No orders |
| Long history | You page and store it, within each exchange's limits | You give a start and end; the service stores the bars |
| Limits | Each exchange's limits | Plan limits: 60, 300 or 900 requests per minute |
| Setup | Code, storage and upkeep | A key; works from AI apps through MCP |
Use CCXT for live trading, for exchanges a hosted service does not carry, or when you want full control. Use a hosted API for research, for AI agents, or when you want history without paging code. If you are weighing coin-level prices instead, see CoinGecko API alternatives.
What does a hosted API still not fix?
A hosted service has its own limits. Comparand has fewer exchanges than CCXT lists. It has no order-book depth. For funding, one call covers at most 400 days. For trades, at most 24 hours, and only on exchanges that publish them. Bars come back completed only, and every answer says where its data came from. We did not measure gaps or speed in any hosted service, so check your market for yourself.
You can also use both. Pull the same few hours from each and compare the closes before you rely on either one.
How we measured this
For the library and exchange limits, we read the official CCXT, Freqtrade and Hyperliquid documentation and linked the main pages. We did not run CCXT or download from exchanges for that part. For the gap table, we used hourly bars from public Binance archives and the public Coinbase service, joined on the same close time, and took the median and the 5th and 95th percentiles. Missing hours stayed missing. We did not subtract fees or funding.
Try this in Comparand
Ask your connected AI agent:
- "Which exchanges and markets can I request?" venue_coverage lists exchanges and prediction markets with their datasets and bar sizes. venue_markets lists the markets on one exchange.
- "Show completed hourly bars for this symbol over these dates." venue_bars returns open, high, low, close and volume, in sizes from 1 minute to 1 day.
- "Show funding payments for this perpetual over these dates." venue_funding returns funding settlements, at most 400 days per call.
- "Show trades for this symbol over the last few hours." venue_trades returns up to 24 hours of trades, on exchanges that publish them.
All of these are free on every key. You can try 3 coins free for past-chart search, or see the pricing page. For a wider comparison, read our guide to crypto market data APIs.
The short version
- CCXT is a free library for many exchanges and for trading. You page the history and handle limits yourself.
- A hosted API stores bars, but covers fewer exchanges and cannot place orders.
- Exchanges limit how far back they serve. Hyperliquid serves only its most recent 5,000 candles.
- Coinbase BTC-USD and Binance BTCUSDT hourly closes had a median gap of 3.26 bp, with wide swings in some years.
- Record exchange, market type and quote currency with every dataset.
Questions people ask
Can CCXT download years of historical crypto candles?
Yes, but one call returns only a page of candles, so you page through the history and handle each exchange's rate limits. Each exchange also limits how far back it serves. Hyperliquid, for example, serves only its most recent 5,000 candles.
Is CCXT free?
The library is free under the MIT license. Your costs are your own time, a place to store the data and any exchange limits. We did not measure those costs.
When is a hosted data API better than CCXT?
When you want long history without writing paging code, or when your tool is an AI agent that calls a data service. A hosted API still has its own limits on markets, history and requests per minute.
Can CCXT place trades while a hosted data API cannot?
CCXT supports trading as well as market data. Comparand does not place orders. If you need execution, CCXT or the exchange's own API is the tool.