KUCOIN API
HomeChange LogAPI DOC V1
Language
  • 繁體中文
HomeChange LogAPI DOC V1
Language
  • 繁體中文
SDK
Telegram
Kucoin
  1. API Broker
  • Introduction
  • Authentication
  • Enums Definitions
  • Terms Definitions
  • SDK
  • Rate Limit
  • Change Log
  • User Service
    • Market Making Incentive Scheme
    • VIP Fast Track
    • Broker Program
  • Unified REST
    • Introduction
    • Market data
      • Get Announcements
      • Get Currency
      • Get Symbol
      • Get Ticker
      • Get OrderBook
      • Get Trades
      • Get Klines
      • Get Current Funding Rate
      • Get History Funding Rate
      • Get Service Status
      • Get Cross Margin Config
      • Get Collateral Ratio
    • Account
      • Get Account(Classic)
      • Get Account(UTA)
      • Get Account Overview(UTA)
      • Get Sub Account
      • Get Transfer Quotas
      • Flex Transfer
      • Set Sub Account Transfer Permission
      • Set Account Mode
      • Get Fee Rate
      • Get Account Ledger
      • Get Interest History(UTA)
      • Modify leverage(UTA)
    • Orders
      • Place Order
      • Batch Place Order(Classic)
      • Cancel Order
      • Batch Cancel Orders(Classic)
      • Get Order Details
      • Get Open Order List
      • Get Order History
      • Get Trade History
      • Set DCP(Classic)
      • Get DCP(Classic)
    • Positions
      • Get Position List(UTA)
      • Get Positions History(UTA)
  • Unified Websocket
    • Base Info
      • Introduction
      • Get Private Token - Unified API Private Channels
    • Public Channels
      • Ticker
      • Trade
      • Orderbook
      • Kline
    • Private Channels
      • Order
      • Position
      • Balance
      • Execution
      • LiquidationWarning
      • Leverage
    • Add/Cancel Order
      • Add Order
      • Cancel Order
  • Classic REST
    • Account Info
      • Account & Funding
        • Get Account Summary Info
        • Get Apikey Info
        • Get Account Type - Spot
        • Get Account List - Spot
        • Get Account Detail - Spot
        • Get Account - Cross Margin
        • Get Account - Isolated Margin
        • Get Account - Futures
        • Get Account Ledgers - Spot/Margin
        • Get Account Ledgers - Trade_hf
        • Get Account Ledgers - Margin_hf
        • Get Account Ledgers - Futures
      • Sub Account
        • Add sub-account
        • Add sub-account Margin Permission
        • Add sub-account Futures Permission
        • Get sub-account List - Summary Info
        • Get sub-account Detail - Balance
        • Get sub-account List - Spot Balance (V2)
        • Get sub-account List - Futures Balance (V2)
      • Sub Account API
        • Get sub-account API List
        • Add sub-account API
        • Modify sub-account API
        • Delete sub-account API
      • Deposit
        • Add Deposit Address (V3)
        • Get Deposit Address (V3)
        • Get Deposit History
      • Withdrawals
        • Get Withdrawal Quotas
        • Withdraw (V3)
        • Cancel Withdrawal
        • Get Withdrawal History
        • Get Withdrawal History By ID
        • Get KYC Regions
      • Transfer
        • Get Transfer Quotas
        • Flex Transfer
      • Trade Fee
        • Get Basic Fee - Spot/Margin
        • Get Actual Fee - Spot/Margin
        • Get Actual Fee - Futures
    • Spot Trading
      • Market Data
        • Get Announcements
        • Get Currency
        • Get All Currencies
        • Get Symbol
        • Get All Symbols
        • Get Ticker
        • Get All Tickers
        • Get Trade History
        • Get Klines
        • Get Part OrderBook
        • Get Full OrderBook
        • Get Call Auction Part OrderBook
        • Get Call Auction Info
        • Get Fiat Price
        • Get 24hr Stats
        • Get Market List
        • Get Client IP Address
        • Get Server Time
        • Get Service Status
      • Orders
        • Add Order
        • Add Order Sync
        • Add Order Test
        • Batch Add Orders
        • Batch Add Orders Sync
        • Cancel Order By OrderId
        • Cancel Order By OrderId Sync
        • Cancel Order By ClientOid
        • Cancel Order By ClientOid Sync
        • Cancel Partial Order
        • Cancel All Orders By Symbol
        • Cancel All Orders
        • Modify Order
        • Get Order By OrderId
        • Get Order By ClientOid
        • Get Symbols With Open Order
        • Get Open Orders
        • Get Open Orders By Page
        • Get Closed Orders
        • Get Trade History
        • Get DCP
        • Set DCP
        • Add Stop Order
        • Cancel Stop Order By ClientOid
        • Cancel Stop Order By OrderId
        • Batch Cancel Stop Orders
        • Get Stop Orders List
        • Get Stop Order By OrderId
        • Get Stop Order By ClientOid
        • Add OCO Order
        • Cancel OCO Order By OrderId
        • Cancel OCO Order By ClientOid
        • Batch Cancel OCO Order
        • Get OCO Order By OrderId
        • Get OCO Order By ClientOid
        • Get OCO Order Detail By OrderId
        • Get OCO Order List
    • Margin Trading
      • Market Data
        • Get Symbols - Cross Margin
        • Get Symbols - Isolated Margin
        • Get ETF Info
        • Get Mark Price Detail
        • Get Margin Config
        • Get Mark Price List
        • Get Margin Collateral Ratio
      • Orders
        • Add Order
        • Add Order Test
        • Cancel Order By OrderId
        • Cancel Order By ClientOid
        • Cancel All Orders By Symbol
        • Get Symbols With Open Order
        • Get Open Orders
        • Get Closed Orders
        • Get Trade History
        • Get Order By OrderId
        • Get Order By ClientOid
        • Add Stop Order
        • Cancel Stop Order By OrderId
        • Cancel Stop Order By ClientOid
        • Batch Cancel Stop Orders
        • Get Stop Orders List
        • Get Stop Order By OrderId
        • Get Stop Order By ClientOid
        • Add OCO Order
        • Cancel OCO Order By OrderId
        • Cancel OCO Order By ClientOid
        • Batch Cancel OCO Order
        • Get OCO Order By OrderId
        • Get OCO Order By ClientOid
        • Get OCO Order Detail By OrderId
        • Get OCO Order List
      • Debit
        • Get Borrow Interest Rate
        • Borrow
        • Get Borrow History
        • Repay
        • Get Repay History
        • Get Interest History
        • Modify Leverage
      • Credit
        • Get Loan Market
        • Get Loan Market Interest Rate
        • Purchase
        • Modify Purchase
        • Get Purchase Orders
        • Redeem
        • Get Redeem Orders
      • Risk Limit
        • Get Margin Risk Limit
    • Futures Trading
      • Introduction
      • Market Data
        • Get Symbol
        • Get All Symbols
        • Get Ticker
        • Get All Tickers
        • Get Full OrderBook
        • Get Part OrderBook
        • Get Trade History
        • Get Klines
        • Get Mark Price
        • Get Spot Index Price
        • Get Interest Rate Index
        • Get Premium Index
        • Get 24hr stats
        • Get Server Time
        • Get Service Status
      • Orders
        • Add Order
        • Add Order Test
        • Batch Add Orders
        • Add Take Profit And Stop Loss Order
        • Cancel Order By OrderId
        • Cancel Order By ClientOid
        • Batch Cancel Orders
        • Cancel All Orders
        • Cancel All Stop orders
        • Get Order By OrderId
        • Get Order By ClientOid
        • Get Order List
        • Get Recent Closed Orders
        • Get Stop Order List
        • Get Open Order Value
        • Get Recent Trade History
        • Get Trade History
      • Positions
        • Get Margin Mode
        • Switch Margin Mode
        • Batch Switch Margin Mode
        • Get Position Mode
        • Switch Position Mode
        • Get Max Open Size
        • Get Position Details
        • Get Position List
        • Get Positions History
        • Get Max Withdraw Margin
        • Get Cross Margin Leverage
        • Modify Cross Margin Leverage
        • Add Isolated Margin
        • Remove Isolated Margin
        • Get Cross Margin Risk Limit
        • Get Cross Margin Requirement
        • Get Isolated Margin Risk Limit
        • Modify Isolated Margin Risk Limit
      • Funding Fees
        • Get Current Funding Rate
        • Get Public Funding History
        • Get Private Funding History
    • Copy Trading
      • Introduction
      • Add Order
      • Add Order Test
      • Add Take Profit And Stop Loss Order
      • Cancel Order By OrderId
      • Cancel Order By ClientOid
      • Get Max Open Size
      • Get Max Withdraw Margin
      • Add Isolated Margin
      • Remove Isolated Margin
      • Modify Isolated Margin Risk Limit
      • Modify Isolated Margin Auto-Deposit Status
      • Switch Margin Mode
      • Modify Cross Margin Leverage
      • Get Cross Margin Requirement
      • Switch Position Mode
    • Earn
      • Simple Earn
        • Purchase
        • Get Redeem Preview
        • Redeem
        • Get Savings Products
        • Get Promotion Products
        • Get Staking Products
        • Get KCS Staking Products
        • Get ETH Staking Products
        • Get Account Holding
      • Structured Earn - Dual
        • Structured Product Purchase
        • Get Dual Investment Products
        • Get Structured Product Orders
    • VIP Lending
      • Introduction
      • Get Collateral Ratio
      • Get Loan Info
      • Get Accounts
    • Affiliate
      • Introduction
      • Get Invited
      • Get Commission
      • Get Trade History
      • Get Transaction
      • Get Kumining
    • Broker
      • Introduction
      • Broker Application
      • Instructions
      • API Broker
        • Introduction
        • Broker Fast API Service
        • Get Broker Rebate
          GET
        • Get Commission
          GET
        • Get User List
          GET
        • Get User Transactions
          GET
      • Exchange Broker
        • Introduction
        • Submit KYC
        • Get KYC Status
        • Get KYC Status List
        • Get Broker Info
        • Add sub-account
        • Get sub-account
        • Add sub-account API
        • Get sub-account API
        • Modify sub-account API
        • Delete sub-account API
        • Transfer
        • Get Transfer History
        • Get Deposit List
        • Get Deposit Detail
        • Get Withdraw Detail
        • Get Broker Rebate
    • Convert
      • Introduction
      • Get Convert Symbol
      • Get Convert Currencies
      • Add Convert Order
      • Get Convert Quote
      • Get Convert Order Detail
      • Get Convert Order History
      • Add Convert Limit Order
      • Get Convert Limit Quote
      • Get Convert Limit Order Detail
      • Get Convert Limit Orders
      • Cancel Convert Limit Order
  • Classic Websocket
    • Base Info
      • Introduction
      • Get Public Token - Classic Spot/Margin
      • Get Private Token - Classic Spot/Margin
      • Get Public Token - Classic Futures
      • Get Private Token - Classic Futures
    • Spot Trading
      • Public Channels
        • Ticker
        • All Tickers
        • Orderbook - Level1
        • Orderbook - Level5
        • Orderbook - Level50
        • Orderbook - Increment
        • Call Auction Orderbook - Level50
        • Call Auction Data
        • Klines
        • Trade
        • Symbol Snapshot
        • Market Snapshot
      • Private Channels
        • Order V2
        • Order V1
        • Balance
        • Stop Order
    • Margin Trading
      • Public Channels
        • Index Price
        • Mark Price
      • Private Channels
        • Cross Margin Position
        • Isolated Margin Position
    • Futures Trading
      • Public Channels
        • Ticker V2
        • Ticker V1
        • Orderbook - Level5
        • Orderbook - Level50
        • Orderbook- Increment
        • Klines
        • Trade
        • Instrument
        • Funding Fee Settlement
        • Symbol Snapshot
      • Private Channels
        • Orders
        • Balance
        • Positions
        • Margin Mode
        • Cross Margin Leverage
        • Stop Orders
  • Error Code
    • HTTP
    • Spot
    • Margin
    • Earn
    • Broker
    • CopyTrading
    • Websocket
    • Futures
    • Unified
  • Abandoned Endpoints
    • Introduction
    • Account & Funding
      • Get sub-account List - Summary Info (V1)
      • Get sub-account List - Spot Balance (V1)
      • Get Deposit Addresses (V2)
      • Get Deposit Addresses - V1
      • Sub-account Transfer
      • Get Deposit History - Old
      • Internal Transfer
      • Get Futures Account Transfer Out Ledger
      • Get Withdrawal History - Old
      • Futures Account Transfer Out
      • Futures Account Transfer In
      • Add Deposit Address - V1
      • Withdraw - V1
    • Spot Trading
      • Orders
        • Add Order - Old
        • Add Order Test - Old
        • Batch Add Orders - Old
        • Cancel Order By OrderId - Old
        • Cancel Order By ClientOid - Old
        • Batch Cancel Order - Old
        • Get Orders List - Old
        • Get Recent Orders List - Old
        • Get Order By OrderId - Old
        • Get Order By ClientOid - Old
        • Get Trade History - Old
        • Get Recent Trade History - Old
    • Margin Trading
      • Get Account Detail - Margin
      • Add Order - V1
      • Add Order Test - V1
      • Get Account List - Isolated Margin - V1
      • Get Account Detail - Isolated Margin - V1
    • Futures Trading
      • Modify Isolated Margin Auto-Deposit Status
      • Cancel All Orders - V1
      • Get Position Details - V1
    • Affiliate
      • Get Account
    • Broker
      • API Broker
        • Get Broker Rebate
  • Developing
    • Introduction
  1. API Broker

Broker Fast API Service

1. Introduction#

KuCoin is going to launch the Fast API Service which allows broker users to connect to the broker’s website/app via KuCoin OAuth2.0 login, an one-click authorization linked to third-party applications. The significant improvement with Fast API service is to generate enhanced security of the trading and simplify the way to connect KuCoin and Broker.
No extra passphrase or API key (version3) is required to be manually binded with the broker's bot. The OAuth connection will automatically create an API key and automatically connect to the broker. The key has default permissions with spot trading, futures trading, as well as getting access to KuCoin Earn.

2. Preparation before Integration#

To utilize the KuCoin Fast API Service, Broker partners need to prepare the below three parts and submit from this form.
Broker’s full IP list for requesting Fast API Service. This is the IP that the Broker server requests to our KuCoin fast api service server.
Broker’s full IP list for trading.
Redirect URL
Once the broker provides the above three, KuCoin will send the broker's unique client_id

3. Fast API Service#

Broker users can use KuCoin Oauth login to authorize brokers obtaining their trading and reading general trading-related information. No withdrawal authorization allowed.

4. OpenAPI Demo#

URL :https://www.kucoin.com/_oauth/resource/ucenter/outer/api-key/add
method:POST
Content-Type:application/x-www-form-urlencoded
header: "Authorization":"bearer {token}"
Body Params: no parameter needed
response:
{
	"success": true,
	"code": "200",
	"msg": "success",
	"retry": false,
	"data": {
    	"apiName": "",
    	"apiKey": "",
    	"secret": "",
    	"passphrase": "",
    	"brokerId": "",
    	"authGroup":         API_COMMON,API_FUTURES,API_SPOT,API_EARN,API_TRANSFER,API_MARGIN,
    	"ipWhiteList": ""
	}
}
Errors:
1.
Repeated apiName
2.
The number of user’s apiKey reaches to the maximum level

