SDK guide
JavaScript
REST API + WebSocket

KuCoin JavaScript SDK

Use kucoin-api to read KuCoin market data, manage orders, and consume streams from Node.js. JavaScript and TypeScript use the same clients; request and response types are included.

Choose a client

SpotClient
Classic Spot, Margin, funding, transfer, Earn, and Convert REST API calls
FuturesClient
Classic Futures market, account, order, position, and funding REST API calls
WebsocketClient
Classic and Pro public and private WebSocket subscriptions
WebsocketAPIClient
Awaitable Spot, Margin, and Futures order commands
BrokerClient
Broker subaccount, transfer, deposit, withdrawal, and rebate calls
UnifiedAPIClient
Developing Unified Account REST API surface

Make a first public request

In a Node.js project, install the package once. The REST and WebSocket API examples below use .mjs files so Node.js can run their imports directly.

npm install kucoin-api

REST walkthrough

Read public BTC-USDT Spot data with SpotClient. These public requests require no credentials.

Save the code as rest-public.mjs and run:

node rest-public.mjs
import { SpotClient } from 'kucoin-api'; const client = new SpotClient(); async function main() {  try {    const response = await client.getServerTime();    console.log('Server time:', response.data);  } catch (error) {    console.error('Server time request failed:', error);  }   try {    const response = await client.getSymbol({      symbol: 'BTC-USDT',    });    console.log('BTC-USDT metadata:', response.data);  } catch (error) {    console.error('Symbol request failed:', error);  }   try {    const response = await client.getTicker({      symbol: 'BTC-USDT',    });    console.log('BTC-USDT ticker:', response.data);  } catch (error) {    console.error('Ticker request failed:', error);  }   try {    const response = await client.getOrderBookLevel20({      symbol: 'BTC-USDT',    });    console.log('Best bid:', response.data.bids[0]);    console.log('Best ask:', response.data.asks[0]);  } catch (error) {    console.error('Order book request failed:', error);  }   try {    const response = await client.getKlines({      symbol: 'BTC-USDT',      type: '1hour',    });    console.log('Latest candle:', response.data[0]);  } catch (error) {    console.error('Candles request failed:', error);  }} main();

Expected response

Market values change on each run. These are the fields to check in the logged output.

FieldExpected result
Server time / metadataA Unix-millisecond number and the symbol object, including price and size increments.
Ticker / best bid / best askA ticker object and [price, quantity] decimal-string levels.
Latest candleAn array starting with Unix seconds, open, close, high, low, volume, and turnover. The example logs the first returned row.

More REST examples

Full KuCoin course

KuCoin API JavaScript Tutorial

A practical JavaScript guide to using kucoin-api across the KuCoin REST API, Classic WebSockets, safe Spot and Futures order tests, WebSocket API commands, regions, proxies, and reconnect recovery.

Spot, Margin, and Futures REST API coverage
Public and private Classic WebSocket channels
Safe Spot and Futures test-order examples
REST API and WebSocket proxy examples
REST API
WebSocket Streams
WebSocket API
Examples

Your app / service

bot, dashboard, worker

kucoin-api

SpotClient, FuturesClient, WebsocketClient, WebsocketAPIClient

KuCoin API

REST API, Classic streams, Pro streams, WebSocket API

Common KuCoin implementation tasks

Endpoint Function Reference

Endpoint maps

Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.

The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if API keys are provided), as well as the exact endpoint each method is connected to.

This can be used to easily find which method to call, once you have found which endpoint you're looking to use.

All REST clients are in the src folder. For usage examples, make sure to check the examples folder.

List of clients:

If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!

How to use table

Table consists of 4 parts:

  • Function name
  • AUTH
  • HTTP Method
  • Endpoint

Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!

AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your API key and secret to the SDK.

HTTP Method shows HTTP method that the function uses to call the endpoint. Sometimes endpoints can have same URL, but different HTTP method so you can use this column to differentiate between them.

Endpoint is the URL that the function uses to call the endpoint. Best way to find exact function you need for the endpoint is to search for URL in this table and find corresponding function name.

SpotClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in SpotClient.ts.

