Why CoinAPI OHLCV Data Looks Different from Exchanges
When you pull OHLCV (Open, High, Low, Close, Volume) data from CoinAPI, the numbers may not match exactly what you see on Binance, Coinbase, or TradingView. This can be confusing for beginners, but it’s normal. Here’s why, and how to use the data correctly.
1. Understanding the Source of Discrepancies
A. Different Data Providers
CoinAPI aggregates data from hundreds of crypto exchanges, normalizing and standardizing it into a unified format.
However:
- Exchanges/TradingView often use internal (native) order book and trade data, sometimes filtered or processed differently.
- CoinAPI receives data via public APIs or data feeds, sometimes with latency, rate limits, or different sampling resolutions.
B. Differences in Time Intervals
- TradingView often builds candles using server-side aggregation, which may differ in:
- Time zone (UTC vs exchange time)
- Precision (e.g. milliseconds vs seconds)
- Volume filters
- CoinAPI candles are aggregated by:
- Trade data timestamps
- Consistent UTC-based intervals
This leads to slight differences in OHLCV values, especially for fast-moving or low-liquidity markets.
C. Precision Rounding
- CoinAPI applies standardized decimal precision across instruments.
- Exchanges may expose more (or fewer) decimal places for prices or volumes.
- CoinAPI simplifies some precision metadata for uniformity across markets.
🔧 You can still access native exchange metadata using CoinAPI's /instruments or /symbols endpoints to get precision values per market.
2. Why OHLCV Data May Appear Incomplete
Common causes:
| Issue | Reason |
| 🔸 Gaps in candles | No trades occurred in the given time interval. |
| 🔸 Low volume or zero volume candles | Illiquid or new markets with little activity. |
| 🔸 Missing intervals | CoinAPI omits intervals where no trades exist to reduce noise. |
| 🔸 Partial coverage | CoinAPI may not cover all historical data, depending on your plan or exchange support. |
Solutions:
- Use the
period_idparameter (e.g.1MIN,1HRS) carefully when calling/ohlcv/latestor/ohlcv/history. - Check your subscription plan for historical data depth.
- Enable data fallbacks or interpolate gaps in your frontend/charting logic.
3. Tips for Developers Using CoinAPI
A. Get OHLCV Data:
Example:
B. Get Instrument Precision:
Use this to retrieve metadata like:
price_precisionvolume_precisionmin_trade_size
C. Sample Python Snippet:
4. Summary
| Source of Difference | Explanation |
| Aggregation Methods | Exchanges and CoinAPI aggregate trades differently. |
| Time Zones & Timestamps | UTC on CoinAPI vs exchange local time. |
| Missing Data | Due to no trades or limited historical coverage. |
| Rounding/Precision | CoinAPI standardizes, exchanges may vary. |
Further Reading
Pro Tip
Always align your application’s timezone, data frequency, and instrument metadata with CoinAPI’s standardized format when comparing against third-party platforms. Use CoinAPI data for consistency and automation, but don’t expect pixel-perfect parity with visual platforms like TradingView.