Documentation
Ask on ChatGPT

Exchange Constants

The Python SDK provides predefined constants for all supported exchanges. Use these constants to ensure correct exchange identification when making API calls.

Available Exchange Constants

Spot Exchanges

python
1chd.exchanges.BINANCE_SPOT
2chd.exchanges.BYBIT_SPOT
3chd.exchanges.KRAKEN_SPOT
4chd.exchanges.OKX_SPOT
5chd.exchanges.BITGET_SPOT
6chd.exchanges.HYPERLIQUID_SPOT

Futures/Derivatives Exchanges

python
1chd.exchanges.BINANCE_FUTURES
2chd.exchanges.BYBIT_FUTURES
3chd.exchanges.KRAKEN_FUTURES
4chd.exchanges.OKX_FUTURES
5chd.exchanges.BITGET_FUTURES
6chd.exchanges.HYPERLIQUID_FUTURES
7chd.exchanges.LIGHTER
8chd.exchanges.ASTER_FUTURES
9chd.exchanges.BITMEX

Usage Example

python
1import cryptohftdata as chd
2
3# Use exchange constants instead of strings
4df = client.get_trades(
5    symbol="BTCUSDT",
6    exchange=chd.exchanges.BINANCE_SPOT,  # ✅ Recommended
7    start_date="2025-08-01",
8    end_date="2025-08-01"
9)
10
11# Avoid using strings directly
12df = client.get_trades(
13    symbol="BTCUSDT",
14    exchange="binance_spot",  # ❌ Not recommended
15    start_date="2025-08-01",
16    end_date="2025-08-01"
17)
18

Important Notes

  • • Use these exact exchange identifiers - they are case-sensitive
  • • Not all data types are available on all exchanges
  • • Mark price, open interest, and liquidations are only available on futures/derivatives exchanges
  • • Check data availability for specific trading pairs before making requests

Have questions?

Our support team is available to help you with integration.

Contact Support