Guide
BrokerMarket dataCrypto API key

HTX (Huobi) API guide

HTX keeps Huobi’s long-standing API, so old Huobi clients and docs still largely apply.

Last verified · Also known as Huobi API, HTX API, Huobi Global API

Quick answer

HTX, formerly Huobi Global, has spot and derivatives REST and WebSocket APIs. Private calls add AccessKeyId, SignatureMethod=HmacSHA256, SignatureVersion=2 and Timestamp to the query and sign method + host + path + sorted query with HMAC-SHA256. Public klines are keyless at /market/history/kline.

HTX (Huobi) API at a glance

Pricing
Free API; trading fees apply
Availability
Global; not US residents
Paper trading
No sandbox
Integration type
REST + API key
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Auth
Signature v2: HMAC-SHA256 of method, host, path, query
Host
https://api.huobi.pro (also api-aws.huobi.pro)
Account id
Fetch from /v1/account/accounts before ordering

Public market data from HTX

curl -s "https://api.huobi.pro/market/history/kline?symbol=btcusdt&period=60min&size=200"
Hourly btcusdt klines (keyless).

Save the bars as CSV and replay them with the exported python backtest.py --csv bars.csv, or use CCXT to read the same candles in one line of Python.

What to know before automating HTX

  • Symbols are lower-case (btcusdt); orders need the numeric spot account id.
  • WebSocket market data is gzip-compressed.

Build a HTX (Huobi) strategy with AlgoGP

AlgoGP does not connect to HTX (Huobi) natively yet. HTX (Huobi) uses plain HTTPS with an API key, so it is a good candidate for a native adapter; it is not built in yet.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in HTX (Huobi)

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with HTX (Huobi)’s SDK, or keep a built-in platform for paper trading and add HTX (Huobi) when you go live.

Built-in brokers for the same markets: Alpaca, Binance, Kraken, Bybit.

HTX (Huobi) API: frequently asked questions

Do Huobi API keys work on HTX?

Yes; it is the same platform after the rebrand.

Design and backtest your HTX (Huobi) strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to HTX (Huobi). The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to HTX (Huobi)

Free plan, no card required.

HTX (Huobi) alternatives

Independent guide. AlgoGP is not affiliated with HTX (Huobi). Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy