Get Started

Quick Start Guide

Do the steps on this page to start with CryptoHFTData. The steps take a few minutes. Then you can download high-frequency cryptocurrency market data.

Help with the docs

Use our ChatGPT GPT for CryptoHFTData. It helps you write your code and gives API examples.

Ask on ChatGPT

1. Get Your API Key

  1. Create a CryptoHFTData account.
  2. Go to your dashboard.
  3. Click "Generate API Key" to create your first API key.
  4. Copy your API key.
  5. Keep your API key in a safe location.

2. Install the Python SDK

Terminal
pip install cryptohftdata

3. Make 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. Use Other 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

Find Arbitrage Opportunities

Compare the prices on different exchanges to find 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()

Analysis for Market Making

Analyze the order book depth and the 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)

If you cannot find the information that you need, tell us. We also help with integrations.

Contact support