Typed Binance
A fully typed, validated async client for the Binance API.
from typed_binance import Binance
async with Binance.new(public=True) as client:
price = await client.spot.http.market.ticker_price(symbol='BTCUSDT')
print(price)Why Typed Binance?
- 🎯 Precise Types: every spot, USD-M futures, COIN-M futures, options, and portfolio margin parameter and response is a precise Python type, not
dict/Any. - ✅ Runtime Validation: every response is validated against its schema by default, not just typed on paper.
- ⚡ Async First: async HTTP requests and WebSocket market-data streams, built for concurrent workflows across every product line.
- 📚 Full Surface: every documented spot, futures, options, and portfolio margin endpoint, not just the popular ones.
Installation
pip install typed-binanceHow To
- Fetch Market Data — public prices, order books, and candles
- Listen To Streams — subscribe to market data and account event streams
- Place & Manage Orders — submit, query, cancel, and list spot orders
- Fetch Account Data — balances, positions, and trade history
- Query & Manage Earn Instruments — Simple Earn products, positions, subscribe, and redeem
- Manage Deposits & Withdrawals — deposit addresses/history and withdrawals
- Paginate Through Results — walk a time range across multiple pages
Reference
Design Philosophy
Typed Binance follows the principles outlined in this blog post.
Details matter. Developer experience matters.