Working with crypto exchange data can be messy. APIs return raw JSON, data structures vary between exchanges, and transforming everything into Pandas DataFrames becomes a repetitive chore. That’s why we built Crypto-Pandas — a Python library that makes querying crypto data from exchanges as easy as writing:
df = exchange.fetch_ohlcv(“BTC/USDT”)
Crypto-Pandas combines the best of two worlds:
Install Crypto-Pandas using pip:
pip install crypto-pandas
Let’s begin with a simple setup for Binance
from crypto_pandas import CCXTPandasExchange
import ccxt
exchange = CCXTPandasExchange(exchange=ccxt.binance())
Before querying any data, it’s a good idea to load and inspect the available markets:
markets = exchange.load_cached_markets()
print(markets.head())
Fetching historical candles becomes one line of code:
ohlcv = exchange.fetch_ohlcv(“BTC/USDT”, timeframe=”1h”, limit=100)
print(ohlcv.tail())
Output:
Want to see public trades happening on a symbol?
trades = exchange.fetch_trades(“BTC/USDT”)
print(trades.head())
Need to look at the bid/ask stack?
order_book = exchange.fetch_order_book(“BTC/USDT”)
print(order_book.head(5))
Want a quick snapshot of top-of-book data across multiple symbols?
quotes = exchange.fetch_bids_asks()
print(quotes)
Output:
✅ Combines the reliability of CCXT and the flexibility of Pandas
✅ Clean DataFrame outputs for every method in 1 line of code
✅ Timestamps are in pd.Timestamp UTC format
✅ Schema consistency across different exchanges
✅ No more JSON wrangling or timestamp parsing
💻 GitHub: https://github.com/sigma-quantiphi/crypto-pandas
🧪 Run in Binder: Launch notebook
🌐 More tools: https://sigmaquantiphi.com/
Copyright © 2025 Sigma Quantiphi. All rights reserved.