CCXT

CCXT vs the raw Toobit API

Toobit publishes signing examples, not an SDK. CCXT compared on signing, weight-based rate limits, spot and swap coverage and streaming.

Toobit documents its API at api-docs.toobit.com and provides signing examples in Python, Java, Node.js, Go and cURL. What it does not publish is a maintained client library — the repositories under its toobit-docs organisation are documentation, a Python API demo and an agent kit, not an SDK. The one full-featured third-party library, JKorf/Toobit.Net, is a C#/.NET wrapper maintained outside the exchange.

So the comparison is between CCXT and your own HTTP and WebSocket client. The question that decides it: how much of the plumbing do you want to own?

TL;DR

  • Go direct if you call two or three endpoints, want request fields named exactly as the docs name them, or are on .NET and would rather use a Toobit-shaped typed wrapper.
  • Pick CCXT if you want spot and perpetual swap from one client, signing and weight accounting handled, 11 streaming methods that return the same structures as the REST calls, and 41 typed errors instead of numeric codes.
  • CCXT is not a subset. All 87 Toobit endpoints are generated as implicit methods, signed and throttled like the unified ones.

At a glance

CCXTRaw Toobit API
Exchanges covered104 (Toobit is one of them)Toobit only
LanguagesTypeScript, JavaScript, Python, PHP, C#/.NET, Go, Java — one APIwhatever you write it in
Official client librarynone; docs ship signing examples in Python, Java, Node.js, Go, cURL
Installpip install ccxt / npm i ccxtyour own HTTP and WebSocket client
Products in one clientspot and perpetual swapone code path per product family
Unified market data + trading APIyes — same method names on every exchangeno — Toobit's own request and response shapes
WebSocketsyes — 11 watch* methods, including watchOrderBookForSymbols and watchTradesForSymbolsyour own socket client
Raw endpoint accessyes — 87 Toobit endpoints as implicit methodsyes, it is the whole product
Built-in rate limiteryes, per-endpoint weights, on by default (rateLimit 20 ms)your code, against REQUEST_WEIGHT and ORDERS budgets
Unified error typesyes — 41 typed exceptions in one hierarchyHTTP 429 plus numeric codes such as -1003, -1015
Testnet / sandboxno — Toobit has no sandbox wired up in CCXTno
LicenceMIT
SupportDiscord, Telegram, GitHub issues — usually same-dayexchange support channels

Figures verified September 2026 against CCXT v4.5.77 and the published Toobit API documentation.

CCXT implements 49 unified capabilities for Toobit, 27 of them fetch* methods.

The same job, written both ways

Fetch a ticker

import ccxt

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

Public reads are the easy half. CCXT returns a unified ticker structure whose keys, types and units are the same on Toobit as on Binance or Kraken; the raw call returns Toobit's payload for you to parse.

Place a limit order

import ccxt

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

Toobit signs a lowercase hex HMAC-SHA256 over the concatenated query string and body, and the parameter order in the request must match the order used for the signature — reorder a dict and the request fails authentication for a reason that is not obvious from the error. The timestamp must be within one second of server time and inside recvWindow (default 5000 ms). CCXT builds all of it, and keeps the ordering stable.

Stream an order book

import ccxt.pro
import asyncio

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

asyncio.run(main())

CCXT hands you a merged, depth-limited order book structure on every update. The raw feed hands you snapshots and deltas and leaves the merge, the gap detection, the re-seed after a drop, the keep-alive and the resubscribe to you. watch_order_book_for_symbols does the same across a basket of symbols on one connection.

Where the differences actually bite

Spot and swap in one client

ccxt.toobit covers Toobit spot and perpetual swap markets in one instance. Unified symbols keep them apart — 'BTC/USDT' for spot, 'BTC/USDT:USDT' for the linear perpetual — and the method names do not change between them. Going direct means two sets of endpoint paths, two symbol conventions and two response shapes.

Rate limits you do not have to model

Toobit publishes two budgets: REQUEST_WEIGHT at 3,000 units per minute and ORDERS at 60 requests per 2 seconds, with HTTP 429 and error codes -1003 and -1015 when you exceed them, plus an X-Api-Limit-Reset-Timestamp header telling you when to retry. CCXT encodes per-endpoint costs in the exchange definition and ships a token-bucket throttler that is on by default (enableRateLimit = True, rateLimit = 20 ms). You call methods in a loop and the library paces them.

WebSockets that look like REST

watch_order_book returns the same structure as fetch_order_book; watch_orders the same as fetch_orders. Swapping a polling loop for a stream is a one-word change, and the code downstream is untouched. Underneath, CCXT handles connection pooling per URL, ping/pong keep-alive with miss detection, automatic reconnect and resubscribe, and bounded caches for trades and candles.

