Huobi · AsyncAPI Specification

Huobi / HTX WebSocket API

Version 1.0.0

AsyncAPI 2.6 specification for Huobi (HTX) public WebSocket Market Data API and WebSocket v2 Asset & Order subscription API. ## Envelope conventions ### Market data (v1, /ws) - Subscribe: `{ "sub": "", "id": "" }` - Unsubscribe: `{ "unsub": "", "id": "" }` - One-shot req: `{ "req": "", "id": "" }` - Push: `{ "ch": "", "ts": , "tick": }` - One-shot rsp: `{ "rep": "", "status": "ok", "id": "", "data": }` ### Asset & Order (v2, /ws/v2) - All frames use `{ "action": "sub"|"unsub"|"req"|"push"|"ping"|"pong", "ch": "", ... }` - Authentication is required before subscribing to private topics via `{ "action": "req", "ch": "auth", "params": { ... } }`. ## GZIP compression All inbound frames on `wss://api.huobi.pro/ws` and `wss://api.huobi.pro/feed` are GZIP-compressed binary. Clients MUST gunzip the payload before parsing JSON. Frames on `wss://api.huobi.pro/ws/v2` are sent as plain JSON text (no GZIP compression). ## Heartbeat - Market data (v1): server sends `{ "ping": }`; client replies `{ "pong": }` echoing the same timestamp. - Asset & Order (v2): server sends `{ "action": "ping", "data": { "ts": } }`; client replies `{ "action": "pong", "data": { "ts": } }`. Connections idle longer than the server timeout are closed. ## Authentication (v2) Authenticate with an HMAC-SHA256 signature over the canonical request string using `signatureVersion: 2.1` before subscribing to any private topic.

View Spec View on GitHub CryptocurrencyPublic APIsReal-TimeAsyncAPIEventsWebSockets

Channels

market.{symbol}.kline.{period}
publish subKline
Subscribe / unsubscribe / request kline data.
Candlestick (kline) updates for a symbol at the given period.
market.{symbol}.depth.{type}
publish subDepth
Aggregated order book depth at a price-aggregation step.
market.{symbol}.trade.detail
publish subTradeDetail
Per-trade tick stream for a symbol.
market.{symbol}.detail
publish subDetail
24-hour rolling market detail / statistics for a symbol.
market.{symbol}.ticker
publish subTicker
Real-time ticker for a single symbol.
market.tickers
publish subAllTickers
Real-time ticker snapshot for all trading pairs.
market.{symbol}.bbo
publish subBbo
Best Bid / Best Offer updates for a symbol.
market.{symbol}.mbp.{levels}
publish subMbp
Market By Price (incremental) updates. Use `seqNum` / `prevSeqNum` to chain updates and de-duplicate. Served on the `/feed` endpoint.
market.{symbol}.mbp.refresh.{levels}
publish subMbpRefresh
Market By Price refresh updates (full snapshot at interval).
market.{symbol}.etp
publish subEtp
ETP (Exchange Traded Product) net asset value updates.
ping
publish sendPong
Heartbeat channel for the v1 market data sockets. The server sends a ping frame; the client MUST echo the same timestamp back as pong.
auth
publish sendAuth
Authentication handshake. Must be sent and confirmed before subscribing to any private topic on the v2 socket.
accounts.update#{mode}
publish subAccountsUpdate
Account balance / available balance updates. - mode 0: only balance changes are pushed. - mode 1: only available balance changes are pushed. - mode 2: both balance and available balance changes are pushed.
orders#{symbol}
publish subOrders
Order update events for a single symbol. Use `*` as the symbol to subscribe to all symbols on the account.
trade.clearing#{symbol}
publish subTradeClearing
Trade clearing (settlement) events for a single symbol. Use `*` as the symbol to subscribe across all symbols on the account.
accounts.list
publish reqAccountsList
One-shot request that returns the full account list / balances.
orders.list
publish reqOrdersList
One-shot request that returns historical orders for an account.
orders.detail
publish reqOrdersDetail
One-shot request that returns the detail of a single order.
ping-v2
publish sendV2Pong
v2 heartbeat. Server sends `{ "action": "ping", "data": { "ts": } }`; client MUST echo with `{ "action": "pong", "data": { "ts": } }`.

Messages

✉
V1SubscribeRequest
Subscribe (v1)
Subscribe to a v1 market-data topic.
✉
V1UnsubscribeRequest
Unsubscribe (v1)
✉
V1Request
One-shot Request (v1)
Request a historical / snapshot payload for a topic.
✉
V1Ping
Ping (v1)
✉
V1Pong
Pong (v1)
✉
KlinePush
Kline Push
✉
DepthPush
Aggregated Depth Push
✉
TradeDetailPush
Trade Detail Push
✉
MarketDetailPush
Market Detail (24h) Push
✉
TickerPush
Ticker Push
✉
TickersPush
All Tickers Push
✉
BboPush
BBO Push
✉
MbpIncrementalPush
MBP Incremental Push
✉
MbpRefreshPush
MBP Refresh Push
✉
EtpPush
ETP Net Asset Value Push
✉
V2AuthRequest
Auth Request (v2)
✉
V2AuthResponse
Auth Response (v2)
✉
V2SubscribeRequest
Subscribe (v2)
✉
V2UnsubscribeRequest
Unsubscribe (v2)
✉
V2Request
One-shot Request (v2)
✉
V2Ping
Ping (v2)
✉
V2Pong
Pong (v2)
✉
AccountsUpdatePush
Account Update Push
✉
OrdersPush
Order Update Push
✉
TradeClearingPush
Trade Clearing Push
✉
AccountsListResponse
Accounts List Response
✉
OrdersListResponse
Orders List Response
✉
OrdersDetailResponse
Order Detail Response

