Skip to content

KuCoin

This guide covers API setup for both KuCoin spot and KuCoin Futures. Both markets share a single KuCoin account, and a single API key can grant access to either or both — the difference is which exchange type you pick inside HaasOnline.

Obtaining the API

Log in to KuCoin and visit https://www.kucoin.com/account. In the left sidebar, click API Management, then click Create API in the top-right corner.

KuCoin API Management page with the Create API button highlighted in the top-right corner.

On the Create API page, the flow differs between HaasOnline Cloud and Enterprise / self-hosted installations. Pick the tab below that matches your setup.

Select the Link Third-Party Apps tab. In the Name of Third-Party App dropdown, pick HaasOnlineBot — KuCoin has partnered with HaasOnline so Cloud users don't need to manage IP whitelists manually.

KuCoin Create API page with the Link Third-Party Apps tab selected and HaasOnlineBot chosen in the dropdown.

Fill in:

  • API Name — any label that identifies this key (e.g. "HaasOnline").
  • API Passphrase — pick a strong passphrase and record it. KuCoin cannot recover it, so losing it means creating a new API key.

Scroll down to API Restrictions and enable the markets you'll trade.

KuCoin API Restrictions with Spot Trading and Futures Trading enabled.

  • General — always enabled; covers read-only operations like account info, balances, and order history.
  • Spot Trading — enable if you plan to trade spot markets.
  • Futures Trading — enable if you plan to trade KuCoin Futures.
  • Margin Trading — enable only if you plan to run margin strategies.
  • KuCoin Earn, Unified Account, Allow Flexible Transfers — leave disabled unless you have a specific reason.

Tip

Enabling both Spot Trading and Futures Trading on a single key lets you use the same credentials for the KuCoin and KuCoin Futures exchange types in HaasOnline.

Click Next. A Security Verification modal opens — confirm your identity to continue:

KuCoin Security Verification modal with Trading Password and Google Authenticator fields.

  • Trading Password — the password you set on KuCoin specifically for trading (not your login password).
  • Google Authenticator — the 6-digit code from your 2FA app.

Info

KuCoin may additionally email you a verification code during this step. If so, check your inbox and enter the code in the modal. If Google Authenticator is unavailable, use Switch verification method to pick email or SMS instead.

Click Confirm. The API Created modal then opens with your credentials:

KuCoin API Created modal showing the API Name, Key, Secret, Usage, API Restrictions, and IP Restrictions.

Copy both values immediately:

  • Key — the public identifier for your API key; you can view this again later in API Management.
  • Secretshown only once. If you close the modal without copying it, you'll have to delete the key and create a new one.

Together with the API Passphrase you set earlier, these three values — Key, Secret, and Passphrase — are what you'll paste into HaasOnline. Click Confirm to close the modal.

Select the API-Based Trading tab and fill in:

KuCoin Create API page with the API-Based Trading tab selected, showing API Name and API Passphrase fields.

  • API Name — any label that identifies this key (e.g. "HTS").
  • API Passphrase — pick a strong passphrase and record it. KuCoin cannot recover it, so losing it means creating a new API key.

Scroll down to API Restrictions and enable the markets you'll trade.

KuCoin API Restrictions for API-Based Trading with Spot Trading and Futures Trading enabled; the Withdrawal option is visible and should remain disabled.

  • General — always enabled; covers read-only operations like account info, balances, and order history.
  • Spot Trading — enable if you plan to trade spot markets.
  • Futures Trading — enable if you plan to trade KuCoin Futures.
  • Margin Trading — enable only if you plan to run margin strategies.
  • KuCoin Earn, Unified Account, Allow Flexible Transfers — leave disabled unless you have a specific reason.

Danger

Do not enable Withdrawal. HaasOnline never needs withdrawal permission to trade on your behalf. Enabling it means that a leaked API key could drain your KuCoin account — a trading-only key limits the blast radius to trades on your existing balances.

Tip

Enabling both Spot Trading and Futures Trading on a single key lets you use the same credentials for the KuCoin and KuCoin Futures exchange types in HaasOnline.

Scroll further to IP Restrictions. Keep Restrict to Trusted IPs Only selected and add the public IP address of the machine running your HaasOnline installation, then click Add. Repeat to whitelist additional servers (up to 50 IPs, IPv4 or IPv6).

KuCoin IP Restrictions with Restrict to Trusted IPs Only selected and a whitelisted server IP added.

Danger

Do not select Unrestricted. A stolen API key with no IP whitelist can be used from anywhere in the world against your account.

Click Next. A Security Verification modal opens — confirm your identity to continue:

KuCoin Security Verification modal with Trading Password and Google Authenticator fields.

  • Trading Password — the password you set on KuCoin specifically for trading (not your login password).
  • Google Authenticator — the 6-digit code from your 2FA app.

Info

KuCoin may additionally email you a verification code during this step. If so, check your inbox and enter the code in the modal. If Google Authenticator is unavailable, use Switch verification method to pick email or SMS instead.

Click Confirm. The API Created modal then opens with your credentials:

KuCoin API Created modal for the API-Based Trading flow showing API Name, Key, Secret, Usage, API Restrictions, and the whitelisted IP.

Copy both values immediately:

  • Key — the public identifier for your API key; you can view this again later in API Management.
  • Secretshown only once. If you close the modal without copying it, you'll have to delete the key and create a new one.

Together with the API Passphrase you set earlier, these three values — Key, Secret, and Passphrase — are what you'll paste into HaasOnline. Click Confirm to close the modal.

Adding the API to HaasOnline TradeServer Cloud

Log in to TradeServer Cloud.

Click on the user menu icon in the top right and select Exchange Accounts.

Cryptocurrency exchange accounts management interface with Exchange Accounts panel and Connect status indicator.

  1. Click on the add icon (+ button).
  2. Select Exchange Account.

HaasOnline exchange account management interface with 'Exchange Account' and 'Simulated Account' options.

From the list of supported exchanges, choose KuCoin for spot trading or KuCoin Futures for futures trading. The API key you created above will work for whichever market you enabled its permissions for.

Enter an Account name, then paste the values from KuCoin:

  • Public Key → the KuCoin Key
  • Private Key → the KuCoin Secret
  • Passphrase → the passphrase you set when creating the API

Info

Check for stray spaces at the start and end of the Key, Secret, and Passphrase after pasting — they're a common source of "invalid credentials" errors.

Once the fields are filled in, the TEST KEYS button becomes active. Click it. If the test passes, click Submit to add the account to the platform.