Skip to content
🎉 Welcome to atWallets Ecosystem! Visit AirDrop Rewards
Mexc

Mexc

BingX API Information

Mexc Api Link: https://www.mexc.com/api-docs/spot-v3/general-info

Base Endpoint

The base endpoint is:

https://api.mexc.com

HTTP Return Codes

  • HTTP 4XX – Malformed requests; issue is on the sender’s side.
  • HTTP 403 – WAF Limit (Web Application Firewall) violated.
  • HTTP 429 – Request rate limit exceeded.
  • HTTP 5XX – Internal server errors; issue is on MEXC’s side. Execution status is UNKNOWN and may have succeeded.

General Information on Endpoints

  • The API accepts GET, POST, and DELETE requests.
  • For GET endpoints, parameters must be sent as query string.
  • For POST, PUT, and DELETE:
    • Parameters may be sent as:
      • Query string (application/x-www-form-urlencoded)
      • Request body (application/json)
    • You may mix parameters between both.
  • Parameters may be in any order.
  • If a parameter appears in both query string and body, query string wins.

Header

Relevant request headers:

KeyDescription
X-MEXC-APIKEYAccess key
Content-Typeapplication/json

LIMITS

There is a rate limit for API access frequency. If exceeded → 429 Too Many Requests

  • Endpoints with API keys → rate limited by account (UID)
  • Endpoints without API keys → rate limited by IP

Limits Description

  • IP and UID limits are independent.
  • Endpoints indicate whether they use IP or UID limits and show their weight.
  • Each endpoint with IP limits → 500 requests per 10 seconds
  • Each endpoint with UID limits → 500 requests per 10 seconds

Limits Error

  • Upon receiving 429, the client must back off immediately.
  • Repeated violations → automated IP ban
  • Ban durations scale from 2 minutes → 3 days
  • Retry-After header is included with 418 or 429
    • Indicates required wait time.

Error Codes

CodeDescription
-2011Unknown order sent
26operation not allowed
400api key required
401No authority
403Access Denied
429Too Many Requests
500Internal error
503service not available, please try again
504Gateway Time-out
602Signature verification failed
10001user does not exist
10007bad symbol
10015user id cannot be null
10072invalid access key
10073invalid Request-Time
10095amount cannot be null
10096amount decimal places is too long
10097amount is error
10098risk control system detected abnormal
10099user sub account does not open
10100this currency transfer is not supported
10101Insufficient balance
10102amount cannot be zero or negative
10103this account transfer is not supported
10200transfer operation processing
10201transfer in failed
10202transfer out failed
10206transfer is disabled
10211transfer is forbidden
10212This withdrawal address is not on the commonly used address list or has been invalidated
10216no address available. Please try again later
10219asset flow writing failed please try again
10222currency cannot be null
10232currency does not exist
10259Intermediate account does not configured in redisredis
10265Due to risk control, withdrawal is unavailable, please try again later
10268remark length is too long
20001subsystem is not supported
20002Internal system error please contact support
22222record does not exist
30000suspended transaction for the symbol
30001The current transaction direction is not allowed to place an order
30002The minimum transaction volume cannot be less than :
30003The maximum transaction volume cannot be greater than :
30004Insufficient position
30005Oversold
30010no valid trade price
30014invalid symbol
30016trading disabled
30018market order is disabled
30019api market order is disabled
30020no permission for the symbol
30021invalid symbol
30025no exist opponent order
30026invalid order ids
30027The currency has reached the maximum position limit, the buying is suspended
30028The currency triggered the platform risk control, the selling is suspended
30029Cannot exceed the maximum order limit
30032Cannot exceed the maximum position
30041current order type can not place order
33333param is error
44444param cannot be null
60005your account is abnormal
70011Pair user ban trade apikey
700001API-key format invalid
700002Signature for this request is not valid
700003Timestamp for this request is outside of the recvWindow
700004Param ‘origClientOrderId’ or ‘orderId’ must be sent, but both were empty/null
700005recvWindow must less than 60000
700006IP non white list
700007No permission to access the endpoint
700008Illegal characters found in parameter
730001Pair not found
730002Your input param is invalid
730000Request failed, please contact the customer service
730001User information error
730002Parameter error
730003Unsupported operation, please contact the customer service
730100Unusual user status
730600Sub-account Name cannot be null
730601Sub-account Name must be a combination of 8-32 letters and numbers
730602Sub-account remarks cannot be null
730700API KEY remarks cannot be null
730701API KEY permission cannot be null
730702API KEY permission does not exist
730703The IP information is incorrect, and a maximum of 10 IPs are allowed to be bound only
730704The bound IP format is incorrect, please refill
730705At most 30 groups of Api Keys are allowed to be created only
730706API KEY information does not exist
730707accessKey cannot be null
730101The user Name already exists
140001sub account does not exist
140002sub account is forbidden

