WARNING: This package is still early beta! Expect breaking changes until this sees a major release.
Non-official implementation of KuCoin's API's. Developed for personal use.
For support on using the API's or development issues, please refer to the official API documentation. For questions regarding this package, please consult the code first.
const kucoin=require('node-api-kucoin');
const publicAPI=new kucoin.publicApi();
API | DESCRIPTION |
---|---|
getSymbols | https://docs.kucoin.com/#get-symbols-list |
getTicker | https://docs.kucoin.com/#get-ticker |
getAllTickers | https://docs.kucoin.com/#get-all-tickers |
getMarketStats | https://docs.kucoin.com/#get-24hr-stats |
getMarkets | https://docs.kucoin.com/#get-market-list |
API | DESCRIPTION |
---|---|
getPartOrderbook | https://docs.kucoin.com/#get-part-order-book-aggregated |
API | DESCRIPTION |
---|---|
getTradeHistories | https://docs.kucoin.com/#get-trade-histories |
getKlines | https://docs.kucoin.com/#get-klines |
API | DESCRIPTION |
---|---|
getCurrencies | https://docs.kucoin.com/#get-currencies |
getCurrencyDetail | https://docs.kucoin.com/#get-currency-detail-recommend |
getFiatPrice | https://docs.kucoin.com/#get-fiat-price |
API | DESCRIPTION |
---|---|
getServerTime | https://docs.kucoin.com/#server-time |
getServiceStatus | https://docs.kucoin.com/#service-status |
getPublicToken | https://docs.kucoin.com/#websocket-feed |
const kucoin=require('node-api-kucoin');
const auth = {
apikey: 'MY_API_KEY',
secret: 'MY_API_SECRET'
};
const privateAPI=new kucoin.privateApi(auth);
API | DESCRIPTION |
---|---|
getPartOrderbook | https://docs.kucoin.com/#get-part-order-book-aggregated |
getOrderbook | https://docs.kucoin.com/#get-full-order-book-aggregated |
API | DESCRIPTION |
---|---|
getSubUserInfo | https://docs.kucoin.com/#get-user-info-of-all-sub-accounts https://docs.kucoin.com/#get-paginated-list-of-sub-accounts |
API | DESCRIPTION |
---|---|
createDepositAddress | https://docs.kucoin.com/#create-deposit-address |
getDepositAddresses | https://docs.kucoin.com/#get-deposit-addresses-v2 |
getDepositAddress | https://docs.kucoin.com/#get-deposit-address |
getDeposits | https://docs.kucoin.com/#get-deposit-list |
getHistDeposits | https://docs.kucoin.com/#get-v1-historical-deposits-list |
API | DESCRIPTION |
---|---|
getWithdrawals | https://docs.kucoin.com/#get-withdrawals-list |
getHistWithdrawals | https://docs.kucoin.com/#get-v1-historical-withdrawals-list |
getWithdrawalQuota | https://docs.kucoin.com/#get-withdrawal-quotas |
applyWithdraw | https://docs.kucoin.com/#apply-withdraw-2 |
cancelWithdraw | https://docs.kucoin.com/#cancel-withdrawal |
API | DESCRIPTION |
---|---|
getUserFee | https://docs.kucoin.com/#basic-user-fee |
getSymbolFee | https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair |
API | DESCRIPTION |
---|---|
createOrder | https://docs.kucoin.com/#place-a-new-order |
createMarginOrder | https://docs.kucoin.com/#place-a-margin-order |
createOrders | https://docs.kucoin.com/#place-bulk-orders |
cancelOrder | https://docs.kucoin.com/#cancel-an-order |
cancelClientOrderID | https://docs.kucoin.com/#cancel-single-order-by-clientoid |
cancelAllOrders | https://docs.kucoin.com/#cancel-all-orders |
getOrders | https://docs.kucoin.com/#list-orders |
getRecentOrders | https://docs.kucoin.com/#recent-orders |
getOrder | https://docs.kucoin.com/#get-an-order |
getClientOrderID | https://docs.kucoin.com/#get-single-active-order-by-clientoid |
API | DESCRIPTION |
---|---|
getFills | https://docs.kucoin.com/#list-fills |
getRecentFills | https://docs.kucoin.com/#recent-fills |
API | DESCRIPTION |
---|---|
createStopOrder | https://docs.kucoin.com/#place-a-new-order-2 |
cancelStopOrder | https://docs.kucoin.com/#cancel-an-order-2 |
cancelStopOrders | https://docs.kucoin.com/#cancel-orders |
getStopOrder | https://docs.kucoin.com/#get-single-order-info |
getStopOrders | https://docs.kucoin.com/#list-stop-orders |
getStopClientOrderID | https://docs.kucoin.com/#get-single-order-by-clientoid |
cancelStopClientOrderID | https://docs.kucoin.com/#cancel-single-order-by-clientoid-2 |
API | DESCRIPTION |
---|---|
getMarkPrice | https://docs.kucoin.com/#get-mark-price |
getMarginConfig | https://docs.kucoin.com/#get-margin-configuration-info |
getMarginAccount | https://docs.kucoin.com/#get-margin-account |
getMarginRiskLimit | https://docs.kucoin.com/#query-the-cross-isolated-margin-risk-limit |
API | DESCRIPTION |
---|---|
createBorrowOrder | https://docs.kucoin.com/#1-margin-borrowing |
repayBorrowOrder | https://docs.kucoin.com/#2-repayment |
getBorrowOrder | https://docs.kucoin.com/#get-borrow-order |
getRepayHistory | https://docs.kucoin.com/#4-get-repayment-history |
API | DESCRIPTION |
---|---|
getCurrencyDetails | https://docs.kucoin.com/#1-get-currency-information |
getInterestRates | https://docs.kucoin.com/#2-get-interest-rates |
purchaseMarginLend | https://docs.kucoin.com/#3-subscription |
redeemMarginLend | https://docs.kucoin.com/#4-redemption |
updateMarginLend | https://docs.kucoin.com/#5-modify-subscription-orders |
getRedemptionOrders | https://docs.kucoin.com/#6-get-redemption-orders |
getPurchaseOrders | https://docs.kucoin.com/#7-get-subscription-orders |
API | DESCRIPTION |
---|---|
getPrivateToken | https://docs.kucoin.com/#websocket-feed |
const kucoin=require('node-api-kucoin');
const auth = {
apikey: 'MY_API_KEY',
secret: 'MY_API_SECRET'
};
const marketAPI=new kucoin.sockets.marketApi();
marketAPI.socket._ws.on('initialized', async () => {
// do your own initialization
});
const tradingAPI=new kucoin.sockets.tradingApi(auth);
tradingAPI.setHandler('orders', (symbol,method,data,option) => { updateOrder(symbol,method,data); });
tradingAPI.socket._ws.on('authenticated', async () => {
const res=await tradingAPI.subscribeOrderUpdates();
});
tradingAPI.socket._ws.on('closed', async () => {
// do something, like clean-up and reconnect
});
function updateOrder(symbol,method,data) {
// do something
};
API | HANDLER | DESCRIPTION |
---|---|---|
subscribeTicker unsubscribeTicker | trade.ticker | https://docs.kucoin.com/#symbol-ticker https://docs.kucoin.com/#all-symbols-ticker |
subscribeSnapshot unsubscribeSnapshot | trade.snapshot | https://docs.kucoin.com/#symbol-snapshot https://docs.kucoin.com/#market-snapshot |
subscribeOrderbook unsubscribeOrderbook | trade.l2update | https://docs.kucoin.com/#level-2-market-data |
subscribeBest unsubscribeBest | level2 | https://docs.kucoin.com/#level2-5-best-ask-bid-orders https://docs.kucoin.com/#level2-50-best-ask-bid-orders |
subscribeCandles unsubscribeCandles | trade.candles.update | https://docs.kucoin.com/#klines |
subscribeTrades unsubscribeTrades | trade.l3match | https://docs.kucoin.com/#match-execution-data |
subscribeIndexPrice unsubscribeIndexPrice | tick | https://docs.kucoin.com/#index-price |
subscribeMarkPrice unsubscribeMarkPrice | tick | https://docs.kucoin.com/#mark-price |
subscribeMarginBook unsubscribeMarginBook | funding.update | https://docs.kucoin.com/#order-book-change |
API | HANDLER | DESCRIPTION |
---|---|---|
subscribeOrderUpdates unsubscribeOrderUpdates | orderChange | https://docs.kucoin.com/#private-order-change-events |
subscribeBalanceUpdates ubsubscribeBalanceUpdates | account.balance | https://docs.kucoin.com/#account-balance-notice |
subscribeDebRatioUpdates unsubscribeDebRatioUpdates | debt.ratio position.status | https://docs.kucoin.com/#debt-ratio-change |
subscribeMarginOrders | order.open order.update order.done | https://docs.kucoin.com/#margin-trade-order-enters-event https://docs.kucoin.com/#margin-order-update-event https://docs.kucoin.com/#margin-order-done-event |
subscribeStopOrders | stopOrder | https://docs.kucoin.com/#stop-order-event |