CCXT

CCXT vs the MEXC API and official MEXC SDK

MEXC's official SDK covers spot only. CCXT covers spot, margin and futures in one client, decodes the protobuf WebSocket feed and exposes 238 raw endpoints.

MEXC publishes an official connector, mexcdevelop/mexc-api-sdk, generated into five languages from one spec. It covers the spot v3 REST API. CCXT speaks the same API, plus MEXC's margin and contract endpoints and its WebSocket feed, behind method names shared with 104 other venues.

The question that decides between them: do you need anything beyond spot REST?

TL;DR

  • Pick the official MEXC SDK if you only ever call spot REST endpoints, you want method names that match MEXC's docs literally, and a git clone install is acceptable in your build.
  • Pick CCXT if you need MEXC's swap markets, margin, or its WebSocket streams — the official SDK covers none of those, and MEXC's spot streams are Protocol Buffers, not JSON.
  • CCXT is not a lowest common denominator here. All 238 MEXC endpoints are generated as implicit methods, signed and rate-limited like everything else.

At a glance

CCXTOfficial MEXC SDK
Exchanges covered104 (MEXC is one of them)MEXC only
LanguagesTypeScript, JavaScript, Python, PHP, C#/.NET, Go, Java — one APIPython, JavaScript, Go, Java, .NET — generated from one spec
Installpip install ccxt / npm i ccxtgit clone, then unzip the dist/ folder for your language
MEXC products coveredspot, margin, swapspot
Unified market data + trading APIyes — same method names on every exchangeno — MEXC's own request/response shapes
WebSocketsyes — 16 watch* / unWatch* methods, protobuf decoded for younot in the SDK
Raw endpoint accessyes — 238 MEXC endpoints as implicit methodsspot endpoints only
Built-in rate limiteryes, per-endpoint weights, on by default (rateLimit 50 ms)no
Unified error typesyes — 41 typed exceptions in one hierarchyHTTP status + MEXC error codes
Testnet / sandboxno — MEXC has no sandbox in CCXTno
Popularity43.8k GitHub stars · 4.8M PyPI + 494k npm installs/month (one package, every venue)316 GitHub stars, 134 forks; last repository update February 2024
LicenceMITMIT
SupportDiscord, Telegram, GitHub issues — usually same-dayGitHub issues

Figures verified September 2026 against CCXT v4.5.77, the mexcdevelop/mexc-api-sdk repository and MEXC's published spot v3 and contract v1 API documentation.

CCXT implements 83 unified capabilities for MEXC — 40 of them fetch* methods — and marks it a certified exchange, meaning it is covered by the static request/response regression fixtures that run in CI.

The same job, written both ways

Fetch a ticker

import ccxt

exchange = ccxt.mexc()
ticker = exchange.fetch_ticker('BTC/USDT')
print(ticker['last'], ticker['baseVolume'])

CCXT returns a unified ticker structure — same keys, same types, same units on every venue. The SDK returns MEXC's payload as it arrives.

Place a limit order

import ccxt

exchange = ccxt.mexc({'apiKey': '...', 'secret': '...'})
order = exchange.create_order('BTC/USDT', 'limit', 'buy', 0.001, 60000)
print(order['id'], order['status'])

To reach MEXC's swap markets you change one option in CCXT and nothing else:

exchange = ccxt.mexc({'apiKey': '...', 'secret': '...',
                      'options': {'defaultType': 'swap'}})
positions = exchange.fetch_positions(['BTC/USDT:USDT'])

The official SDK has no contract client at all.

Stream an order book

import ccxt.pro
import asyncio

async def main():
    exchange = ccxt.pro.mexc()
    while True:
        orderbook = await exchange.watch_order_book('BTC/USDT')
        print(orderbook['bids'][0], orderbook['asks'][0])

asyncio.run(main())

This is the largest practical gap between the two options. MEXC's spot streams are Protocol Buffers: the exchange publishes schemas in mexcdevelop/websocket-proto — 16 .proto files covering tickers, depths, trades, klines, account, orders and deals — and leaves the client to you. CCXT decodes those frames internally and hands you the same order book, trade and order structures that fetch_order_book, fetch_trades and fetch_orders return.

It also runs the parts around the socket: the REST snapshot fetch and delta alignment, reconnect and resubscribe, bounded caches, and the private-stream listenKey refresh on a 20-minute timer so your user-data stream does not expire silently.

Where the differences actually bite

The official SDK is spot-only

MEXC's spot v3 API and its contract v1 API are separate products with different base URLs and different signing headers — spot signs totalParams with HMAC-SHA256 into a signature query parameter, contract signs accessKey + timestamp + requestParam into a Signature header alongside ApiKey and Request-Time. The official SDK implements the first and not the second.

CCXT implements both behind one class. options.defaultType picks spot or swap; 'BTC/USDT' and 'BTC/USDT:USDT' pick the market.

One thing to know before you plan around it: MEXC's own contract documentation carries a notice dated 2022-07-25 stating that the contract place order and cancel order endpoints are closed temporarily while query endpoints stay available, and marks those endpoints "(Under maintenance)". CCXT exposes them either way — the availability is MEXC's call, not the library's.

Installation

