DocumentationAPI endpoints, Python SDK, and historical data format
Ask on ChatGPTQuick Start Guide
Get up and running with CryptoHFTData in just a few minutes. Follow these steps to start accessing high-frequency cryptocurrency market data.
Need help while reading docs?
Use our dedicated ChatGPT GPT for implementation guidance and API examples.
Ask on ChatGPT1. Get Your API Key
- Sign up for a CryptoHFTData account
- Navigate to your dashboard
- Click "Generate API Key" to create your first API key
- Copy and securely store your API key
2. Install the Python SDK
bash
pip install cryptohftdata3. Your First API Call
python
1import cryptohftdata as chd
2from datetime import datetime, timedelta
3
4# Initialize the client
5client = chd.CryptoHFTDataClient(api_key="your-api-key-here")
6
7# Get Bitcoin price data from Binance
8df = client.get_trades(
9 symbol="BTCUSDT",
10 exchange=chd.exchanges.BINANCE_SPOT,
11 start_date="2025-08-01",
12 end_date="2025-08-01"
13)
14
15# Display the data
16print(df.head())4. Explore Different Data Types
python
1# Some of the different data types you can access:
2# Get order book data
3orderbook_df = client.get_orderbook(
4 symbol="ETHUSDT",
5 exchange=chd.exchanges.BINANCE_SPOT,
6 start_date="2025-08-01",
7 end_date="2025-08-01"
8)
9
10# Get individual trades
11trades_df = client.get_trades(
12 symbol="BTCUSDT",
13 exchange=chd.exchanges.BINANCE_FUTURES,
14 start_date="2025-08-01",
15 end_date="2025-08-01"
16)
17
18# Get open interest data
19oi_df = client.get_open_interest(
20 symbol="BTCUSDT",
21 exchange=chd.exchanges.BYBIT_FUTURES,
22 start_date="2025-08-01",
23 end_date="2025-08-01"
24)
25
26# Get mark price data, including funding rates
27mark_price_df = client.get_mark_price(
28 symbol="BTCUSDT",
29 exchange=chd.exchanges.BINANCE_FUTURES,
30 start_date="2025-08-01",
31 end_date="2025-08-01"
32)5. Common Use Cases
Arbitrage Detection
Compare prices across multiple exchanges to identify arbitrage opportunities.
python
1import matplotlib.pyplot as plt
2
3exchanges = [
4 chd.exchanges.BINANCE_SPOT,
5 chd.exchanges.BYBIT_SPOT,
6 chd.exchanges.KRAKEN_SPOT
7]
8
9plt.figure(figsize=(12, 6))
10
11for exchange in exchanges:
12 symbol = "BTCUSDT" if exchange != chd.exchanges.KRAKEN_SPOT else "BTC_USD"
13 df = client.get_trades(
14 symbol=symbol,
15 exchange=exchange,
16 start_date="2025-08-01",
17 end_date="2025-08-01"
18 )
19
20 # Plot event_time vs price
21 plt.plot(df['event_time'], df['price'].astype(float), label=exchange)
22
23plt.title("BTCUSDT Price on Different Exchanges")
24plt.xlabel("Event Time")
25plt.ylabel("Price (USDT)")
26plt.legend()
27plt.xticks(rotation=45)
28plt.tight_layout()
29plt.show()Market Making Analytics
Analyze order book depth and spread patterns for market making strategies.
python
1import matplotlib.pyplot as plt
2import tqdm
3
4# Get order book snapshots
5ob_df = client.get_orderbook(
6 symbol="ETHUSDT",
7 exchange=chd.exchanges.BINANCE_FUTURES,
8 start_date="2025-08-01",
9 end_date="2025-08-01"
10)
11
12# ... (Full code example available in repo)