# Typed Binance

> A fully typed, validated async client for the Binance API.

```python
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

```bash
pip install typed-binance
```

## How To

- [Fetch Market Data](/typed/binance/how-to/fetch-market-data) — public prices, order books, and candles
- [Listen To Streams](/typed/binance/how-to/listen-to-streams) — subscribe to market data and account event streams
- [Place & Manage Orders](/typed/binance/how-to/place-and-manage-orders) — submit, query, cancel, and list spot orders
- [Fetch Account Data](/typed/binance/how-to/manage-account-data) — balances, positions, and trade history
- [Query & Manage Earn Instruments](/typed/binance/how-to/manage-earn) — Simple Earn products, positions, subscribe, and redeem
- [Manage Deposits & Withdrawals](/typed/binance/how-to/manage-deposits-and-withdrawals) — deposit addresses/history and withdrawals
- [Paginate Through Results](/typed/binance/how-to/paginate-through-results) — walk a time range across multiple pages

## Reference

- [API Keys Setup](/typed/binance/api-keys)
- [Async Usage](/typed/binance/reference/async-usage)
- [Error Handling](/typed/binance/reference/error-handling)
- [Environment Variables](/typed/binance/reference/env-vars)
- [Timestamps](/typed/binance/reference/timestamps)

## Design Philosophy

Typed Binance follows the principles outlined in [this blog post](https://tribulnation.com/blog/clients).

*Details matter. Developer experience matters.*
