Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

cryptohopper

PyPI PyPI downloads Python versions CI License: MIT

Official Python SDK for the Cryptohopper API.

Status: 0.4.0a1 — full coverage of all 18 public API domains: user, hoppers, exchange, strategy, backtest, market, signals, arbitrage, marketmaker, template, ai, platform, chart, subscription, social, tournaments, webhooks, app.

Deeper docs: Getting Started · Authentication · Error Handling · Rate Limits

Install

pip install cryptohopper

Requires Python 3.10+.

Quickstart

import os
from cryptohopper import CryptohopperClient

with CryptohopperClient(api_key=os.environ["CRYPTOHOPPER_TOKEN"]) as ch:
    me = ch.user.get()
    print(me["email"])

    ticker = ch.exchange.ticker(exchange="binance", market="BTC/USDT")
    print(ticker["last"])

Authentication

Cryptohopper uses OAuth2 bearer tokens. To get one:

  1. Sign in at cryptohopper.com and open the developer dashboard.
  2. Create an OAuth application — you'll receive a client_id and client_secret.
  3. Drive the OAuth consent flow (/oauth-consent?app_id=<client_id>&redirect_uri=<your_uri>&state=<csrf>) to receive a 40-character bearer token scoped to the permissions you requested.

Pass the token as api_key. Optionally pass your OAuth client_id as app_key — it's sent as the x-api-app-key header.

ch = CryptohopperClient(
    api_key=os.environ["CRYPTOHOPPER_TOKEN"],
    app_key=os.environ.get("CRYPTOHOPPER_CLIENT_ID"),  # optional
)

Resources

# User
ch.user.get()

# Hoppers
ch.hoppers.list(exchange="binance")
ch.hoppers.get(42)
ch.hoppers.create({"name": "My Bot", "exchange": "binance"})
ch.hoppers.update(42, {"name": "Renamed"})
ch.hoppers.delete(42)
ch.hoppers.positions(42)
ch.hoppers.orders(42)
ch.hoppers.buy({"hopper_id": 42, "market": "BTC/USDT", "amount": 0.001})
ch.hoppers.sell({"hopper_id": 42, "market": "BTC/USDT", "amount": 0.001})
ch.hoppers.config_get(42)
ch.hoppers.config_update(42, {"strategy_id": 99})
ch.hoppers.panic(42)

# Exchange — market data (still requires a real token; the gateway has no anonymous routes)
ch.exchange.ticker(exchange="binance", market="BTC/USDT")
ch.exchange.candles(exchange="binance", market="BTC/USDT", timeframe="1h")
ch.exchange.orderbook(exchange="binance", market="BTC/USDT")
ch.exchange.markets("binance")
ch.exchange.exchanges()

# Strategy
ch.strategy.list()
ch.strategy.get(5)
ch.strategy.create({"name": "My Strategy"})
ch.strategy.update(5, {"name": "Renamed"})
ch.strategy.delete(5)

# Backtest
ch.backtest.create({"hopper_id": 42, "from_date": "2026-01-01", "to_date": "2026-03-01"})
ch.backtest.get(1)
ch.backtest.list()
ch.backtest.cancel(1)
ch.backtest.limits()

# Marketplace — same auth requirement as everything else
ch.market.signals(type="buy")
ch.market.signal(99)
ch.market.items(type="strategy")
ch.market.homepage()

Client options

Option Default Description
api_key — (required) OAuth2 bearer token
app_key — Optional OAuth client_id, sent as x-api-app-key
base_url https://api.cryptohopper.com/v1 Override for staging/dev
timeout 30.0 Per-request timeout in seconds
max_retries 3 Retries on HTTP 429 (respects Retry-After). Set to 0 to disable.
user_agent — Appended after cryptohopper-sdk-python/<version>
http_client — Inject a custom httpx.Client

Errors

Every non-2xx response becomes a CryptohopperError:

from cryptohopper import CryptohopperClient, CryptohopperError

try:
    ch.user.get()
except CryptohopperError as err:
    print(err.code)            # "UNAUTHORIZED" | "FORBIDDEN" | "RATE_LIMITED" | ...
    print(err.status)          # HTTP status
    print(err.server_code)     # Numeric unique error code from the server, if any
    print(err.ip_address)      # Client IP the server saw (IP-whitelist debug help)
    print(err.retry_after_ms)  # Milliseconds to wait on 429 (if server sent Retry-After)

Unknown server-side codes pass through as-is on .code.

Rate limiting

The server enforces three buckets (normal 30/min, order 8/8s, backtest 1/2s). On HTTP 429 the SDK retries with exponential backoff up to max_retries (default 3), respecting Retry-After. Pass max_retries=0 to disable auto-retry.

Development

pip install -e ".[dev]"
ruff check .
mypy src
pytest -q

Release

Push a py-v<version> git tag. The release workflow runs ruff + mypy + pytest, verifies tag-version parity, builds sdist + wheel, and publishes via PyPI Trusted Publishing (OIDC) — no long-lived API token needed. Configure the publisher at pypi.org/manage/account/publishing before the first release.

License

MIT — see LICENSE.

Metadata

Release files for cryptohopper 0.4.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cryptohopper 0.4.0a2
File Size Uploaded Provenance Actions
cryptohopper-0.4.0a2.tar.gz 19.7 kB With provenance Details for cryptohopper-0.4.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cryptohopper 0.4.0a2
File Interpreter ABI Platform Actions
cryptohopper-0.4.0a2-py3-none-any.whl Python 3 none any Details for cryptohopper-0.4.0a2-py3-none-any.whl

Total release size: 44.7 kB

Release files / cryptohopper-0.4.0a2.tar.gz

Download URL cryptohopper-0.4.0a2.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6b3237e60f3874e5ad4ad49f93d9e9f0448ddded1d17ff9b8e9577fb9d7347ca
BLAKE2b-256 checksum
How to use checksums
d542d420185c7d4c2bf4f08ba223dd088804f293f5fbf278972eaeb9ac103ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Release files / cryptohopper-0.4.0a2-py3-none-any.whl

Download URL cryptohopper-0.4.0a2-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8239ab35808ff215e409267842f59e58b5a9204b242b0d9c02c40524905b9abe
BLAKE2b-256 checksum
How to use checksums
35ec5fa92bd44dcf11634b42150b4e4c946bdbdd5a68f15964fc70d213df63d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Security for cryptohopper 0.4.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cryptohopper-0.4.0a2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page