Skip to content

Repository files navigation

CryptoQuant Python SDK

Unofficial Python SDK for the CryptoQuant API — unified access to on-chain and market data for Bitcoin, Ethereum, Stablecoins, ERC-20 tokens, XRP, TRX, and Altcoins.

CI PyPI version Python 3.9+ License: MIT


Installation

pip install cryptoquant

Quick Start

from cryptoquant import CryptoQuant

client = CryptoQuant(api_key="your_api_key")

# Stablecoin exchange flows
data = client.get_stable_exch_inflow(
    token="usdc",
    exchange="all_exchange",
    window="day",
    limit=30,
)

Error Handling

from cryptoquant import (
    CryptoQuant,
    CryptoQuantHTTPError,
    CryptoQuantTimeoutError,
    CryptoQuantConnectionError,
)

try:
    data = client.get_stable_exch_inflow(token="usdc", exchange="binance", window="hour")
except CryptoQuantHTTPError as e:
    print(f"API error {e.status_code}: {e}")
except CryptoQuantTimeoutError:
    print("Request timed out")
except CryptoQuantConnectionError:
    print("Network error")

Supported Assets

Asset Module Categories
Bitcoin Bitcoin Exchange flows, miner flows, network/market indicators, mempool, Lightning
Ethereum Ethereum Exchange flows, ETH 2.0, fund data, market/network data
Stablecoins StableCoins Exchange flows, flow indicators, market data, network data
ERC-20 Erc20 Exchange flows, flow indicators, market/network data
XRP XRP Entity flows, DEX/AMM data, market/network data
TRX TRX Market data, network data, DeFi
Altcoins AltCoins Market data (OHLCV)

Time Windows

CryptoQuant supports four time windows. Each endpoint supports a subset:

Window Description from_/to_ format
day Daily aggregation YYYYMMDD or YYYYMMDDTHHMMSS
hour Hourly aggregation YYYYMMDDTHHMMSS
min Per-minute (market data only) YYYYMMDDTHHMMSS
block Per-block (on-chain data) YYYYMMDDTHHMMSS or block height integer

API Versions

The SDK transparently routes requests to the correct API version:

  • Endpoints starting with v2/https://api.cryptoquant.com/v2/
  • All other endpoints → https://api.cryptoquant.com/v1/

No configuration needed.

Advanced Usage

Custom timeout

client = CryptoQuant(api_key="...", default_timeout=60.0)

Incremental fetch with from_/to_

data = client.get_stable_exch_inflow(
    token="usdt_eth",
    exchange="binance",
    window="hour",
    from_="20240101T000000",
    to_="20240101T235959",
)

CSV output

csv_data = client.get_stable_exch_reserve(
    token="usdc",
    exchange="all_exchange",
    window="day",
    format_="csv",
)

Development

git clone https://github.com/LautaroParada/cryptoquant.git
cd cryptoquant
pip install -e ".[dev]"
pytest tests/ -v

License

MIT

About

SDK for the CryptoQuant API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages