If you’re serious about crypto, whether as a trader, quant, or data analyst, you know that knowing your money flow is just as important as knowing your PnL. Exchanges keep their own transaction records, but relying solely on manual downloads or UI exports is inefficient. You want something automated, scriptable, and ready for integration into your analytics stack. That’s where Crypto-Pandas, built on CCXT, comes in.
It gives you a Pandas-friendly layer to interact with exchange APIs without having to wrangle messy JSON responses or inconsistent field names.
import ccxt
import pandas as pd
from dotenv import load_dotenv
import os
from crypto_pandas import CCXTPandasExchange
from crypto_pandas.utils.pandas_utils import timestamp_to_int
Why this matters: This combination of imports lets us go from API to DataFrame with minimal data cleaning.
We keep API keys out of our code for security and maintainability:
load_dotenv()
Why this matters: If your code ever gets shared or pushed to GitHub, your API keys won’t be hardcoded, avoiding a very expensive mistake.
exchange = ccxt.bybit({
“apiKey”: os.getenv(“BYBIT_SANDBOX_API_KEY”),
“secret”: os.getenv(“BYBIT_SANDBOX_API_SECRET”),
})
exchange.set_sandbox_mode(True)
Testing in sandbox mode means you can write, debug, and run your code without fear of losing real funds.
Crypto-Pandas takes CCXT’s raw API calls and outputs data as Pandas DataFrames.
pandas_exchange = CCXTPandasExchange(exchange=exchange)
Without this wrapper, you’d be working with raw JSON responses from the API. Instead, you get neatly formatted DataFrames that are ready for analysis, merging, or export.
Let’s define the time window we want to query. In this example, we’re looking at transactions between June 21, 2025 and 7 days later:
start_time = pd.Timestamp(“2025-06-21T00:00:00″, tz=”UTC”)
end_time = start_time + pd.Timedelta(days=7)
params = {
“startTime”: timestamp_to_int(start_time),
“endTime”: timestamp_to_int(end_time),
}
Key points:
API queries almost always require timestamps in a specific format. This ensures you get exactly the transactions you want , nothing more, nothing less.
Here’s where the magic happens.
What’s happening here?
fetch_deposits() , Queries exchange for all deposits in the given time range.
fetch_withdrawals() , Queries for all withdrawals in the same range.
Both return clean DataFrames with columns like:
This setup isn’t just a tutorial; it’s the foundation for real-world applications:
While CCXT is powerful, its raw JSON responses can be a pain to clean. Crypto-Pandas:
Fetching deposits and withdrawals from an exchange API doesn’t have to be messy or time-consuming. With Crypto-Pandas + CCXT, you’re already getting cleaner code, ready-to-analyse Pandas DataFrames, less time wasted on JSON wrangling, and a setup that scales easily across multiple exchanges. But that’s just the beginning.
We’re excited to announce that Crypto-Pandas-Pro is all set for you, built for traders and analysts who need more speed, deeper insights, and advanced query handling without sacrificing simplicity. With Pro, you can process larger datasets faster, unlock extended analytics, and take advantage of features designed for high-frequency and professional-grade workflows.
Beta slots are strictly limited, and early adopters will enjoy exclusive benefits, priority feature requests, and discounted access once the full version goes live. If you’ve been looking for a way to streamline your crypto data pipeline and level up your trading intelligence, now is the time to jump in and secure your place in the Pro beta.
Crypto-Pandas-Pro: Cleaner data. Faster trades
Copyright © 2025 Sigma Quantiphi. All rights reserved.