Huobi Exchange API
Stream market depth, kline, and trade detail data from the Huobi cryptocurrency exchange platform.
Stream market depth, kline, and trade detail data from the Huobi cryptocurrency exchange platform.
Access Huobi's WebSocket API for real-time market data across spot and derivatives markets.
The sgcWebSockets Huobi component connects to Huobi's WebSocket market data API. Subscribe to market depth, kline/candlestick, trade detail, and ticker streams. The component handles Huobi's GZIP compressed messages automatically.
Subscribe to Huobi market depth data.
uses
sgcHTTP_API_Huobi;
var
Huobi: TsgcHTTPAPI_Huobi;
procedure TForm1.FormCreate(Sender: TObject);
begin
Huobi := TsgcHTTPAPI_Huobi.Create(nil);
Huobi.OnHuobiDepth := OnDepth;
Huobi.Connect;
end;
procedure TForm1.Subscribe;
begin
Huobi.SubscribeDepth('btcusdt', 'step0');
end;
procedure TForm1.OnDepth(Sender: TObject;
aSymbol, aBids, aAsks: string);
begin
Memo1.Lines.Add('Depth update for ' + aSymbol);
end;
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.