Binance WebSocket API
Stream real-time market data from Binance — the world's largest cryptocurrency exchange — directly into your Delphi applications.
Stream real-time market data from Binance — the world's largest cryptocurrency exchange — directly into your Delphi applications.
Subscribe to real-time ticker, order book depth, kline, and trade streams with a native Delphi WebSocket component.
The sgcWebSockets Binance component connects to the Binance WebSocket API, providing real-time market data for spot and futures markets. Receive ticker updates, order book changes, candlestick data, and individual trade events with minimal latency.
Subscribe to real-time ticker data from Binance.
uses
sgcHTTP_API_Binance;
var
Binance: TsgcHTTPAPI_Binance;
procedure TForm1.FormCreate(Sender: TObject);
begin
Binance := TsgcHTTPAPI_Binance.Create(nil);
Binance.OnBinanceTicker := OnTicker;
Binance.Connect;
end;
procedure TForm1.SubscribeTicker;
begin
// Subscribe to BTC/USDT ticker updates
Binance.SubscribeTicker('btcusdt');
end;
procedure TForm1.OnTicker(Sender: TObject;
aSymbol, aPrice, aVolume: string);
begin
Label1.Caption := aSymbol + ': $' + aPrice;
Label2.Caption := 'Vol: ' + aVolume;
end;
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.