Servers

wss
market api.huobi.pro/ws
Public market data WebSocket endpoint. GZIP-compressed binary frames. Mirror: `api-aws.huobi.pro/ws`.
wss
feed api.huobi.pro/feed
Dedicated endpoint for Market By Price (MBP) incremental updates. GZIP-compressed binary frames. Mirror: `api-aws.huobi.pro/feed`.
wss
account api.huobi.pro/ws/v2
WebSocket v2 endpoint for asset and order subscriptions. Plain JSON frames (no GZIP). Requires authentication for all private topics. Mirror: `api-aws.huobi.pro/ws/v2`.

AsyncAPI Specification

Raw ↑
asyncapi: 2.6.0
id: urn:com:huobi:websocket-api
info:
  title: Huobi / HTX WebSocket API
  version: '1.0.0'
  description: |
    AsyncAPI 2.6 specification for Huobi (HTX) public WebSocket Market Data API
    and WebSocket v2 Asset & Order subscription API.

    ## Envelope conventions

    ### Market data (v1, /ws)
    - Subscribe:    `{ "sub": "<topic>", "id": "<client-id>" }`
    - Unsubscribe:  `{ "unsub": "<topic>", "id": "<client-id>" }`
    - One-shot req: `{ "req": "<topic>", "id": "<client-id>" }`
    - Push:         `{ "ch": "<topic>", "ts": <ms>, "tick": <object|array> }`
    - One-shot rsp: `{ "rep": "<topic>", "status": "ok", "id": "<client-id>", "data": <object|array> }`

    ### Asset & Order (v2, /ws/v2)
    - All frames use `{ "action": "sub"|"unsub"|"req"|"push"|"ping"|"pong", "ch": "<topic>", ... }`
    - Authentication is required before subscribing to private topics via
      `{ "action": "req", "ch": "auth", "params": { ... } }`.

    ## GZIP compression
    All inbound frames on `wss://api.huobi.pro/ws` and `wss://api.huobi.pro/feed`
    are GZIP-compressed binary. Clients MUST gunzip the payload before parsing
    JSON. Frames on `wss://api.huobi.pro/ws/v2` are sent as plain JSON text
    (no GZIP compression).

    ## Heartbeat
    - Market data (v1): server sends `{ "ping": <ts> }`; client replies `{ "pong": <ts> }` echoing the same timestamp.
    - Asset & Order (v2): server sends `{ "action": "ping", "data": { "ts": <ts> } }`;
      client replies `{ "action": "pong", "data": { "ts": <ts> } }`.
    Connections idle longer than the server timeout are closed.

    ## Authentication (v2)
    Authenticate with an HMAC-SHA256 signature over the canonical request string
    using `signatureVersion: 2.1` before subscribing to any private topic.
  termsOfService: https://www.htx.com/support/en-us/list/agreements
  contact:
    name: Huobi (HTX) Developer Support
    url: https://huobiapi.github.io/docs/spot/v1/en/
    email: support@huobigroup.com
  license:
    name: Proprietary
    url: https://www.htx.com/

defaultContentType: application/json

servers:
  market:
    url: api.huobi.pro/ws
    protocol: wss
    description: |
      Public market data WebSocket endpoint. GZIP-compressed binary frames.
      Mirror: `api-aws.huobi.pro/ws`.
  feed:
    url: api.huobi.pro/feed
    protocol: wss
    description: |
      Dedicated endpoint for Market By Price (MBP) incremental updates.
      GZIP-compressed binary frames. Mirror: `api-aws.huobi.pro/feed`.
  account:
    url: api.huobi.pro/ws/v2
    protocol: wss
    description: |
      WebSocket v2 endpoint for asset and order subscriptions. Plain JSON
      frames (no GZIP). Requires authentication for all private topics.
      Mirror: `api-aws.huobi.pro/ws/v2`.

tags:
  - name: market-data
    description: Public market data topics on /ws and /feed.
  - name: account
    description: Authenticated asset, order, and clearing topics on /ws/v2.


# --- truncated at 32 KB (37 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/huobi/refs/heads/main/asyncapi/huobi-asyncapi.yml

Work with this as data

Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for asyncapi

4 MCP tools reach this
  • find_asyncapisBrowse and filter every AsyncAPI spec in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This AsyncAPI spec
curl "https://apis.io/api/v1/asyncapis/huobi-asyncapi"
All asyncapi
curl "https://apis.io/api/v1/asyncapis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.