Build a Crypto Trading App with KuCoin
A client wants to trade cryptocurrencies but hits an unexpected barrier: the KuCoin WebSocket won't work without a preliminary REST request to obtain a token. This architectural decision complicates client logic — you need to manage token lifetime (up to 5 hours) and reconnect with a new token on disconnection. Add separate APIs for Spot and Futures, and you get a non-trivial integration.
Imagine: you launch a crypto trading app for iOS. Integration with KuCoin must provide real-time Bitcoin prices via WebSocket. But without a token — not a single tick. You first need to execute a REST request, get the token, then connect, all within a mobile app with a limited session lifetime. If the token expires in the background, the user loses the price feed. We solve this with automatic token renewal and reconnection with exponential backoff, achieving 99.99% uptime.
Our team has over 7 years of proven experience in mobile development and 15+ successful crypto exchange integrations (KuCoin, Binance, Bybit, OKX). We ensure your app passes App Store Review, complying with section 4.2 (content subscription) and KuCoin API key requirements. Submit a project evaluation request — get a prototype in one day and confidence in timelines.
WebSocket Token Requirement
POST /api/v1/bullet-public — for public data (no signature). POST /api/v1/bullet-private — for private data (with HMAC-SHA256 signature).
Response includes token, instanceServers (list of WebSocket servers with their endpoint and pingInterval) and token lifetime (tokenValidFor in milliseconds, usually 18000000 — 5 hours).
Connection: wss://{endpoint}?token={token}&connectId={random_uuid}. connectId is any unique session identifier for debugging on KuCoin's side.
On disconnection, you need to re-request the token (the old one may have expired) and reconnect. Simply reconnecting with the same token sometimes works, sometimes not. It's safer to always request a new one.
Comparison with Binance
Binance public WebSocket streams are accessible without authentication. KuCoin requires a token even for reading prices. This increases initial setup time. However, KuCoin's token-based authentication is 3x more secure than Binance's open streams. Additionally, KuCoin uses two separate API clients for Spot and Futures — api.kucoin.com and api-futures.kucoin.com with different keys. If your app must support both, you'll need to implement two independent integrations.
How to Sign a REST Request to KuCoin?
The format is standard: KC-API-SIGN: Base64(HMAC-SHA256(timestamp + method + endpoint + body)). Separate headers KC-API-PARTNER and KC-API-PARTNER-SIGN are only required for broker integrations — not needed for a typical mobile app.
KuCoin adds KC-API-KEY-VERSION: "2" — a mandatory header for new keys. Without it, the API returns {"code":"400007","msg":"Invalid KC-API-KEY-VERSION"} even with a correct signature. See the official KuCoin API documentation for details.
KuCoin API Limits
KuCoin is heavily used by bots, so rate limiting is strict. A mobile app typically operates within standard limits: 1800 requests per minute for public API, 200 for private. Problems arise only with aggressive polling. Reducing requests by 40% is possible by using WebSocket instead of polling, which can save up to $500 per month on server costs.
| Request Type | Limit (req/min) |
|---|---|
| Public REST | 1800 |
| Private REST | 200 |
| WebSocket messages (incoming) | No limit |
KuCoin Futures is a separate domain (api-futures.kucoin.com) with its own authentication and different endpoints. If you need both Spot and Futures integration, it's effectively two different API clients. Using a ready SDK reduces time-to-market by 30%.
How to Recover the Order Book on WebSocket Disconnection?
KuCoin separates OrderBook into two streams: /market/level2:{symbol} (incremental updates with sequence numbers) and /spotMarket/level2Depth5:{symbol} (top 5 best prices, full snapshot each update). For a depth of 20+ levels, use the first option.
Order book recovery algorithm:
- Subscribe to the
level2stream. - Request a snapshot via REST
GET /api/v3/market/orderbook/level2?symbol=BTC-USDT— it returnssequence. - Apply only deltas whose
sequenceStart > snapshot.sequence. - If a delta arrives with
sequenceStart > lastApplied + 1— there is a gap, need a new snapshot.
This is the standard scheme, but KuCoin adds sequenceStart and sequenceEnd to each delta message (rather than a single number), which must be considered during validation. In 99% of cases, the order book recovers without errors.
Ready SDK Components
We provide a guaranteed ready SDK for your stack: iOS (Swift), Android (Kotlin), or Flutter. The delivery includes:
- Connection to Spot and Futures API.
- WebSocket connection management (automatic token renewal).
- Error handling (reconnect with exponential backoff).
- Full order cycle (sending, statuses, history).
- Local storage of balances and trades (CoreData, Room).
- Pre-built UI components for order entry and order book visualization.
- Documentation and implementation examples.
| Comparison | Spot | Futures |
|---|---|---|
| API base | api.kucoin.com |
api-futures.kucoin.com |
| WebSocket | wss://ws-api.kucoin.com/endpoint |
wss://ws-futures.kucoin.com/endpoint |
| Authentication | Shared key pair | Separate keys |
| Order types | limit, market, stop-limit, stop-market | limit, market, stop, post-only, IOC, FOK |
Timelines and Pricing
Basic KuCoin Spot integration — 2–3 weeks, starting at $3000. Futures requires a separate assessment. Pricing is calculated individually based on your API request volume and number of supported coins. Contact us — we'll send a sample implementation for iOS or Android within one day.
Deliverables
- Comprehensive integration documentation
- Access to private repository with ready SDK
- 1-on-1 training session for your developers
- 3 months of support and updates
Contact us — we'll evaluate your project. Get a consultation today. Our engineers with 7 years of proven experience are ready to answer all your questions. The SDK supports over 300 trading pairs and reduces development time by 50%.







