Bybit Derivatives API
Stream real-time derivatives and spot market data from Bybit including order book snapshots and trade events.
Stream real-time derivatives and spot market data from Bybit including order book snapshots and trade events.
Access Bybit's V5 WebSocket API for unified spot, linear, inverse, and options market data.
The sgcWebSockets Bybit component connects to Bybit's V5 unified WebSocket API. Access real-time data for spot, USDT perpetual, USDC perpetual, inverse perpetual, and options markets through a single connection. Subscribe to order books, trades, tickers, klines, and liquidations.
Subscribe to Bybit ticker data.
uses
sgcHTTP_API_Bybit;
var
Bybit: TsgcHTTPAPI_Bybit;
procedure TForm1.FormCreate(Sender: TObject);
begin
Bybit := TsgcHTTPAPI_Bybit.Create(nil);
Bybit.OnBybitTicker := OnTicker;
Bybit.Connect;
end;
procedure TForm1.Subscribe;
begin
Bybit.SubscribeTicker('BTCUSDT');
end;
procedure TForm1.OnTicker(Sender: TObject;
aSymbol, aLastPrice, aBid, aAsk: string);
begin
Label1.Caption := aSymbol + ': $' + aLastPrice;
end;
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.