KUCOIN API - EU
SDK
Telegram
Kucoin
    • Introduction
    • Authentication
    • Enums Definitions
    • Terms Definitions
    • SDK
    • Rate Limit
    • Classic REST
      • Account Info
        • Account & Funding
          • Get Account Summary Info
          • Get KYC Regions
          • 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 Ledgers - Spot/Margin
          • Get Account Ledgers - Trade_hf
          • Get Account Ledgers - Margin_hf
        • Sub Account
          • Add sub-account
          • Add sub-account Margin Permission
          • Get sub-account List - Summary Info
          • Get sub-account Detail - Balance
          • Get sub-account List - Spot 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 (V4)
          • Cancel Withdrawal
          • Get Withdrawal History
          • Get Withdrawal History By ID
        • Transfer
          • Get Transfer Quotas
          • Flex Transfer
        • Trade Fee
          • Get Basic Fee - Spot/Margin
          • Get Actual Fee - Spot/Margin
      • 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 Mark Price Detail
          • Get Margin Config
          • Get Mark Price List
          • Get Margin Collateral Ratio
          • Get Market Available Inventory
        • 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
        • Debit
          • Borrow
          • Get Borrow History
          • Repay
          • Get Repay History
          • Get Interest History
          • Modify Leverage
        • Risk Limit
          • Get Margin Risk Limit
      • Earn
        • Simple Earn
          • Purchase
          • Get Redeem Preview
          • Redeem
          • Get Savings Products
          • Get Promotion Products
          • Get Account Holding
      • Broker
        • Introduction
        • Broker Application
        • Instructions
        • Broker Pro
          • Introduction
          • Broker Fast API Service
          • Get Broker Rebate
          • Get Commission
          • Get User List
          • Get User Transactions
    • Classic Websocket
      • Base Info
        • Introduction
        • Get Public Token - Classic Spot/Margin
        • Get Private Token - Classic Spot/Margin
      • Spot Trading
        • Public Channels
          • Ticker
          • All Tickers
          • Orderbook - Level 1
          • Orderbook - Level 5
          • Orderbook - Level 50
          • Orderbook - Increment
          • Call Auction Orderbook - Level 50
          • 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
    • Error Code
      • HTTP
      • Spot
      • Margin
      • Earn
      • Websocket
    • 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
        • Get Deposit History - Old
        • Get Withdrawal History - Old
        • 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
    • Developing
      • Introduction

    Authentication

    Authentication#

    Generating an API Key#

    Before being able to sign any requests, you must create an API key via the KuCoin EU website. Upon creating a key you need to write down 3 pieces of information:
    Key
    Secret
    Passphrase
    The Key and Secret are generated and provided by KuCoin EU and the Passphrase refers to the one you used to create the KuCoin EU API. Please note that these three pieces of information can not be recovered once lost. If you lost this information, please create a new API key.

    API KEY PERMISSIONS#

    You can manage the API permission on KuCoin EU’s official website. Please refer to the documentation below to see what API key permissions are required for a specific route.

    Creating a Request#

    All private REST requests must include the required headers listed below. You may also include optional headers when applicable.
    HeaderRequiredDescription
    KC-API-KEYYesYour API key, provided as a string.
    KC-API-SIGNYesThe Base64-encoded signature generated for the request.
    KC-API-TIMESTAMPYesThe timestamp of the request in milliseconds.
    KC-API-PASSPHRASEYesThe passphrase specified when the API key was created.
    KC-API-KEY-VERSIONYesThe API key version. This value can be checked on the API Management page.
    Content-TypeYesAll requests and responses use the application/json content type.

    Signing a Message#

    For the header of KC-API-SIGN:
    Use API-Secret to encrypt the prehash string {timestamp+method+endpoint+body} with sha256 HMAC. The request body is a JSON string and need to be the same with the parameters passed by the API.
    Encode contents by base64 before you pass the request.
    For the KC-API-PASSPHRASE of the header:
    Encrypt passphrase with HMAC-sha256 via API-Secret.
    Encode contents by base64 before you pass the request.
    Note:
    The encrypted timestamp shall be consistent with the KC-API-TIMESTAMP field in the request header.
    The body to be encrypted shall be consistent with the content of the Request Body.
    The Method should be UPPER CASE.
    For GET, DELETE request, all query parameters need to be included in the request url. e.g. /api/v1/deposit-addresses?currency=XBT. The body is "" if there is no request body (typically for GET requests).
    For the POST request, all query parameters need to be included in the request body with JSON. (e.g. {"currency":"BTC"}). Do not include extra spaces in JSON strings.
    When generating signature, the URL must use the content that has not been URL-encoded to participate in the signature.
    For example: When the url is /api/v1/sub/api-key?apiKey=67b3&subName=test&passphrase=abc%21%40%2311
    , the url content participating in the signature should be the original information /api/v1/sub/api-key?apiKey=67
    b3&subName=test&passphrase=abc!@#11

    Code Examples#

    Python
    Go
    PHP

    Gateway Timestamp#

    Gateway Timestamp is a pair of timestamps generated by the Gateway to mark the inbound and outbound moments of the same request at the Gateway boundary:
    BoundaryMeaningWebSocket Response (Body)REST Response (Header)
    InboundThe request arrives at the GatewayinTimex-in-time
    OutboundThe response is sent from the GatewayoutTimex-out-time
    Notes
    The Gateway-side processing duration can be approximated by outTime - inTime (WebSocket) or x-out-time - x-in-time (REST). The unit depends on the enabled precision.

    Precision Control#

    Use the following parameters to control Gateway Timestamp precision.
    ProtocolControl ParameterParameter LocationAffected Response LocationAffected FieldsDefault Unit
    RESTkc-enable-nsRequest HeaderResponse Headerx-in-time, x-out-timeMicroseconds (µs)
    WebSocketenable_nsWSS Query ParameterResponse BodyinTime, outTimeMilliseconds (ms)
    Remarks
    1.
    REST: x-in-time and x-out-time are returned in the Response Header and may be included in responses for any REST API. The 5- prefix only indicates that the timestamp pair is generated by the Gateway. Currently, only the Gateway-side inbound and outbound timestamps are provided.
    2.
    WebSocket: inTime and outTime are in the Response Body and may be returned by request-response Pro WebSocket APIs such as Add/Cancel Order.
    3.
    For Colo customers using UTA accounts, inTime and outTime are returned in nanoseconds by default, so enable_ns=true is not required.

    Enable Nanoseconds#

    RESTful API#

    Set kc-enable-ns: true in the request header to return x-in-time and x-out-time in nanoseconds.
    Request Example:
    Response Example (Response Header):

    WebSocket Add/Cancel Order API#

    Add enable_ns=true to the WebSocket connection URL to return inTime and outTime in nanoseconds.
    Request Example:
    wss://wsapi.kucoin.eu/v1/private?apikey=689***2b6&timestamp=1768878266952&sign=H/G***%3D&passphrase=aLs***3D&enable_ns=true
    Modified at 2026-01-29 03:43:00
    Previous
    Introduction
    Next
    Enums Definitions