The official SDK is not published to PyPI or npm by MEXC. Its README installs it by cloning the repository and unzipping the dist/ folder for your language. That works, but it does not pin cleanly in a lockfile or a container build. CCXT is one package from your language's ordinary registry.

Seven languages, one API

CCXT is written once in TypeScript and transpiled to JavaScript, Python, PHP, C#/.NET, Go and Java, with identical method names and return structures.

import ccxt
exchange = ccxt.mexc()
ticker = exchange.fetch_ticker('BTC/USDT')

MEXC's SDK is also generated into five languages, but each is a MEXC-shaped client — not a portable API you can point at a second venue.

Rate limits you do not have to model

MEXC meters per endpoint with weights, at 500 requests per 10 seconds per endpoint by IP and again by UID, and disconnects WebSocket clients above 100 messages per second. CCXT encodes the weights in the exchange definition and ships a token-bucket throttler that is on by default (enableRateLimit = true, rateLimit = 50 ms). You write loops; the library paces them.

One error hierarchy

CCXT maps MEXC's numeric codes onto a typed exception treeInsufficientFunds, InvalidOrder, OrderNotFound, RateLimitExceeded, AuthenticationError, OnMaintenance and 35 more, all under BaseError. You catch ccxt.InsufficientFunds once instead of matching on a code that may be re-used differently on the next venue.

Nothing is hidden — the implicit API

Alongside the 83 unified capabilities, all 238 MEXC endpoints are callable as implicit methods, with signing, timestamping and rate-limit accounting applied:

response = exchange.spot_private_get_capital_config_getall()

Browse them on the mexc implicit API page.

What the official MEXC SDK does better

Honestly, and these are real:

  • Literal fidelity to MEXC's docs. ticker24hr(), newOrder(), depth() — the names and fields are exactly what you are reading in the MEXC API reference. CCXT's unified names are a deliberate abstraction, which is one extra hop when you are debugging against the vendor documentation.
  • Vendor-generated across five languages from one spec. The Python, JavaScript, Go, Java and .NET builds come from the same generator, so a team split across languages sees the same MEXC-shaped surface. MEXC also publishes a Postman collection for exploring endpoints before writing code.
  • A much smaller dependency for spot-only work. If all your process does is poll spot tickers, the SDK is a fraction of the size of CCXT.
  • New MEXC spot features land in the vendor's own client first. A unified CCXT wrapper for a brand-new MEXC feature may lag the vendor SDK, even though the implicit API closes most of that gap on day one.

If MEXC spot REST is the whole of your integration and it always will be, the official SDK is a defensible choice. As soon as futures or streaming enters the plan, you are writing the missing client yourself.

There is also a widely used community Python wrapper, makarworld/pymexc — MIT, 65 GitHub stars, roughly 2.9k PyPI installs a month — which does cover spot and futures HTTP plus WebSocket classes. It describes itself as unofficial.

Migrating from the MEXC SDK to CCXT

What you are doingMEXC SDKCCXT
Symbols'BTCUSDT''BTC/USDT' spot, 'BTC/USDT:USDT' swap
Product selectionspot client onlyoptions.defaultType = spot / margin / swap
Exchange infoexchangeInfo()load_markets()
24h tickerticker24hr()fetch_ticker() / fetch_tickers()
Depthdepth()fetch_order_book()
Klinesklines()fetch_ohlcv()
New ordernewOrder()create_order()
Cancel ordercancelOrder()cancel_order()
Open ordersopenOrders()fetch_open_orders()
AccountaccountInfo()fetch_balance()
Streamsnot in the SDKwatch_* on ccxt.pro.mexc
Anything not listedthe same endpoint as an implicit method

FAQ

Does MEXC have an official Python SDK? Yes — mexcdevelop/mexc-api-sdk, MIT-licensed, generated into Python, JavaScript, Go, Java and .NET. It covers the spot v3 REST API. It is installed by cloning the repository and unzipping the dist/ folder rather than from PyPI, and it does not include a WebSocket client or the contract API.

Does CCXT support MEXC futures? Yes. ccxt.mexc covers spot, margin and swap markets from one instance, selected with options.defaultType and unified symbols such as 'BTC/USDT:USDT'. Note that MEXC's own contract docs flag the contract order-placement endpoints as under maintenance; that is a venue-side status, not a CCXT limitation.

How do I read MEXC's protobuf WebSocket feed? MEXC publishes .proto schemas rather than a client. CCXT decodes those frames for you: use ccxt.pro.mexc and call watch_order_book, watch_trades, watch_ohlcv, watch_ticker, watch_orders, watch_my_trades or watch_balance — 16 watch*/unWatch* methods in total — and you get the same structures the REST methods return.

Does MEXC have a testnet, and does setSandboxMode work? CCXT does not define sandbox URLs for MEXC, so setSandboxMode(True) will not switch you to a test environment. Test against small live orders or against the static fixtures instead.

Do I need CCXT Pro separately for WebSockets? No. CCXT Pro is bundled in the ccxt package under MIT. Use ccxt.pro.mexc and call watch* methods.

Can I still call MEXC-specific endpoints through CCXT? Yes — all 238 of them, as implicit methods, with signing and rate limiting applied.

Next steps

On this page