5. Authorization Code Mode#

KuCoin offers authorization code mode only. With authorization, the broker provides client_secret to get authorization code. access token and refresh token can be retrieved based on authorization codes. Broker saves keys and interacts with KuCoin OAuth2.0 server.
image.png

6. Use of Token#

6.1 Differences between tokens#

After the broker calls the token exchange endpoint through authorization code, there will be two types of tokens.
access token : Used for the broker to call KuCoin OpenAPI endpoint.
refresh token : Used for obtaining a new access token when the previous one expires.

6.2 How to use tokens#

After the broker completes the authorization and obtains the token, it will be able to call the KuCoin OpenAPI endpoint through the access token. When requesting, broker needs to carry the following information in the request header:
Header ParametersRequiredDescriptions
AuthorizationYesFill in the access token as bearer to this field.

6.3 Token validity#

access token : Valid within 1 hour
refresh token : Valid within 3 days
If the access token expires, the endpoint will no longer be accessible. If the refresh token is still within the valid period, the broker needs to call the refresh token endpoint to obtain a new pair of access token and refresh token. The new access token can continue to be used. When a new access token is retrieved via refresh token, the old access token cannot be used regardless of whether it has expired or not.

7. OAuth Controller API Design#

7.1 OAuth Login Page#

image.png
URI: http://www.kucoin.com/oauth?response_type=code&client_id=XXXX&redirect_uri=XXX&scope=OAUTH_CREATE_API&state=123
Method: GET
Params
Response TypePlease use the autorization_code mode
Client_idUnique identity of the broker
Redirect_urlBroker website
ScopeScope of access_token
StateBrokers can determine what you need here. But this is a compulsory field. You can put your system’s user ID here
Response : 
{ 
    "success": true, 
    "code": "668*********c711", 
    "msg": "success.", 
    "retry": false, 
    "data": null
    "state": XXX
}
Please don’t encode the redirect URL.

