Typed MEXC
A fully typed, validated async client for the MEXC spot and futures APIs.
from typed_mexc import MEXC
async with MEXC.new(public=True) as client:
candles = await client.spot.market.candles(symbol='BTCUSDT', interval='1m', limit=5)
stream = await client.futures.streams.market.ticker('BTC_USDT')
print(candles[-1][4])
async for ticker in stream:
print(ticker.get('lastPrice'))
breakWhy Typed MEXC?
- 🎯 Precise Types: Typed endpoint inputs and responses.
- ✅ Runtime Validation: Validated responses by default.
- ⚡ Async First: HTTP and WebSocket subscriptions.
- 📚 Full API Surface:
client.spot,client.futures, and stream groups for both spot and futures.
Installation
pip install typed-mexcHow To
- API Keys Setup
- Fetch Market Data
- Place & Manage Orders
- Fetch Balances, Positions & History
- Manage Deposits & Withdrawals
- Listen To Streams
Reference
Design Philosophy
Typed MEXC follows the principles outlined in this blog post.
Details matter. Developer experience matters.