RCXT Mexc API Information

There is 1 Base Endpoint for the Mexc exchange:

  • apiUrl: /api.mexc.com
  • fapiUrl: /contract.mexc.com

Rate Limits

The rate limit set for each endpoint on the Mexc exchange is as follows:

Limit (1 minute)SpotUsd FuturesCoin FuturesTransferInTransferOutTicker
Fetch Balances10 Request Weight1 Request Weight1 Request Weight
Fetch Orders10 Request Weight10 Request Weight10 Request Weight
Fetch Trades10 Request Weight1 Request Weight1 Request Weight
Fetch DepositWithdrawals1 Request Weight1 Request Weight
Ticker1 Request Weight

Fetch Balances

Spot Balance
  • The Base Endpoint is apiUrl (api.mexc.com).
  • The Endpoint used is /api/v3/account.
  • The RCXT Endpoint is api/v1/mexc/balances.

The user sends a GET request to query the Mexc wallet balances. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Spot Balance is 10.
Usd Futures Balance
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/account/assets.
  • The RCXT Endpoint is api/v1/mexc/balances.

The user sends a GET request to query the Mexc wallet balances. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Spot Balance is 1.
Coin Futures Balance
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/account/assets.
  • The RCXT Endpoint is api/v1/mexc/balances.

The user sends a GET request to query the Mexc wallet balances. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Spot Balance is 1.

Response Example:

{
  "spot": [
    {
      "coin": "BTTC", #asset
      "total": "208850.4"
    }
  ],
  "margin": null,
  "isolatedMargin": null,
  "futures": [
    {
      "coin": "USDT", # asset
      "total": "0.03733590"
    },
    {
      "coin": "DOGE", #asset
      "total": "2000.00000000"
    }
  ],
  "earnings": null
}

Fetch Trades

Spot Trades
  • The Base Endpoint is apiUrl (api.mexc.com).
  • The Endpoint used is /api/v3/myTrades.
  • The RCXT Endpoint is api/v1/mexc/trades.

