SDK guide
JavaScript
REST API + WebSocket

KuCoin JavaScript SDK

Build with the KuCoin REST API & WebSockets with our JavaScript SDK, TypeScript-first package declarations, and Node.js-compatible runtime patterns. Discover installation, common examples, a detailed endpoint-to-function map, and the REST API/WebSocket patterns shared across our Siebly SDK family.

Use the same TypeScript-first REST API and WebSocket clients from plain JavaScript or TypeScript in Node.js-compatible runtimes.

Package surfaces

Explore the following API capabilities are covered by our KuCoin SDK:

  • Spot
  • Margin
  • Futures
  • Lending
  • WebSockets
  • WebSocket clients with:
    • Built-in heartbeats.
    • Automatic reconnection.
    • Automatic reauthentication and resubscribe where the exchange supports it.
  • Typed requests and responses for Node.js, JavaScript, and TypeScript IDEs.
  • Framework-neutral JavaScript snippets that stay approachable in Node.js-compatible runtimes.
  • TypeScript-first package declarations for stricter services, shared libraries, and editor-assisted integrations.

Install KuCoin SDK

# Via your favourite package manager, e.g. npm:
npm install kucoin-api
# or pnpm:
pnpm install kucoin-api
# or yarn:
yarn add kucoin-api

Quickstart Examples with the KuCoin JavaScript SDK

Get started with just a few lines of JavaScript. TypeScript, while not required, is absolutely recommended. TypeScript declarations are included with all our SDKs and provide convenient definitions on request & response fields, WebSocket payloads, and generally safer integrations.

REST walkthrough

Easily start working the Kucoin REST APIs in JavaScript.

  • Install the Kucoin JavaScript SDK via NPM: npm install kucoin-api.
  • Import the FuturesClient class (REST API wrapper for Kucoin futures endpoints).
    • Note: If spot is preferred, use the SpotClient class intead.
  • Create an authenticated FuturesClient instance with your API credentials.
  • Call REST API methods as functions and await their responses.

In this example, we:

  • Fetch contract metadata for XRPUSDTM and read the multiplier.
  • Demonstrate how contract multiplier affects position sizing calculations.
  • Provide practical order payload examples for market and limit long/short entries.
  • Provide practical order payload examples for market and limit close-position requests.
  • Provide practical order payload examples for stop-loss style close orders.

This script is designed as a practical futures order guide, showing how to structure different order requests and reason about contract size before submitting live orders.

For a full map of available REST API methods, check out the endpoint reference below.