7.2 Request A Token#

URI: https://www.kucoin.com/_oauth/access-token?grant_type=authorization_code&code=xxxxxxxxxx&redirect_uri=https://www.xxxxxxxxxxxxx.com&client_id=xxxxxxxxx
Method: GET
Paramsis_requiredDescription
Grant_typeYesgrant_type=authorization_code
CodeYes
Redirect_urlYes
Client_idYesUnique identity of the broker
Response : 
{
    "access_token":"",  	//access token received from user authorization
    "token_type":"bearer"       //token type, extension point to facilitate the   
                                  addition of more secure tokens in the future
    "expires_in":3600,  	//token expiration time, in seconds
    "refresh_token":,   	//token used to obtain a new access token after                                    
                                  the access token expires  
    "scope": ["", ""]   	//scope of permissions for the access token
}

Please don’t encode the redirect URL.

7.3 Refresh A Token#

URI: https://www.kucoin.com/_oauth/refresh-token
Method: POST
Content-Type:application/x-www-form-urlencoded
Body Paramsis_requiredDescription
Grant_typeYesauthorization_code
Refresh_tokenYesToken used to refresh the authentication
ScopeYes
Response : 
{
    "access_token":"",        //token used to access resources
    "token_type":"bearer",    //token type, an extension point to facilitate the 
                                 addition of more secure tokens in the future, such                                 
                                as MAC (Message Authentication Code). Bearer                                       
                                indicates a token that does not contain any        
                                information
    "expires_in":3600,        //token expiration time, in seconds
    "refresh_token":,         //token used to obtain a new access token after the 
                                access token expires
    "scope": [""OAUTH_CREATE_API""]   	//scope of permissions for the access token
}

7.4 Verify A Token (WIP)#

URI:https://www.kucoin.com/_oauth/validate-access-token
Method: POST
Content-Type:application/x-www-form-urlencoded
Params:
FieldTypeDescription
access_tokenYesAccess token
Response:
FieldTypeDescription
access_tokenStringAccess token
is_validbooleantrue/false
Modified at 2025-11-14 02:32:06
Previous
Introduction
Next
Get Broker Rebate