Typed

Async, typed, validated Python clients for every crypto venue we trade on. One namespace. Every exchange.

🎯
Precise Types
Typed endpoint inputs and responses, not dict / Any.
Runtime Validation
Responses validated by default, not just typed on paper.
Async First
HTTP, WebSocket, gRPC — whatever each venue actually speaks.
📚
Full Surface
Every documented endpoint, not just the popular ones.
Docs
Hand it to your coding agent

One prompt with the typed-binance install command, its env vars, and a working first call. Paste it into Claude Code, Cursor, or Codex.

Quickstart
  1. 1
    Create a .env

    Create a .env with your API credentials — see API keys setup for how to create them.

    # .env
    BINANCE_API_KEY="your_api_key"
    BINANCE_SECRET_KEY="your_api_secret"
  2. 2
    Install

    Install the client and python-dotenv to load the .env file.

    pip install typed-binance python-dotenv
  3. 3
    Make your first call

    Load the environment, then make your first call.

    from dotenv import load_dotenv
    load_dotenv()
    
    from typed_binance import Binance
    
    async with Binance.new() as client:
      account = await client.spot.http.account.info()
      print(account['balances'])

How To

Fetch market data

Order books, candles, recent trades, and the tradeable symbol list — all public.

book = await client.spot.http.market.order_book(symbol='BTCUSDT', limit=20)  # order book
candles = await client.spot.http.market.klines(symbol='BTCUSDT', interval='1h', limit=10)  # candles
trades = await client.spot.http.market.recent_trades(symbol='BTCUSDT', limit=20)  # recent trades
info = await client.spot.http.market.exchange_info(symbol='BTCUSDT')  # tradeable symbols
Listen to streams

A public market-data channel, and your own account's order/balance events.

async with client.spot.streams.ticker('BTCUSDT') as stream:  # public ticker updates
  async for update in stream:
    print(update)

async with client.spot.ws.subscribe_user_data() as events:  # this account's order/balance events
  async for event in events:
    print(event)
Place & manage orders

Submit, query, cancel, and list spot orders. Needs credentials.

order = await client.spot.http.trading.order({
  'symbol': 'BTCUSDT', 'side': 'BUY', 'type': 'LIMIT',
  'timeInForce': 'GTC', 'quantity': '0.0001', 'price': '20000',
})  # place a limit order
status = await client.spot.http.account.order(symbol='BTCUSDT', order_id=order['orderId'])  # check its status
open_orders = await client.spot.http.account.open_orders(symbol='BTCUSDT')  # list open orders
await client.spot.http.trading.cancel_order(symbol='BTCUSDT', order_id=order['orderId'])  # cancel it
Fetch account data

Balances, futures positions, and trade history. Needs credentials.

account = await client.spot.http.account.info()  # spot balances
trades = await client.spot.http.account.my_trades(symbol='BTCUSDT', limit=50)  # trade history
positions = await client.usdm_futures.http.trading.position_risk_v3(symbol='BTCUSDT')  # futures positions
Query & manage earn instruments

List Simple Earn products, subscribe, check your positions, and redeem.

products = await client.spot.http.simple_earn.flexible.list(asset='USDT')  # available products
subscription = await client.spot.http.simple_earn.flexible.subscribe(
  product_id='USDT001', amount='10',
)  # subscribe
positions = await client.spot.http.simple_earn.flexible.position(asset='USDT')  # your positions
await client.spot.http.simple_earn.flexible.redeem(product_id='USDT001', redeem_all=True)  # redeem
Manage deposits & withdrawals

Deposit addresses/history, and submitting or listing withdrawals.

deposit = await client.spot.http.wallet.capital.deposit.address(coin='USDT', network='TRX')  # deposit address
deposits = await client.spot.http.wallet.capital.deposit.history(coin='USDT')  # deposit history
withdrawal = await client.spot.http.wallet.capital.withdraw.apply(
  coin='USDT', network='TRX', address='...', amount=10,
)  # submit a withdrawal
withdrawals = await client.spot.http.wallet.capital.withdraw.history(coin='USDT')  # withdrawal history

Full client list

Binance
Production
Coinbase
Production
OKX
Planned
Bybit
Production
Bitget
Production
Hyperliquid
Production
MEXC
Production
KuCoin
Production
Kraken
Production
dYdX
Production
Deribit
Production
Bitfinex
Planned
Aster
Planned
Bit2Me
Production
Alchemy
Production
Moralis
In development
Etherscan
In development