Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/kucoin-api/llms.txt
Use this file to discover all available pages before exploring further.
SpotClient is the primary REST client for KuCoin’s spot exchange. It maps every endpoint in the official KuCoin Spot and Margin REST API to a typed TypeScript method, covering account management, market data retrieval, high-frequency (HF) order placement, stop orders, OCO orders, margin borrowing and repayment, fund transfers, sub-account management, and earn/staking products. All private methods automatically sign requests using your API credentials, so you never need to construct authentication headers manually.
Installation
Initialization
Store your API key, secret, and passphrase in environment variables. Never hard-code credentials in source files.
Feature Overview
Account & Balances
Query account summaries, spot/margin/isolated margin balances, transaction history (HF and standard), and API key metadata.
Market Data
Fetch all symbols, tickers, 24 h stats, order books (level 2/3), candlestick (kline) data, trade histories, and fiat prices. All endpoints are public.
HF Trading Orders
High-frequency order placement, batch submission, modification, sync cancellation, and dead-cancel-all (auto-cancel) via the
api/v1/hf/orders family of endpoints.Stop Orders & OCO
Submit and manage stop orders with trigger prices, and One-Cancels-the-Other (OCO) orders that atomically cancel the other leg on fill.
Margin Trading
Cross and isolated margin order placement (HF), borrowing, repayment, interest history, mark prices, risk limits, and leveraged token (ETF) data.
Deposits & Withdrawals
Create deposit addresses (v1/v2/v3), list deposits and withdrawals, submit withdrawals, check quotas, and perform flex (universal) transfers between account types.
Sub-Accounts
Create sub-accounts, manage their API keys, retrieve per-sub balances, and transfer funds between master and sub-accounts.
Earn Products
Subscribe to and redeem fixed-income, savings, staking (KCS, ETH), and promotion earn products; query current holdings and dual-investment/structured products.
Usage Examples
Account & Balances
Market Data
HF Order Placement
HF orders vs regular orders: KuCoin recommends using the HF (High-Frequency) order endpoints (
submitHFOrder, cancelHFOrder, etc.) for all new integrations. The older submitOrder / cancelOrderById endpoints still work but are marked deprecated in the SDK. HF orders process faster and support synchronous responses via submitHFOrderSync.Stop Orders & OCO Orders
Margin Trading (HF)
Deposits & Withdrawals
Sub-Accounts
Earn Products
Key Methods Reference
Account & Funding
Account & Funding
| Method | Auth | Description |
|---|---|---|
getAccountSummary() | ✅ | Full user account info |
getBalances() | ✅ | All account type balances |
getMarginBalance() | ✅ | Cross margin account balance |
getIsolatedMarginBalance() | ✅ | Isolated margin account balances |
getTransactions() | ✅ | Account ledger entries |
getHFTransactions() | ✅ | HF account ledger entries |
getBasicUserFee() | ✅ | Maker/taker fee rates |
getTradingPairFee() | ✅ | Actual fee for a specific symbol |
Market Data (Public)
Market Data (Public)
| Method | Auth | Description |
|---|---|---|
getSymbols() | ❌ | All tradable spot symbols |
getTicker() | ❌ | Best bid/ask + last price |
getTickers() | ❌ | All tickers in one response |
getKlines() | ❌ | Candlestick / OHLCV data |
getOrderBookLevel20() | ❌ | Top 20 bid/ask levels |
getOrderBookLevel100() | ❌ | Top 100 bid/ask levels |
getFullOrderBook() | ✅ | Complete order book |
get24hrStats() | ❌ | 24 h volume and price stats |
getTradeHistories() | ❌ | Recent public trades |
HF Spot Trading
HF Spot Trading
| Method | Auth | Description |
|---|---|---|
submitHFOrder() | ✅ | Place a single HF order |
submitHFOrderSync() | ✅ | Place HF order (synchronous response) |
submitHFMultipleOrders() | ✅ | Batch-place HF orders |
cancelHFOrder() | ✅ | Cancel by order ID |
cancelHFOrderByClientOId() | ✅ | Cancel by client order ID |
cancelHFAllOrdersBySymbol() | ✅ | Cancel all HF orders for a symbol |
updateHFOrder() | ✅ | Modify price/size of active HF order |
getHFActiveOrders() | ✅ | List active HF orders |
getHFCompletedOrders() | ✅ | List completed HF orders |
getHFFilledOrders() | ✅ | List HF order fills |
Stop Orders & OCO
Stop Orders & OCO
| Method | Auth | Description |
|---|---|---|
submitStopOrder() | ✅ | Place a stop/stop-limit order |
cancelStopOrderById() | ✅ | Cancel stop order by ID |
cancelStopOrders() | ✅ | Batch cancel stop orders |
getStopOrders() | ✅ | List untriggered stop orders |
submitOCOOrder() | ✅ | Place an OCO (spot) order |
cancelOCOOrderById() | ✅ | Cancel OCO by order ID |
getOCOOrders() | ✅ | List OCO orders |
Margin Trading (HF)
Margin Trading (HF)
| Method | Auth | Description |
|---|---|---|
submitHFMarginOrder() | ✅ | Place an HF margin order |
cancelHFMarginOrder() | ✅ | Cancel HF margin order |
getHFActiveMarginOrders() | ✅ | List active HF margin orders |
marginBorrowV3() | ✅ | Borrow on cross/isolated margin |
marginRepayV3() | ✅ | Repay borrowed margin |
getMarginBorrowHistoryV3() | ✅ | Borrow history |
getMarginInterestRecordsV3() | ✅ | Interest accrual records |
getBorrowInterestRate() | ✅ | Current borrow rates |
Related Pages
FuturesClient
Perpetual and delivery futures contracts, positions, and funding rates.
UnifiedAPIClient
KuCoin PRO unified account — cross-product trading from a single client.
BrokerClient
Broker sub-account creation, API key management, and rebate downloads.