CCXT gives Toobit 11 streaming methods: watchTicker, watchTickers, watchTrades, watchTradesForSymbols, watchOHLCV, watchOHLCVForSymbols, watchOrderBook, watchOrderBookForSymbols, watchOrders, watchMyTrades and watchBalance. The private ones also need a listenKey, obtained from POST api/v1/listenKey and kept alive on a timer — CCXT manages that lifecycle so your user-data stream does not quietly stop delivering.

Precision, rounding and string math

Toobit rejects orders that violate a symbol's tick size, step size or minimum notional. CCXT loads that metadata with the markets and gives you helpers backed by the Precise string-arithmetic class, so quantities do not drift through float rounding:

amount = exchange.amount_to_precision('BTC/USDT', 0.0012345678)
price = exchange.price_to_precision('BTC/USDT', 61234.56789)

One error hierarchy

CCXT maps Toobit's numeric codes onto a typed exception treeInsufficientFunds, InvalidOrder, OrderNotFound, RateLimitExceeded, AuthenticationError, NetworkError and 35 more, all descending from BaseError. You write except ccxt.RateLimitExceeded once instead of matching on -1003 and -1015 separately and re-doing it on the next venue.

Nothing is hidden — the implicit API

Alongside the 49 unified capabilities, all 87 Toobit endpoints are generated as callable implicit methods, with signing, rate-limit accounting and error mapping applied. Browse them on the Toobit implicit API page.

What going direct does better

An honest list:

  • Field names match the docs exactly. When you are reading api-docs.toobit.com while debugging, a payload whose keys are origQty, executedQty and timeInForce lines up with the reference one field at a time. CCXT's unified names are a deliberate abstraction and one hop away from it.
  • The API is Binance-shaped, so existing tooling transfers. X-BB-APIKEY, HMAC-SHA256 over the query string, recvWindow, -1003/-1015 error codes and REQUEST_WEIGHT/ORDERS budgets will look familiar if you have written a Binance client. Pointing that client at Toobit is a smaller job than it looks.
  • Toobit.Net gives strongly typed .NET models. JKorf/Toobit.Net covers spot and futures REST and WebSocket with Toobit-shaped types. It is third-party rather than official, but if you are on .NET and want the exchange's own vocabulary, it exists.
  • New endpoints are available the moment they ship. Anything Toobit adds is callable over HTTP immediately. CCXT's implicit API picks it up on the next release; a unified wrapper may lag longer.
  • A smaller dependency. Three endpoints and thirty lines of signing code is less than all of CCXT.

If Toobit is your only venue and you only read public market data, going direct is perfectly reasonable.

Migrating from the raw Toobit API to CCXT

What you are doingRaw Toobit APICCXT
Base URLhttps://api.toobit.comhandled by the exchange definition
SymbolsBTCUSDT'BTC/USDT' (spot), 'BTC/USDT:USDT' (linear swap)
AuthX-BB-APIKEY + hex HMAC-SHA256 + timestamp + recvWindowcredentials on the constructor
Exchange infoGET api/v1/exchangeInfoload_markets()
24h tickerGET quote/v1/ticker/24hrfetch_ticker() / fetch_tickers()
Order bookGET quote/v1/depthfetch_order_book()
CandlesGET quote/v1/klinesfetch_ohlcv()
New orderPOST api/v1/spot/ordercreate_order()
Cancel orderDELETE api/v1/spot/ordercancel_order()
Open ordersGET api/v1/spot/openOrdersfetch_open_orders()
BalanceGET api/v1/accountfetch_balance()
Streamsyour own socket clientwatch_* on ccxt.pro.toobit
Anything not listedthe endpointthe same endpoint as an implicit method

FAQ

Does Toobit have an official SDK? No maintained client library. The documentation at api-docs.toobit.com provides signing and request examples in Python, Java, Node.js, Go and cURL, and the toobit-docs GitHub organisation hosts documentation, an API demo and an agent kit rather than an SDK. The most complete third-party library is JKorf/Toobit.Net for .NET.

How does Toobit authenticate API requests? API keys go in the X-BB-APIKEY header. Signed endpoints take a lowercase hex HMAC-SHA256 of the concatenated query string and request body, using the secret as the key, with a millisecond timestamp and an optional recvWindow (default 5000 ms). Parameter order in the request must match the order used to compute the signature. CCXT builds all of this for you.

Does CCXT support Toobit perpetual swaps as well as spot? Yes. One ccxt.toobit instance covers both. Use 'BTC/USDT' for spot and 'BTC/USDT:USDT' for the linear perpetual.

Does CCXT support a Toobit testnet? No. Toobit has no urls.test in CCXT, so set_sandbox_mode(True) will not work for it.

Do I need CCXT Pro separately for WebSockets? No. CCXT Pro is included in the ccxt package. Use ccxt.pro.toobit and call watch* methods — Toobit has 11 of them.

Is CCXT free? Yes. MIT-licensed, including the WebSocket support.

Next steps

On this page