Appearance
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
- Visit the official HTX website
👉 https://www.htx.com - Log in to your account
- Make sure 2FA (Google Authenticator / SMS) is enabled
📸 Screenshot Example
Step 2: Navigate to API Management
- Click your profile avatar (top-right corner)
- Select API Management
- Enter the API key management page
📸 Screenshot Example
Step 3: Create a New API Key
- Click Create API Key
- Enter an API Name, for example:
- Set a Remark (optional, for identification)
📸 Screenshot Example
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
⚠️ Never enable Withdraw permission for third-party platforms.
Step 5: Set IP Access Restriction (Recommended)
- Enable IP Restriction
- Enter the platform’s official IP addresses
(provided by your trading platform)
📸 Screenshot Example
If IPs are not available yet,
you may temporarily disable IP restriction and update it later.
Step 6: Complete Security Verification
- Confirm via Email verification
- Enter 2FA code
After verification, HTX will generate:
- API Key
- Secret Key (⚠️ shown only once)
📸 Screenshot Example
⚠️ Save the Secret Key securely.
If lost, the API key must be deleted and recreated.
Step 7: Bind API Key on the Trading Platform
- Go to Account → API Management on your platform
- Select HTX as the exchange
- Enter:
- API Key
- Secret Key
- Select trading scope:
- Spot / Futures / Both
- Click Bind / Connect
📸 Screenshot Example
Step 8: Verify Connection Status
After successful binding, you should see:
- ✅ API Status: Connected
- 📊 Account balance synced
- 🤖 Strategies available for execution
📸 Screenshot Example
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
❌ 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.
