Hand it to your coding agent

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

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'))
    break

Why 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-mexc

How To

Reference

Design Philosophy

Typed MEXC follows the principles outlined in this blog post.

Details matter. Developer experience matters.