Skip to content

HTX – API Import Guide

This guide explains how to create and bind an HTX API Key to your trading platform.
By connecting your HTX account via API, you can enable automated trading, quantitative strategies, and real-time account synchronization securely.


⚠️ Important Notes Before You Start

Before creating an API key, please note:

  • ✅ HTX API keys do NOT allow withdrawals by default
  • ❌ Never share your API Key or Secret Key
  • 🔐 Strongly recommended to enable IP Access Restriction
  • 🧠 Recommended: use a dedicated sub-account for API trading

Step 1: Log in to HTX

  1. Visit the official HTX website
    👉 https://www.htx.com
  2. Log in to your account
  3. Make sure 2FA (Google Authenticator / SMS) is enabled

📸 Screenshot Example
HTX Login Page


Step 2: Navigate to API Management

  1. Click your profile avatar (top-right corner)
  2. Select API Management
  3. Enter the API key management page

📸 Screenshot Example
HTX API Management Entry


Step 3: Create a New API Key

  1. Click Create API Key
  2. Enter an API Name, for example:
  3. Set a Remark (optional, for identification)

📸 Screenshot Example
Create HTX API


Step 4: Configure API Permissions (Very Important)

HTX provides granular permission control.

✅ Required Permissions (Typical Quant Setup)

  • ☑️ Read (Account / Order / Market data)
  • ☑️ Trade (Spot trading)
  • ☑️ Futures / Swap Trade (only if using derivatives)

❌ Must Be Disabled

  • Withdraw
  • Asset Transfer (recommended OFF)

📸 Screenshot Example
HTX API Permissions

⚠️ Never enable Withdraw permission for third-party platforms.


  1. Enable IP Restriction
  2. Enter the platform’s official IP addresses
    (provided by your trading platform)

📸 Screenshot Example
HTX API IP Restriction

If IPs are not available yet,
you may temporarily disable IP restriction and update it later.


Step 6: Complete Security Verification

  1. Confirm via Email verification
  2. Enter 2FA code

After verification, HTX will generate:

  • API Key
  • Secret Key (⚠️ shown only once)

📸 Screenshot Example
HTX API Created

⚠️ Save the Secret Key securely.
If lost, the API key must be deleted and recreated.


Step 7: Bind API Key on the Trading Platform

  1. Go to Account → API Management on your platform
  2. Select HTX as the exchange
  3. Enter:
  • API Key
  • Secret Key
  1. Select trading scope:
  • Spot / Futures / Both
  1. Click Bind / Connect

📸 Screenshot Example
Bind HTX API on Platform


Step 8: Verify Connection Status

After successful binding, you should see:

  • ✅ API Status: Connected
  • 📊 Account balance synced
  • 🤖 Strategies available for execution

📸 Screenshot Example
HTX API Connected Status


Common Errors & Solutions

❌ Invalid API Key or Secret

  • Check for extra spaces
  • Ensure the latest API credentials are used
  • Recreate the API if the secret was lost

📸 Screenshot Example
HTX API Error


❌ Permission Denied

  • Ensure Trade permission is enabled
  • Futures strategies require Futures / Swap Trade permission

❌ IP Restriction Error

  • Add correct platform IPs
  • Or temporarily disable IP restriction

Security Best Practices

  • 🔐 Use one API key per platform
  • 🔄 Rotate API keys periodically
  • 👀 Review API access logs regularly
  • 🛑 Delete unused or compromised API keys immediately

FAQ

Can the platform withdraw my funds?

No. Withdrawal permission must remain disabled.

Can I edit API permissions later?

Yes. Permissions and IP restrictions can be modified anytime.

Is HTX API suitable for quantitative trading?

Yes. HTX supports spot and derivatives APIs for automated strategies.


🎯 Finished

Your HTX account is now successfully connected.
You can start automated and quantitative trading securely.

For more exchange guides, please refer to other API import documentation.

Released under the MIT License.