FunctionAUTHHTTP MethodEndpoint
getMyIp()GETapi/v1/ip
getServiceStatus()GETapi/v1/status
getAccountSummary()🔐GETapi/v2/user-info
getKYCRegions()🔐GETapi/kyc/regions/v4
getApikeyInfo()🔐GETapi/v1/user/api-key
getUserType()🔐GETapi/v1/hf/accounts/opened
getBalances()🔐GETapi/v1/accounts
getAccountDetail()🔐GETapi/v1/accounts/{accountId}
getMarginBalance()🔐GETapi/v3/margin/accounts
getIsolatedMarginBalance()🔐GETapi/v3/isolated/accounts
getTransactions()🔐GETapi/v1/accounts/ledgers
getHFTransactions()🔐GETapi/v1/hf/accounts/ledgers
getHFMarginTransactions()🔐GETapi/v3/hf/margin/account/ledgers
createSubAccount()🔐POSTapi/v2/sub/user/created
enableSubAccountMargin()🔐POSTapi/v3/sub/user/margin/enable
enableSubAccountFutures()🔐POSTapi/v3/sub/user/futures/enable
getSubAccountsV2()🔐GETapi/v2/sub/user
getSubAccountBalance()🔐GETapi/v1/sub-accounts/{subUserId}
getSubAccountBalancesV2()🔐GETapi/v2/sub-accounts
createSubAPI()🔐POSTapi/v1/sub/api-key
updateSubAPI()🔐POSTapi/v1/sub/api-key/update
getSubAPIs()🔐GETapi/v1/sub/api-key
deleteSubAPI()🔐DELETEapi/v1/sub/api-key
createDepositAddressV3()🔐POSTapi/v3/deposit-address/create
getDepositAddressesV3()🔐GETapi/v3/deposit-addresses
getDeposits()🔐GETapi/v1/deposits
getWithdrawalQuotas()🔐GETapi/v1/withdrawals/quotas
submitWithdrawV3()🔐POSTapi/v3/withdrawals
cancelWithdrawal()🔐DELETEapi/v1/withdrawals/{withdrawalId}
getWithdrawals()🔐GETapi/v1/withdrawals
getWithdrawalById()🔐GETapi/v1/withdrawals/{withdrawalId}
getTransferable()🔐GETapi/v1/accounts/transferable
submitFlexTransfer()🔐POSTapi/v3/accounts/universal-transfer
getBasicUserFee()🔐GETapi/v1/base-fee
getTradingPairFee()🔐GETapi/v1/trade-fees
getAnnouncements()GETapi/v3/announcements
getCurrency()GETapi/v3/currencies/{currency}
getCurrencies()GETapi/v3/currencies
getSymbol()GETapi/v2/symbols/{symbol}
getSymbols()GETapi/v2/symbols
getTicker()GETapi/v1/market/orderbook/level1
getTickers()GETapi/v1/market/allTickers
getTradeHistories()GETapi/v1/market/histories
getKlines()GETapi/v1/market/candles
getOrderBookLevel20()GETapi/v1/market/orderbook/level2_20
getOrderBookLevel100()GETapi/v1/market/orderbook/level2_100
getFullOrderBook()🔐GETapi/v3/market/orderbook/level2
getCallAuctionPartOrderBook()GETapi/v1/market/orderbook/callauction/level2_{size}
getCallAuctionInfo()GETapi/v1/market/callauctionData
getFiatPrice()GETapi/v1/prices
get24hrStats()GETapi/v1/market/stats
getMarkets()GETapi/v1/markets
submitHFOrder()🔐POSTapi/v1/hf/orders
submitHFOrderSync()🔐POSTapi/v1/hf/orders/sync
submitHFOrderTest()🔐POSTapi/v1/hf/orders/test
submitHFMultipleOrders()🔐POSTapi/v1/hf/orders/multi
submitHFMultipleOrdersSync()🔐POSTapi/v1/hf/orders/multi/sync
cancelHFOrder()🔐DELETEapi/v1/hf/orders/{orderId}
cancelHFOrderSync()🔐DELETEapi/v1/hf/orders/sync/{orderId}
cancelHFOrderByClientOId()🔐DELETEapi/v1/hf/orders/client-order/{clientOid}
cancelHFOrderSyncByClientOId()🔐DELETEapi/v1/hf/orders/sync/client-order/{clientOid}
cancelHFOrdersNumber()🔐DELETEapi/v1/hf/orders/cancel/{orderId}
cancelHFAllOrdersBySymbol()🔐DELETEapi/v1/hf/orders
cancelHFAllOrders()🔐DELETEapi/v1/hf/orders/cancelAll
updateHFOrder()🔐POSTapi/v1/hf/orders/alter
getHFOrderDetailsByOrderId()🔐GETapi/v1/hf/orders/{orderId}
getHFOrderDetailsByClientOid()🔐GETapi/v1/hf/orders/client-order/{clientOid}
getHFActiveSymbols()🔐GETapi/v1/hf/orders/active/symbols
getHFActiveOrders()🔐GETapi/v1/hf/orders/active
getHFActiveOrdersPaginated()🔐GETapi/v1/hf/orders/active/page
getHFCompletedOrders()🔐GETapi/v1/hf/orders/done
getHFFilledOrders()🔐GETapi/v1/hf/fills
cancelHFOrderAutoSettingQuery()🔐GETapi/v1/hf/orders/dead-cancel-all/query
cancelHFOrderAutoSetting()🔐POSTapi/v1/hf/orders/dead-cancel-all
submitStopOrder()🔐POSTapi/v1/stop-order
cancelStopOrderByClientOid()🔐DELETEapi/v1/stop-order/cancelOrderByClientOid
cancelStopOrderById()🔐DELETEapi/v1/stop-order/{orderId}
cancelStopOrders()🔐DELETEapi/v1/stop-order/cancel
getStopOrders()🔐GETapi/v1/stop-order
getStopOrderByOrderId()🔐GETapi/v1/stop-order/{orderId}
getStopOrderByClientOid()🔐GETapi/v1/stop-order/queryOrderByClientOid
submitOCOOrder()🔐POSTapi/v3/oco/order
cancelOCOOrderById()🔐DELETEapi/v3/oco/order/{orderId}
cancelOCOOrderByClientOid()🔐DELETEapi/v3/oco/client-order/{clientOid}
cancelMultipleOCOOrders()🔐DELETEapi/v3/oco/orders
getOCOOrderByOrderId()🔐GETapi/v3/oco/order/{orderId}
getOCOOrderByClientOid()🔐GETapi/v3/oco/client-order/{clientOid}
getOCOOrderDetails()🔐GETapi/v3/oco/order/details/{orderId}
getOCOOrders()🔐GETapi/v3/oco/orders
getMarginActivePairsV3()🔐GETapi/v3/margin/symbols
getMarginConfigInfo()GETapi/v1/margin/config
getMarginLeveragedToken()🔐GETapi/v3/etf/info
getMarginMarkPrices()GETapi/v3/mark-price/all-symbols
getMarginMarkPrice()GETapi/v1/mark-price/{symbol}/current
getIsolatedMarginSymbolsConfig()🔐GETapi/v1/isolated/symbols
getMarginCollateralRatio()GETapi/v3/margin/collateralRatio
getMarketAvailableInventory()GETapi/v3/margin/available-inventory
submitHFMarginOrder()🔐POSTapi/v3/hf/margin/order
submitHFMarginOrderTest()🔐POSTapi/v3/hf/margin/order/test
cancelHFMarginOrder()🔐DELETEapi/v3/hf/margin/orders/{orderId}
cancelHFMarginOrderByClientOid()🔐DELETEapi/v3/hf/margin/orders/client-order/{clientOid}
cancelHFAllMarginOrders()🔐DELETEapi/v3/hf/margin/orders
getHFMarginOpenSymbols()🔐GETapi/v3/hf/margin/order/active/symbols
getHFActiveMarginOrders()🔐GETapi/v3/hf/margin/orders/active
getHFMarginFilledOrders()🔐GETapi/v3/hf/margin/orders/done
getHFMarginFills()🔐GETapi/v3/hf/margin/fills
getHFMarginOrderByOrderId()🔐GETapi/v3/hf/margin/orders/{orderId}
getHFMarginOrderByClientOid()🔐GETapi/v3/hf/margin/orders/client-order/{clientOid}?symbol={symbol}
addMarginStopOrder()🔐POSTapi/v3/hf/margin/stop-order
cancelMarginStopOrderByOrderId()🔐DELETEapi/v3/hf/margin/stop-order/cancel-by-id?orderId={orderId}
cancelMarginStopOrderByClientOid()🔐DELETEapi/v3/hf/margin/stop-order/cancel-by-clientOid
batchCancelMarginStopOrder()🔐DELETEapi/v3/hf/margin/stop-order/cancel
getMarginStopOrdersList()🔐GETapi/v3/hf/margin/stop-orders
getMarginStopOrderByOrderId()🔐GETapi/v3/hf/margin/stop-order/orderId?orderId={orderId}
getMarginStopOrderByClientOid()🔐GETapi/v3/hf/margin/stop-order/clientOid
addMarginOcoOrder()🔐POSTapi/v3/hf/margin/oco-order
cancelMarginOcoOrderByOrderId()🔐DELETEapi/v3/hf/margin/oco-order/cancel-by-id?orderId={orderId}
cancelMarginOcoOrderByClientOid()🔐DELETEapi/v3/hf/margin/oco-order/cancel-by-clientOid
batchCancelMarginOcoOrders()🔐DELETEapi/v3/hf/margin/oco-order/cancel
getMarginOcoOrderByClientOid()🔐GETapi/v3/hf/margin/oco-order/clientOid
getMarginOcoOrderDetailByOrderId()🔐GETapi/v3/hf/margin/oco-order/detail/orderId?orderId={orderId}
getBorrowInterestRate()🔐GETapi/v3/margin/borrowRate
marginBorrowV3()🔐POSTapi/v3/margin/borrow
getMarginBorrowHistoryV3()🔐GETapi/v3/margin/borrow
marginRepayV3()🔐POSTapi/v3/margin/repay
getMarginRepayHistoryV3()🔐GETapi/v3/margin/repay
getMarginInterestRecordsV3()🔐GETapi/v3/margin/interest
updateMarginLeverageV3()🔐POSTapi/v3/position/update-user-leverage
getLendingCurrencyV3()GETapi/v3/project/list
getLendingInterestRateV3()GETapi/v3/project/marketInterestRate
submitLendingSubscriptionV3()🔐POSTapi/v3/purchase
updateLendingSubscriptionOrdersV3()🔐POSTapi/v3/lend/purchase/update
getLendingSubscriptionOrdersV3()🔐GETapi/v3/purchase/orders
submitLendingRedemptionV3()🔐POSTapi/v3/redeem
getLendingRedemptionOrdersV3()🔐GETapi/v3/redeem/orders
getMarginRiskLimitConfig()🔐GETapi/v3/margin/currencies
getConvertSymbol()GETapi/v1/convert/symbol
getConvertCurrencies()GETapi/v1/convert/currencies
submitConvertOrder()🔐POSTapi/v1/convert/order
getConvertQuote()🔐GETapi/v1/convert/quote
getConvertOrder()🔐GETapi/v1/convert/order/detail
getConvertOrderHistory()🔐GETapi/v1/convert/order/history
submitConvertLimitOrder()🔐POSTapi/v1/convert/limit/order
getConvertLimitQuote()🔐GETapi/v1/convert/limit/quote
getConvertLimitOrder()🔐GETapi/v1/convert/limit/order/detail
getConvertLimitOrders()🔐GETapi/v1/convert/limit/orders
cancelConvertLimitOrder()🔐DELETEapi/v1/convert/limit/order/cancel
subscribeEarnFixedIncome()🔐POSTapi/v1/earn/orders
getEarnRedeemPreview()🔐GETapi/v1/earn/redeem-preview
submitRedemption()🔐DELETEapi/v1/earn/orders
getEarnSavingsProducts()🔐GETapi/v1/earn/saving/products
getEarnPromotionProducts()🔐GETapi/v1/earn/promotion/products
getEarnFixedIncomeHoldAssets()🔐GETapi/v1/earn/hold-assets
getEarnStakingProducts()🔐GETapi/v1/earn/staking/products
getEarnKcsStakingProducts()🔐GETapi/v1/earn/kcs-staking/products
getEarnEthStakingProducts()🔐GETapi/v1/earn/eth-staking/products
submitStructuredProductPurchase()🔐POSTapi/v1/struct-earn/orders
getDualInvestmentProducts()GETapi/v1/struct-earn/dual/products
getStructuredProductOrders()🔐GETapi/v1/struct-earn/orders
getDiscountRateConfigs()🔐GETapi/v1/otc-loan/discount-rate-configs
getOtcLoan()🔐GETapi/v1/otc-loan/loan
getOtcLoanAccounts()🔐GETapi/v1/otc-loan/accounts
getAffiliateUserRebateInfo()🔐GETapi/v2/affiliate/inviter/statistics
getAffiliateInvitees()🔐GETapi/v2/affiliate/queryInvitees
getAffiliateCommission()🔐GETapi/v2/affiliate/queryMyCommission
getAffiliateTradeHistory()🔐GETapi/v2/affiliate/queryTransactionByUid
getAffiliateTransaction()🔐GETapi/v2/affiliate/queryTransactionByTime
getKumining()🔐GETapi/v2/affiliate/queryKumining
getBrokerRebateOrderDownloadLink()🔐GETapi/v1/broker/api/rebase/download
getBrokerRebateOrderDownloadLinkV2()🔐GETapi/v2/broker/api/rebase/download
getPublicWSConnectionToken()POSTapi/v1/bullet-public
getPrivateWSConnectionToken()🔐POSTapi/v1/bullet-private
getPrivateWSConnectionTokenV2()🔐POSTapi/v2/bullet-private
getSubAccountsV1()🔐GETapi/v1/sub/user
getSubAccountBalancesV1()🔐GETapi/v1/sub-accounts
getMarginBalances()🔐GETapi/v1/margin/account
createDepositAddress()🔐POSTapi/v1/deposit-addresses
getDepositAddressesV2()🔐GETapi/v2/deposit-addresses
getDepositAddressV1()🔐GETapi/v1/deposit-addresses
getHistoricalDepositsV1()🔐GETapi/v1/hist-deposits
getHistoricalWithdrawalsV1()🔐GETapi/v1/hist-withdrawals
submitWithdraw()🔐POSTapi/v1/withdrawals
submitTransferMasterSub()🔐POSTapi/v2/accounts/sub-transfer
submitInnerTransfer()🔐POSTapi/v2/accounts/inner-transfer
submitOrder()🔐POSTapi/v1/orders
submitOrderTest()🔐POSTapi/v1/orders/test
submitMultipleOrders()🔐POSTapi/v1/orders/multi
cancelOrderById()🔐DELETEapi/v1/orders/{orderId}
cancelOrderByClientOid()🔐DELETEapi/v1/order/client-order/{clientOid}
cancelAllOrders()🔐DELETEapi/v1/orders
getOrders()🔐GETapi/v1/orders
getRecentOrders()🔐GETapi/v1/limit/orders
getOrderByOrderId()🔐GETapi/v1/orders/{orderId}
getOrderByClientOid()🔐GETapi/v1/order/client-order/{clientOid}
getFills()🔐GETapi/v1/fills
getRecentFills()🔐GETapi/v1/limit/fills
submitMarginOrder()🔐POSTapi/v1/margin/order
submitMarginOrderTest()🔐POSTapi/v1/margin/order/test
getIsolatedMarginAccounts()🔐GETapi/v1/isolated/accounts
getIsolatedMarginAccount()🔐GETapi/v1/isolated/account/{symbol}

FuturesClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in FuturesClient.ts.

FunctionAUTHHTTP MethodEndpoint
getBalance()🔐GETapi/v1/account-overview
getTransactions()🔐GETapi/v1/transaction-history
getSubBalances()🔐GETapi/v1/account-overview-all
getTradingPairFee()🔐GETapi/v1/trade-fees
getSymbol()GETapi/v1/contracts/{symbol}
getSymbols()GETapi/v1/contracts/active
getTicker()GETapi/v1/ticker
getTickers()GETapi/v1/allTickers
getFullOrderBookLevel2()GETapi/v1/level2/snapshot
getPartOrderBookLevel2Depth20()GETapi/v1/level2/depth20
getPartOrderBookLevel2Depth100()GETapi/v1/level2/depth100
getMarketTrades()GETapi/v1/trade/history
getKlines()GETapi/v1/kline/query
getMarkPrice()GETapi/v1/mark-price/{symbol}/current
getIndex()GETapi/v1/index/query
getInterestRates()GETapi/v1/interest/query
getPremiumIndex()GETapi/v1/premium/query
get24HourTransactionVolume()GETapi/v1/trade-statistics
getServiceStatus()GETapi/v1/status
submitOrder()🔐POSTapi/v1/orders
submitNewOrderTest()🔐POSTapi/v1/orders/test
submitMultipleOrders()🔐POSTapi/v1/orders/multi
submitSLTPOrder()🔐POSTapi/v1/st-orders
cancelOrderById()🔐DELETEapi/v1/orders/{orderId}
cancelOrderByClientOid()🔐DELETEapi/v1/orders/client-order/{clientOid}
batchCancelOrders()🔐DELETEapi/v1/orders/multi-cancel
cancelAllOrdersV3()🔐DELETEapi/v3/orders
cancelAllStopOrders()🔐DELETEapi/v1/stopOrders
getOrderByOrderId()🔐GETapi/v1/orders/{orderId}
getOrderByClientOrderId()🔐GETapi/v1/orders/byClientOid
getOrders()🔐GETapi/v1/orders
getRecentOrders()🔐GETapi/v1/recentDoneOrders
getStopOrders()🔐GETapi/v1/stopOrders
getOpenOrderStatistics()🔐GETapi/v1/openOrderStatistics
getRecentFills()🔐GETapi/v1/recentFills
getFills()🔐GETapi/v1/fills
getMarginMode()🔐GETapi/v2/position/getMarginMode
updateMarginMode()🔐POSTapi/v2/position/changeMarginMode
batchSwitchMarginMode()🔐POSTapi/v2/position/batchChangeMarginMode
getMaxOpenSize()🔐GETapi/v2/getMaxOpenSize
getPosition()🔐GETapi/v1/position
getPositionV2()🔐GETapi/v2/position
getPositions()🔐GETapi/v1/positions
getHistoryPositions()🔐GETapi/v1/history-positions
getMaxWithdrawMargin()🔐GETapi/v1/margin/maxWithdrawMargin
getCrossMarginLeverage()🔐GETapi/v2/getCrossUserLeverage
changeCrossMarginLeverage()🔐POSTapi/v2/changeCrossUserLeverage
depositMargin()🔐POSTapi/v1/position/margin/deposit-margin
getCrossMarginRiskLimit()🔐GETapi/v2/batchGetCrossOrderLimit
withdrawMargin()🔐POSTapi/v1/margin/withdrawMargin
getCrossMarginRequirement()🔐GETapi/v2/getCrossModeMarginRequirement
getRiskLimitLevel()🔐GETapi/v1/contracts/risk-limit/{symbol}
updateRiskLimitLevel()🔐POSTapi/v1/position/risk-limit-level/change
getPositionMode()🔐GETapi/v2/position/getPositionMode
updatePositionMode()🔐POSTapi/v2/position/switchPositionMode
getFundingRate()🔐GETapi/v1/funding-rate/{symbol}/current
getFundingRates()🔐GETapi/v1/contract/funding-rates
getFundingHistory()🔐GETapi/v1/funding-history
submitCopyTradeOrder()🔐POSTapi/v1/copy-trade/futures/orders
submitCopyTradeOrderTest()🔐POSTapi/v1/copy-trade/futures/orders/test
submitCopyTradeSLTPOrder()🔐POSTapi/v1/copy-trade/futures/st-orders
cancelCopyTradeOrderById()🔐DELETEapi/v1/copy-trade/futures/orders
cancelCopyTradeOrderByClientOid()🔐DELETEapi/v1/copy-trade/futures/orders/client-order
getCopyTradeMaxOpenSize()🔐GETapi/v1/copy-trade/futures/get-max-open-size
getCopyTradeMaxWithdrawMargin()🔐GETapi/v1/copy-trade/futures/position/margin/max-withdraw-margin
addCopyTradeIsolatedMargin()🔐POSTapi/v1/copy-trade/futures/position/margin/deposit-margin
removeCopyTradeIsolatedMargin()🔐POSTapi/v1/copy-trade/futures/position/margin/withdraw-margin
modifyCopyTradeRiskLimitLevel()🔐POSTapi/v1/copy-trade/futures/position/risk-limit-level/change
updateCopyTradeAutoDepositStatus()🔐POSTapi/v1/copy-trade/futures/position/margin/auto-deposit-status
switchCopyTradeMarginMode()🔐POSTapi/v1/copy-trade/futures/position/changeMarginMode
updateCopyTradeCrossMarginLeverage()🔐POSTapi/v2/copy-trade/futures/changeCrossUserLeverage
getCopyTradeCrossMarginRequirement()🔐POSTapi/v2/copy-trade/getCrossModeMarginRequirement
switchCopyTradePositionMode()🔐POSTapi/v2/copy-trade/position/switchPositionMode
getBrokerRebateOrderDownloadLink()🔐GETapi/v1/broker/api/rebase/download
getBrokerRebateOrderDownloadLinkV2()🔐GETapi/v2/broker/api/rebase/download
getPublicWSConnectionToken()POSTapi/v1/bullet-public
getPrivateWSConnectionToken()🔐POSTapi/v1/bullet-private
getPrivateWSConnectionTokenV2()🔐POSTapi/v2/bullet-private
submitTransferOut()🔐POSTapi/v3/transfer-out
submitTransferIn()🔐POSTapi/v1/transfer-in
getTransfers()🔐GETapi/v1/transfer-list
updateAutoDepositStatus()🔐POSTapi/v1/position/margin/auto-deposit-status

WebsocketAPIClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in WebsocketAPIClient.ts.

FunctionAUTHHTTP MethodEndpoint
submitNewSpotOrder()🔐WSspot.order
modifySpotOrder()🔐WSspot.modify
cancelSpotOrder()🔐WSspot.cancel
submitSyncSpotOrder()🔐WSspot.sync_order
cancelSyncSpotOrder()🔐WSspot.sync_cancel
submitMarginOrder()🔐WSmargin.order
cancelMarginOrder()🔐WSmargin.cancel
submitFuturesOrder()🔐WSfutures.order
cancelFuturesOrder()🔐WSfutures.cancel
submitMultipleFuturesOrders()🔐WSfutures.multi_order
amendFuturesOrder()🔐WSuta.amend
cancelMultipleFuturesOrders()🔐WSfutures.multi_cancel

UnifiedAPIClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in UnifiedAPIClient.ts.

FunctionAUTHHTTP MethodEndpoint
getAnnouncements()GETapi/ua/v2/market/announcement
getCurrency()GETapi/ua/v2/market/currency
getCurrencies()GETapi/ua/v2/asset/currencies
getThirdPartyCustodyCurrencies()GETapi/ua/v2/oes/currency
getSymbols()GETapi/ua/v2/market/instrument
getTickers()GETapi/ua/v2/market/ticker
getTrades()GETapi/ua/v2/market/trade
getOrderBook()GETapi/ua/v2/market/orderbook
getKlines()GETapi/ua/v2/market/kline
getIndexPrice()GETapi/ua/v2/market/index-price
getCurrentFundingRate()GETapi/ua/v2/market/funding-rate
getHistoryFundingRate()GETapi/ua/v2/market/funding-rate-history
getCrossMarginConfig()GETapi/ua/v1/market/cross-config
getBorrowableCurrencies()GETapi/ua/v2/market/borrowable-currency
getServiceStatus()GETapi/ua/v2/server/status
getClientIPAddress()GETapi/ua/v2/user/my-ip
getFiatPrice()GETapi/ua/v2/market/fiat-price
getInterestRateIndex()GETapi/ua/v2/market/interest-rate-index
getTradeStatistics()GETapi/ua/v2/trade-statistics
getCallAuctionInfo()GETapi/ua/v2/market/call-auction-info
getClassicAccount()🔐GETapi/ua/v2/account/balance
getAccount()🔐GETapi/ua/v2/unified/account/balance
getAccountOverview()🔐GETapi/ua/v2/unified/account/overview
getSubAccount()🔐GETapi/ua/v2/sub-account/balance
getSubAccountList()🔐GETapi/ua/v2/user/sub-account-list
getTransferQuotas()🔐GETapi/ua/v2/account/transfer-quota
flexTransfer()🔐POSTapi/ua/v2/account/transfer
setSubAccountTransferPermission()🔐POSTapi/ua/v2/sub-account/canTransferOut
getAccountMode()🔐GETapi/ua/v2/account/mode
setAccountMode()🔐POSTapi/ua/v2/account/mode
getFeeRate()🔐GETapi/ua/v2/user/fee-rate
getAccountLedger()🔐GETapi/ua/v2/account/ledger
getInterestHistory()🔐GETapi/ua/v2/account/interest-history
getBorrowingRatesAndLimits()🔐GETapi/ua/v2/account/interest-limits
modifyLeverage()🔐POSTapi/ua/v2/unified/account/modify-leverage
modifyMarginCrossLeverage()🔐GETapi/ua/v2/unified/account/leverage
getLeverage()🔐GETapi/ua/v2/unified/account/leverage
getDepositAddress()🔐GETapi/ua/v2/asset/deposit/address
getDepositHistory()🔐GETapi/ua/v2/asset/deposit/history
getWithdrawalHistory()🔐GETapi/ua/v2/asset/withdrawal/history
setKcsFeeDeduction()🔐GETapi/ua/v2/account/fee/kcs-deduct
getApiKeyInfo()🔐GETapi/ua/v2/user/api-key
getKYCRegions()GETapi/ua/v2/user/kyc-region
getRateLimit()🔐GETapi/ua/v2/rate-limit/query
getAllRateLimit()🔐GETapi/ua/v2/rate-limit/query-all
getRateLimitCap()🔐GETapi/ua/v2/rate-limit/query-cap
setSubAccountsRateLimit()🔐POSTapi/ua/v2/rate-limit/set
addSubAccount()🔐POSTapi/ua/v2/user/sub/create-sub-account
addSubAccountApi()🔐POSTapi/ua/v2/user/create-sub-api-key
getWithdrawalQuotas()🔐GETapi/ua/v2/withdrawals/quotas
submitWithdraw()🔐POSTapi/ua/v2/withdrawal
cancelWithdrawal()🔐DELETEapi/ua/v2/withdrawal
getThirdPartyCustodyQuota()🔐GETapi/ua/v2/oes/custody-quota
placeOrder()🔐POSTapi/ua/v2/unified/order/amend
amendOrder()🔐POSTapi/ua/v2/unified/order/amend
batchPlaceOrder()🔐POSTapi/ua/v2/unified/order/cancel-all
getOrderDetails()🔐POSTapi/ua/v2/unified/order/cancel-all
getOpenOrderList()🔐POSTapi/ua/v2/unified/order/cancel-all
getOrderHistory()🔐POSTapi/ua/v2/unified/order/cancel-all
getTradeHistory()🔐POSTapi/ua/v2/unified/order/cancel-all
cancelOrder()🔐POSTapi/ua/v2/unified/order/cancel-all
batchCancelOrders()🔐POSTapi/ua/v2/unified/order/cancel-all
batchCancelOrdersBySymbol()🔐POSTapi/ua/v2/unified/order/cancel-all
setDCP()🔐POSTapi/ua/v1/dcp/set
getDCP()🔐GETapi/ua/v1/dcp/query
getPositionList()🔐GETapi/ua/v2/unified/position/open-list
batchModifyMarginMode()🔐POSTapi/ua/v2/unified/position/margin-mode
modifyIsolatedFuturesMargin()🔐POSTapi/ua/v2/unified/position/modify-margin
getPositionsHistory()🔐GETapi/ua/v2/position/history
getPrivateFundingFeeHistory()🔐GETapi/ua/v2/position/funding-history
View endpoint map sourceShowing the available endpoint reference map.

KuCoin JavaScript FAQ

What does the KuCoin JavaScript SDK cover?

KuCoin supports Spot, Futures, Margin, Lending, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.

How do I authenticate private KuCoin API calls in JavaScript?

The public REST example above needs no credentials. For private calls, follow the authentication setup for kucoin-api in the full tutorial, including the credentials or signer required by your exchange.

KuCoin authentication and setup

Does the KuCoin JavaScript SDK help with WebSocket connection management?

Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.

When should I use the KuCoin WebSocket API instead of REST?

Use REST for standard request and response workflows such as account queries and order management. Use the WebSocket API flow when you want persistent low-latency interactions over a connected session.

Direct Example Files

Continue with implementation resources

Subscribe on Substack

Complete the Substack form below to join our newsletter. Substack handles all subscriber data directly.