Huobi / HTX WebSocket API

Stream Huobi/HTX spot market data (kline, depth, trade detail, market overview, market detail) and the v2 account asset channel.

TsgcWSAPI_Huobi

Huobi (now HTX) WebSocket client — spot market streams plus authenticated v2 channels for orders, trades and account balances.

컴포넌트 클래스

TsgcWSAPI_Huobi

프로토콜

Huobi Spot API

플랫폼

Windows, macOS, Linux, iOS, Android

에디션

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

Pair with a TsgcWebSocketClient and subscribe to Huobi market topics — the component handles the gzip-compressed payloads transparently.

uses
  sgcWebSocket, sgcWebSocket_API_Huobi;

var
  WSClient: TsgcWebSocketClient;
  Huobi: TsgcWSAPI_Huobi;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  Huobi := TsgcWSAPI_Huobi.Create(nil);
  Huobi.Client := WSClient;
  Huobi.Huobi.ApiKey    := 'your-api-key';
  Huobi.Huobi.ApiSecret := 'your-api-secret';

  WSClient.Active := True;

  Huobi.SubscribeKLine('btcusdt', hci5m);
  Huobi.SubscribeDepth('btcusdt', hds0);
  Huobi.SubscribeTradeDetail('btcusdt');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Huobi
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Huobi *Huobi = new TsgcWSAPI_Huobi(this);
Huobi->Client = WSClient;

WSClient->Active = true;
Huobi->SubscribeKLine("btcusdt", hci5m);
Huobi->SubscribeDepth("btcusdt", hds0);
Huobi->SubscribeTradeDetail("btcusdt");

내부 구성

gzip-aware market stream, signed v2 account channels, automatic ping/pong heartbeat.

Spot market streams

SubscribeKLine, SubscribeDepth, SubscribeTradeDetail, SubscribeMarketDetail, SubscribeMarketOverview, SubscribeBBO cover the spot market surface.

Gzip handled transparently

Huobi compresses every WebSocket frame with gzip — the component decompresses on the way in and answers ping frames on the way out automatically.

Authenticated v2 channels

v2-auth handshake with HMAC signing exposes accounts.update#v2, orders#$symbol and trade.clearing#$symbol private channels.

HTX alias

The TsgcWSAPI_HTX sibling is the same component re-exported under the new HTX brand — pick whichever name matches your codebase.

Mainland or pro

Point the underlying TsgcWebSocketClient at api.huobi.pro or api.huobi.com depending on your jurisdiction — the protocol is identical.

Heartbeat handling

Huobi sends {"ping":...} at the application layer — the component answers each automatically so the connection stays open through proxies.

사양 및 참조 문서

Authoritative sources for the APIs this component implements.

문서 및 데모

컴포넌트 참조 문서로 바로 이동하고, 바로 실행 가능한 데모 프로젝트를 받고, 체험판을 다운로드해 보세요.

온라인 도움말 — API_Huobi 이 컴포넌트의 전체 속성, 메서드, 이벤트 참조 문서.
데모 프로젝트 — Demos\05.Crypto\03.Huobi 바로 실행 가능한 예제 프로젝트예요. sgcWebSockets 패키지에 포함되어 있어요 — 아래에서 체험판을 다운로드하세요.
기술 문서 (PDF) 기능, 빠른 시작, Delphi 및 C++ Builder 코드 샘플 및 1차 출처 참고 — 이 컴포넌트 전용.
사용자 설명서 (PDF) 라이브러리의 모든 컴포넌트를 다루는 종합 설명서.

Ready to Trade on Huobi/HTX?

Download the free trial and stream Huobi market data and account events from Delphi.