The user sends a GET request to query the Mexc Spot trades. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the trade (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: The type is set to spot for Spot Trades.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Spot Trades is 10.
Usd Futures Trades
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/order/list/order_deals.
  • The RCXT Endpoint is api/v1/mexc/trades.

The user sends a GET request to query the Mexc Usd Futures trades. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the trade (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: The type is set to uFutures for Usd Futures Trades.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Usd Futures Trades is 1.
Coin Futures Trades
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/order/list/order_deals.
  • The RCXT Endpoint is api/v1/mexc/trades.

The user sends a GET request to query the Mexc Coin Futures trades. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the trade (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: The type is set to cFutures for Coin Futures Trades.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Coin Futures Trades is 1.

Response Example:

{
  "orders": [
    {
      "orderId": "1881364520706670592", #orderId
      "symbol": "XRPUSDT", #symbol
      "type": "MARKET", #type
      "price": "3.335", #price
      "side": "SELL", #side
      "time": 1737387230537, #time
      "status": "CLOSED", #status
      "executedQuantity": "2.7", #executedQty
      "quantity": "2.7" #origiQty
    }
  ],
  "cursor": ""
}

Fetch Orders

Spot Orders
  • The Base Endpoint is apiUrl (api.mexc.com).
  • The Endpoint used is /api/v3/allOrders.
  • The RCXT Endpoint is api/v1/mexc/orders.

The user sends a GET request to query Mexc Spot orders. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the order (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: Options include spot, cfutures, ufutures. spot should be selected for Spot Orders.
    • orderStatus: If orderStatus is “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Spot Orders is 10.
Spot Open Orders
  • The Base Endpoint is apiUrl (api.mexc.com).
  • The Endpoint used is /api/v3/openOrders.
  • The RCXT Endpoint is api/v1/mexc/orders.

The user sends a GET request to query Mexc Spot orders. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the order (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: Options include spot, cfutures, ufutures. spot should be selected for Spot Open Orders.
    • orderStatus: If orderStatus is “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Spot Open Orders is 3.
Usd Futures Orders
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/order/list/history_orders.
  • The RCXT Endpoint is api/v1/mexc/orders.

The user sends a GET request to query Mexc Spot orders. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the order (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: Options include spot, cfutures, ufutures. spot should be selected for Usd Futures Orders.
    • orderStatus: If orderStatus is “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Usd Futures Orders is 10.
Usd Futures Open Orders
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/order/list/open_orders.
  • The RCXT Endpoint is api/v1/mexc/orders.

The user sends a GET request to query Mexc Spot orders. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the order (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: Options include spot, cfutures, ufutures. spot should be selected for Usd Futures Open Orders.
    • orderStatus: If orderStatus is “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Usd Futures Open Orders is 10.
Coin Futures Orders
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/order/list/history_orders.
  • The RCXT Endpoint is api/v1/mexc/orders.

The user sends a GET request to query Mexc Spot orders. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the order (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: Options include spot, cfutures, ufutures. spot should be selected for Coin Futures Orders.
    • orderStatus: If orderStatus is “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Coin Futures Orders is 10.
Coin Futures Open Orders
  • The Base Endpoint is apiUrl (contract.mexc.com).
  • The Endpoint used is /api/v1/private/order/list/open_orders.
  • The RCXT Endpoint is api/v1/mexc/orders.

The user sends a GET request to query Mexc Spot orders. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • endTime: The date until which we want to fetch data.
    • symbol: The symbol of the pair used in the order (e.g., BTCUSDT).
    • page: Used for pagination, specifies the page to retrieve.
    • type: Options include spot, cfutures, ufutures. spot should be selected for Coin Futures Open Orders.
    • orderStatus: If orderStatus is “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Coin Futures Open Orders is 10.

Response Example:

{
  "orders": [
    {
      "orderId": "1881364520706670592", #orderId
      "symbol": "XRPUSDT", #symbol
      "type": "MARKET", #type
      "price": "3.335", #price
      "side": "SELL", #side
      "time": 1737387230537, #time
      "status": "CLOSED", #status
      "executedQuantity": "2.7", #executedQty
      "quantity": "2.7" #origiQty
    }
  ],
  "cursor": ""
}

Fetch DepositWithdrawals

Transfer In
  • The Base Endpoint is apiUrl (api.mexc.com).
  • The Endpoint used is /api/v3/capital/deposit/hisrec.
  • The RCXT Endpoint is api/v1/mexc/deposit-withdraw-history.

The user sends a GET request to query Mexc transfer-in data. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • fromId: The transfer ID used to filter the specific transfer.
    • type: Options include transferIn and transferOut. transferIn should be selected for Transfer In.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Transfer In is 1.
Transfer Out
  • The Base Endpoint is apiUrl (api.mexc.com).
  • The Endpoint used is /api/v3/capital/withdraw/history.
  • The RCXT Endpoint is api/v1/mexc/deposit-withdraw-history.

The user sends a GET request to query Mexc transfer-out data. This request must include the required header parameters:

  • The apiKey and secretKey values are taken from the header.

  • The following query parameters are required:

    • startTime: The date from which we want to fetch data.
    • fromId: The transfer ID used to filter the specific transfer.
    • type: Options include transferIn and transferOut. transferOut should be selected for Transfer Out.
  • Limiter:

    • Each API endpoint is assigned a specific Request Weight value. The Request Weight value for Transfer Out is 1.

Response Example:

{
  "depositWithdrawals": [
    {
      "fiatCurrency": "",
      "cryptoCurrency": "USDT", #coin
      "fiatAmount": "",
      "cryptoAmount": "10", #amount
      "price": "",
      "address": "TNZcfzLhPXVUVe1NLyjdGrjKkPLbHbncJk", #address
      "orderId": "",
      "transactionId": "e4e406a067ff5ce1c05abc6056e6041478153fc03ba996b565f4727b01a708d8", #txId
      "fee": "",
      "network": "TRC20", #network
      "status": "1", #status
      "time": 1726576711847 #insertTime
    }
  ],
  "cursor": ""
}

Fetch Ticker

Ticker
  • The Base Endpoint is apiUrl (api.mexc.com).

  • The Endpoint used is /api/v3/ticker/price.

  • The RCXT Endpoint is api/v1/mexc/ticker.

  • https://api.mexc.com/api/v3/ticker/24hr: Provides the symbol and current price for cryptocurrency pairs traded only with USDT.

  • The only query parameter required is symbol (e.g. BTCUSDT):

    • symbol: Specifies the symbol of the cryptocurrency pair.

Response Example:

{
  "symbol": "BTCUSDT", #symbol
  "price": "104562.53000000" #price
}