import { FuturesClient } from 'kucoin-api'; async function start() {  const account = {    key: 'keyHere',    secret: 'secretHere',    passphrase: 'memoHere',  };  const client = new FuturesClient({    apiKey: account.key,    apiSecret: account.secret,    apiPassphrase: account.passphrase,  });   try {    /**     * =======     * Credits for this guide go to user: @DKTradingClient / Code Nerd from the Kucoin API Telegram group!     * =======     /**     * Futures are contracts, not currencies. In the futures symbols list you will see a "multiplier" field for each of the symbols.      * Each contract equals to  Multiplier x Size     * For example:  https://api-futures.kucoin.com/api/v1/contracts/XRPUSDTM  - see the "multiplier" value.     * */     const symbolInfo = await client.getSymbol({ symbol: 'XRPUSDTM' });    const multiplier = symbolInfo.data.multiplier;     /**     * E.g. if multiplier is 10(what you can see from the endpoint), that means each SIZE is 10 XRP. So if XRP is currently at $0.5,     * then each 1 contract (size 10) is going to cost $5.00     * size = (Funds x leverage) / (price x multiplier)     */     const XRPPriceExample = 0.5;    const leverage = 5;    const fundsToTradeUSDT = 100;     const costOfContract = XRPPriceExample * multiplier;     const size = (fundsToTradeUSDT * leverage) / costOfContract;    console.log(`Size: ${size}`);     /**     * The trade amount indicates the amount of contract to buy or sell, and contract uses the base currency or lot as the trading unit.     * The trade amount must be no less than 1 lot for the contract and no larger than the maxOrderQty.     * It should be a multiple number of the lot, or the system will report an error when you place the order.     * E.g. 1 lot of XBTUSDTM is 0.001 Bitcoin, while 1 lot of XBTUSDM is 1 USD.     * or check the XRPUSDTM example above.     *     * Here are function examples using the Futures Create Order endpoint:     */     // A MARKET SHORT of 2 contracts of XBT using leverage of 5:    const marketShort = client.submitOrder({      clientOid: '123456789',      leverage: 5,      side: 'sell',      size: 2,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'market',    });    console.log('Market short: ', marketShort);     // A MARKET LONG of 2 contracts of XBT using leverage of 5:    const marketLong = client.submitOrder({      clientOid: '123456789',      leverage: 5,      side: 'buy',      size: 2,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'market',    });    console.log('Market long: ', marketLong);     // A LIMIT SHORT of 2 contracts of XBT using leverage of 5:    const limitShort = client.submitOrder({      clientOid: '123456789',      leverage: 5,      price: '70300.31',      side: 'sell',      size: 2,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'limit',    });    console.log('Limit short: ', limitShort);     // A LIMIT LONG of 2 contracts of XBT using leverage of 5:    const limitLong = client.submitOrder({      clientOid: '123456789',      leverage: 5,      price: '40300.31',      side: 'buy',      size: 2,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'limit',    });    console.log('Limit long: ', limitLong);    // On any "close position" action, if you specify a SIZE=0 or leave off the SIZE parameter,    // then it will close the whole position, regardless of the size.    // If you specify a SIZE, it will close only the number of contracts you specify.     // If closeOrder is set to TRUE,    // the system will close the position and the position size will become 0.    // Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.     // A MARKET CLOSE POSITION example:    const marketClose = client.submitOrder({      clientOid: '123456789',      closeOrder: true,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'market',      side: 'sell',      size: 0,    });    console.log('Market close: ', marketClose);     // A LIMIT CLOSE of a LONG example:    const limitCloseLong = client.submitOrder({      clientOid: '123456789',      leverage: 5,      price: '70300.31',      closeOrder: true,      side: 'sell',      size: 2,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'limit',    });    console.log('Limit close long: ', limitCloseLong);     // A LIMIT CLOSE of a SHORT example:    const limitCloseShort = client.submitOrder({      clientOid: '123456789',      leverage: 5,      price: '40300.31',      closeOrder: true,      side: 'buy',      size: 2,      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'limit',    });    console.log('Limit close short: ', limitCloseShort);     // A STOP LOSS example for a LONG position:    const stopLossLong = client.submitOrder({      clientOid: '123456789',      closeOrder: true,      stop: 'down',      side: 'buy',      stopPrice: '40200.31',      stopPriceType: 'TP',      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'market',    });    console.log('Stoploss long: ', stopLossLong);     // A STOP LOSS example for a SHORT position:    const stopLossShort = client.submitOrder({      clientOid: '123456789',      closeOrder: true,      stop: 'up',      side: 'sell',      stopPrice: '40200.31',      stopPriceType: 'TP',      symbol: 'XBTUSDTM',      timeInForce: 'GTC',      type: 'market',    });     console.log('Stoploss short: ', stopLossShort);  } catch (e) {    console.error('Req error: ', e);  }} start();

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
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/v1/market/announcement
getCurrency()GETapi/ua/v1/market/currency
getThirdPartyCustodyCurrencies()GETapi/ua/v1/oes/currency
getSymbols()GETapi/ua/v1/market/instrument
getTickers()GETapi/ua/v1/market/ticker
getTrades()GETapi/ua/v1/market/trade
getOrderBook()GETapi/ua/v1/market/orderbook
getKlines()GETapi/ua/v1/market/kline
getCurrentFundingRate()GETapi/ua/v1/market/funding-rate
getHistoryFundingRate()GETapi/ua/v1/market/funding-rate-history
getCrossMarginConfig()GETapi/ua/v1/market/cross-config
getBorrowableCurrencies()GETapi/ua/v1/market/borrowable-currency
getServiceStatus()GETapi/ua/v1/server/status
getClientIPAddress()GETapi/ua/v1/user/my-ip
getFiatPrice()GETapi/ua/v1/market/fiat-price
getClassicAccount()🔐GETapi/ua/v1/account/balance
getAccount()🔐GETapi/ua/v1/unified/account/balance
getAccountOverview()🔐GETapi/ua/v1/unified/account/overview
getSubAccount()🔐GETapi/ua/v1/sub-account/balance
getTransferQuotas()🔐GETapi/ua/v1/account/transfer-quota
flexTransfer()🔐POSTapi/ua/v1/account/transfer
setSubAccountTransferPermission()🔐POSTapi/ua/v1/sub-account/canTransferOut
getAccountMode()🔐GETapi/ua/v1/account/mode
setAccountMode()🔐POSTapi/ua/v1/account/mode
getFeeRate()🔐GETapi/ua/v1/user/fee-rate
getAccountLedger()🔐GETapi/ua/v1/account/ledger
getInterestHistory()🔐GETapi/ua/v1/account/interest-history
getBorrowingRatesAndLimits()🔐GETapi/ua/v1/account/interest-limits
modifyLeverage()🔐POSTapi/ua/v1/unified/account/modify-leverage
modifyMarginCrossLeverage()🔐POSTapi/ua/v1/{accountMode}/account/modify-leverage-margin-cross
getLeverage()🔐GETapi/ua/v1/unified/account/leverage
getDepositAddress()🔐GETapi/ua/v1/asset/deposit/address
getApiKeyInfo()🔐GETapi/ua/v1/user/api-key
getKYCRegions()GETapi/ua/v1/user/kyc-region
getRateLimit()🔐GETapi/ua/v1/rate-limit/query
getAllRateLimit()🔐GETapi/ua/v1/rate-limit/query-all
getRateLimitCap()🔐GETapi/ua/v1/rate-limit/query-cap
setSubAccountsRateLimit()🔐POSTapi/ua/v1/rate-limit/set
addSubAccount()🔐POSTapi/ua/v1/user/sub/create-sub-account
addSubAccountApi()🔐POSTapi/ua/v1/user/create-sub-api-key
getWithdrawalQuotas()🔐GETapi/ua/v1/withdrawals/quotas
submitWithdraw()🔐POSTapi/ua/v1/withdrawal
cancelWithdrawal()🔐DELETEapi/ua/v1/withdrawal
getThirdPartyCustodyQuota()🔐GETapi/ua/v1/oes/custody-quota
placeOrder()🔐GETapi/ua/v1/{accountMode}/order/detail
batchPlaceOrder()🔐GETapi/ua/v1/{accountMode}/order/detail
getOrderDetails()🔐GETapi/ua/v1/{accountMode}/order/detail
getOpenOrderList()🔐GETapi/ua/v1/{accountMode}/order/open-list
getOrderHistory()🔐GETapi/ua/v1/{accountMode}/order/history
getTradeHistory()🔐GETapi/ua/v1/{accountMode}/order/execution
cancelOrder()🔐POSTapi/ua/v1/unified/order/cancel-all
batchCancelOrders()🔐POSTapi/ua/v1/unified/order/cancel-all
batchCancelOrdersBySymbol()🔐POSTapi/ua/v1/unified/order/cancel-all
setDCP()🔐POSTapi/ua/v1/dcp/set
getDCP()🔐GETapi/ua/v1/dcp/query
getPositionList()🔐GETapi/ua/v1/unified/position/open-list
batchModifyMarginMode()🔐POSTapi/ua/v1/unified/position/margin-mode
modifyIsolatedFuturesMargin()🔐POSTapi/ua/v1/unified/position/modify-margin
getPositionsHistory()🔐GETapi/ua/v1/position/history
getPrivateFundingFeeHistory()🔐GETapi/ua/v1/position/funding-history
getAccountPositionTiers()🔐GETapi/ua/v1/{accountMode}/position/tiers
View endpoint map sourceShowing the available endpoint reference map.

KuCoin JavaScript FAQ

What does the KuCoin JavaScript SDK cover?

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

How do I authenticate private KuCoin API calls in JavaScript?

Install kucoin-api from npm & pass API credentials into the SDK client options, as shown in the KuCoin JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.

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.

Where should I start on the KuCoin JavaScript page: REST or WebSocket?

Start with the REST quick start for installation, authentication, and request and response flows. Move to the WebSocket example when you need streaming market or account updates.

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.