Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.04 KB

File metadata and controls

26 lines (17 loc) · 1.04 KB

Python quickstart

A short "hello world" that authenticates with the Cryptohopper API and prints your account info plus the BTC/USDT price.

Run it

export CRYPTOHOPPER_TOKEN=your-40-char-bearer
pip install -r requirements.txt
python hello.py

What it shows

  • How to construct CryptohopperClient with a bearer token (and use it as a context manager — closes the underlying httpx.Client cleanly)
  • One authenticated call: client.user.get()
  • One market-data call: client.exchange.ticker(exchange=..., market=...)
  • Typed error handling via CryptohopperError

Where to get a token

cryptohopper.com developer dashboard → Create OAuth app → drive the consent flow once. See oauth/python/ for a runnable OAuth example, or use the cryptohopper CLI (cryptohopper login) which handles the flow for you.

Dependencies

Just one — cryptohopper. Requires Python 3.10+.