The unofficial MEXC API SDK, by Tribulnation. Compatible with Trading SDK.
Project description
MEXC Trading SDK
The unofficial, fully-typed async Python SDK for MEXC, by Tribulnation.
Quick Start
pip install mexc-trading-sdk
from mexc import MEXC
async with MEXC.new(API_KEY, API_SECRET) as client:
r = await client.spot.place_order('BTCUSDT', {
'price': '50000',
'quantity': '0.001',
'type': 'LIMIT',
'side': 'BUY',
})
Why MEXC SDK?
- 🚀 Fully Async - Built with
httpxfor high-performance async operations - 🔒 Type Safe - Complete type annotations with
TypedDictandpydanticvalidation - ⚡ Easy to Use - Simple context-managed API with
async with - 📊 Comprehensive - Spot trading, market data, wallet, and WebSocket streams
- 🎯 No Setup Required - Start exploring markets immediately
What's Included
- Market Data - Real-time prices, order books, and historical data
- Spot Trading - Place, cancel, and query orders
- User Data - Account balances, trade history, and order status
- Wallet Operations - Deposits, withdrawals, and address management
- WebSocket Streams - Live market data and user notifications
Authentication
Get your API keys from the MEXC dashboard.
Or, you can use public methods:
from mexc.spot import MarketData
async with MarketData() as client:
candles = await client.candles('BTCUSDT', interval='15m')
Supported APIs
The SDK covers the following MEXC endpoints:
Spot
Trading
User Data
account(balances)my_trades(trade history)query_orderopen_ordersmy_orders(order history)
Market Data
time(server time)depth(order book)candles(klines)trades(recent trades)agg_tradesexchange_info
Wallet
currency_info(withdrawal methods)deposit_addresses(deposit methods)withdrawcancel_withdrawdeposit_historywithdrawal_history
Public Streams
User Streams
my_trades(trade history)
Futures
Trading
Has been "under maintenance" (see the docs) for years. I.e., they don't want you to trade futures via the API, sorry.
Market Data
User Data
User Streams
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mexc_trading_sdk-0.1.10.tar.gz.
File metadata
- Download URL: mexc_trading_sdk-0.1.10.tar.gz
- Upload date:
- Size: 49.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b46269f6d367bdb01f84667982f5de30906d691e8425e983e58b191669f4b890
|
|
| MD5 |
ef3f612364680e5e4e74f232c1eba2ca
|
|
| BLAKE2b-256 |
1d165d20aa39e443769aede9bcb4659f5930763505b7652d093d337bfa008883
|
File details
Details for the file mexc_trading_sdk-0.1.10-py3-none-any.whl.
File metadata
- Download URL: mexc_trading_sdk-0.1.10-py3-none-any.whl
- Upload date:
- Size: 110.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
526fc165c58f4fc5b0480c1d02d824bf5ddcfccd135ce83beb31992f24f919f1
|
|
| MD5 |
43846e6f78858ff3eeb6b1897a43ea0d
|
|
| BLAKE2b-256 |
23e4e4137f241e7e5515cd466458b825379e87239e742a5e339a63d1378140e3
|