canonical: https://jentic.com/apis/mexc.com/mexc

# MEXC Spot API

The MEXC Spot API v3 is the public REST interface for MEXC's cryptocurrency exchange and supports market data, spot trading, account management, and wallet operations across hundreds of trading pairs. It exposes price ticks, candlesticks, order books, account balances, order placement and cancellation, and capital movements such as deposits, withdrawals, and inter-account transfers. Authentication uses a signed apiKey passed in the X-MEXC-APIKEY header.

## For AI agents

Read live MEXC market data, place and cancel spot orders, query balances and trade history, and move funds between accounts on the MEXC exchange.

## Scope

Does not handle futures contracts, perpetuals, lending, staking, or fiat ramps - use for spot market data, spot trading, and wallet operations only.

## Capabilities

- Read live market data including order book depth, recent trades, candlesticks, and 24-hour ticker statistics
- Place, query, and cancel spot orders, including batch orders of up to 20 at a time
- List open orders, historical orders, and personal trade fills for a symbol
- Inspect account balances, available coins, and per-symbol trading fees
- Generate deposit addresses and submit, query, or cancel withdrawal requests across networks
- Transfer funds between MEXC sub-accounts and view transfer history

## Use cases

### Algorithmic Spot Trading on MEXC

Quant teams running spot strategies use `/api/v3/order` to place limit and market orders, `/api/v3/depth` and `/api/v3/klines` to feed model inputs, and `/api/v3/openOrders` for execution monitoring. Batch placement via `/api/v3/batchOrders` allows up to 20 orders per call, suitable for grid and market-making strategies that need to refresh quotes quickly.

Example prompt: Fetch `/api/v3/depth` for BTCUSDT, then place a limit buy at the top bid via POST `/api/v3/order` with quantity 0.001 and verify with GET `/api/v3/order.`

### Portfolio and Risk Reporting

Treasury or fund operations teams pull `/api/v3/account` for balances, `/api/v3/myTrades` for fills, and `/api/v3/allOrders` for order history to build daily P&L and exposure reports. Combined with `/api/v3/tradeFee` per symbol, these endpoints supply the data needed to reconcile execution costs across the trading desk.

Example prompt: Call `/api/v3/account`, then for each non-zero balance call `/api/v3/myTrades` with the corresponding symbol over the last 24 hours.

### Treasury Movements and Withdrawals

Operations teams managing exchange treasury use `/api/v3/capital/deposit/address` to provision deposit addresses, `/api/v3/capital/withdraw` to push funds to external wallets, and `/api/v3/capital/transfer` to move balances between MEXC accounts. Withdrawal history endpoints close the audit loop for compliance.

Example prompt: Generate a USDT deposit address on TRC-20 via POST `/api/v3/capital/deposit/address`, then later submit a withdrawal of 100 USDT via POST `/api/v3/capital/withdraw.`

### Agent-Driven Crypto Workflows

An AI agent monitoring a portfolio can call MEXC through Jentic to rebalance, place hedges, or pull live quotes. The agent searches by intent, loads the operation schema, and executes with the signed payload handled by the SDK - and the MEXC API key plus secret stay inside your Jentic One instance rather than appearing in the agent's context.

Example prompt: Search Jentic for 'place a spot order on MEXC', load POST `/api/v3/order`, then submit a market sell of 10 USDT worth of BTC.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/v3/order` | Place a new spot order |
| DELETE | `/api/v3/order` | Cancel an open order |
| GET | `/api/v3/depth` | Get order book depth for a symbol |
| GET | `/api/v3/klines` | Get candlestick data for a symbol |
| GET | `/api/v3/account` | Get account information and balances |
| POST | `/api/v3/capital/withdraw` | Submit a withdrawal request |
| GET | `/api/v3/openOrders` | List current open orders |

## Key resources

- **Market Data** — Server time, exchange info, depth, trades, klines, average price, and ticker endpoints
- **Spot Orders** — Place, query, cancel, and batch spot orders, plus list open and historical orders
- **Account** — Account information, balances, and per-account trade history
- **Capital** — Deposit addresses, withdrawals, transfers, and deposit/withdrawal history across networks

## Why Jentic

- **Setup:** Wiring the MEXC Spot API by hand means holding both an API key and a secret, sending the key in the X-MEXC-APIKEY header, and computing an HMAC-SHA256 signature with a timestamp on every signed call yourself. Through Jentic you install once, import the MEXC Spot API from the API Directory, store the key and secret once, and your agent calls it.
- **Permission scoping:** MEXC carries the trading target in the request parameters rather than a fixed URL path resource, so limit the agent to the operations it needs, such as reading depth, klines, or account balances. You choose which operations it may call, so placing an order, cancelling one, or a capital withdrawal is not included unless you add it.
- **Credential handling:** Your MEXC API key and secret signing material are stored once, encrypted, by your own Jentic One instance and applied as the X-MEXC-APIKEY header plus the request signature at execution time. Neither enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'place a spot order' or 'get my account balances', and Jentic returns the matching MEXC operation with its parameter and signature schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Binance** — Largest crypto exchange with similar spot trading endpoints
- **Kraken** — Crypto exchange with strong fiat on-ramps
- **KuCoin** — Spot exchange with similar order and wallet endpoints
- **OKX** — Exchange with combined spot, derivatives, and DeFi APIs

## FAQ

### What authentication does the MEXC Spot API use?

MEXC uses an API key in the X-MEXC-APIKEY header along with HMAC-SHA256 request signing for private endpoints. Through Jentic the API key is stored encrypted and the SDK applies the signature when executing private operations.

### Can I place batch orders on MEXC?

Yes - POST `/api/v3/batchOrders` accepts up to 20 orders in a single call, which is the recommended pattern for market-making and grid strategies that need to refresh many quotes at once.

### What are the rate limits for the MEXC Spot API?

MEXC publishes weight-based limits on the public docs rather than in this OpenAPI spec - market data and account endpoints have separate buckets, and order endpoints use a per-second order rate limit. Watch for 429 and 418 responses and respect the Retry-After header.

### How do I cancel all open orders for a symbol through Jentic?

Search Jentic for 'cancel all MEXC open orders', load DELETE `/api/v3/openOrders`, and execute with the symbol parameter. Jentic adds the X-MEXC-APIKEY header and the request signature from your stored credential.

### Is the MEXC Spot API free?

API access is free for MEXC account holders. Trading still incurs MEXC's standard maker and taker fees per symbol, which you can query via GET `/api/v3/tradeFee.`

### Does this API cover futures or perpetual contracts?

No - this is the spot v3 API. MEXC's futures and contract products live on a separate API surface and are not part of these 32 endpoints.

### Can I limit what my agent is allowed to do with the MEXC Spot API?

Yes. Because Jentic One is self-hosted, you decide which MEXC operations the agent may call and which credentials it uses, so you can allow read-only calls like order book depth, klines, or account balances while excluding anything else. Since MEXC carries the trading target in the request parameters rather than a fixed URL path, you scope by operation: placing an order, cancelling one, or making a capital withdrawal is only reachable if you explicitly add it.
