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.
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cryptoquant-0.2.0.tar.gz.
File metadata
- Download URL: cryptoquant-0.2.0.tar.gz
- Upload date:
- Size: 58.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3038cecda44afb3bd87a847fcd8a89dcc81d6d67d5dba3863af166b89dae786
|
|
| MD5 |
5b1983c9980997b58454f226a0a666bb
|
|
| BLAKE2b-256 |
b568e6c858750270f8728dfef8d8a7443774edf749cf517fd28af8d84210d79f
|
Provenance
The following attestation bundles were made for cryptoquant-0.2.0.tar.gz:
Publisher:
publish.yml on LautaroParada/cryptoquant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cryptoquant-0.2.0.tar.gz -
Subject digest:
a3038cecda44afb3bd87a847fcd8a89dcc81d6d67d5dba3863af166b89dae786 - Sigstore transparency entry: 2619438921
- Sigstore integration time:
-
Permalink:
LautaroParada/cryptoquant@f5d561ccb8b025db8d558ebfd79eb28b8cd40b09 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/LautaroParada
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f5d561ccb8b025db8d558ebfd79eb28b8cd40b09 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cryptoquant-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cryptoquant-0.2.0-py3-none-any.whl
- Upload date:
- Size: 57.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f3b1b9eda4b46bb9efbfe120cc1e700b6961d72002e80c7f6d0ba4d860b7f74
|
|
| MD5 |
9325ea9dbbd8a794dbe08447d2b95a84
|
|
| BLAKE2b-256 |
43c16f781e6bacb8bee4e34ff2db22ae9201107b783136b9802823ff317eb6d7
|
Provenance
The following attestation bundles were made for cryptoquant-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on LautaroParada/cryptoquant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cryptoquant-0.2.0-py3-none-any.whl -
Subject digest:
9f3b1b9eda4b46bb9efbfe120cc1e700b6961d72002e80c7f6d0ba4d860b7f74 - Sigstore transparency entry: 2619438947
- Sigstore integration time:
-
Permalink:
LautaroParada/cryptoquant@f5d561ccb8b025db8d558ebfd79eb28b8cd40b09 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/LautaroParada
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f5d561ccb8b025db8d558ebfd79eb28b8cd40b09 -
Trigger Event:
release
-
Statement type: