Bybit WebSocket & REST API

Connect to Bybit v5 spot, linear, inverse and option WebSocket streams plus the signed REST API in one typed component.

Quick answer: TsgcWSAPI_Bybit is the sgcWebSockets component that connects Delphi and C++ Builder apps to Bybit. It handles the Bybit v5 public and authenticated WebSocket channels across spot, linear, inverse and option categories, plus the signed REST API.

TsgcWSAPI_Bybit

Bybit v5 client — public channels (orderbook, trades, ticker, kline) per product category plus authenticated execution, order and position streams.

Component class

TsgcWSAPI_Bybit

Protocol

Bybit v5 API

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

Pair with a TsgcWebSocketClient, choose spot / linear / inverse / option via Bybit.Category, then subscribe to public or signed private channels.

uses
  sgcWebSocket, sgcWebSocket_API_Bybit;

var
  WSClient: TsgcWebSocketClient;
  Bybit: TsgcWSAPI_Bybit;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  Bybit := TsgcWSAPI_Bybit.Create(nil);
  Bybit.Client := WSClient;
  Bybit.Bybit.ApiKey    := 'your-api-key';
  Bybit.Bybit.ApiSecret := 'your-api-secret';
  Bybit.Bybit.Category  := bcSpot;

  WSClient.Active := True;

  Bybit.SubscribeOrderbook('BTCUSDT', 50);
  Bybit.SubscribePublicTrade('BTCUSDT');
  Bybit.SubscribeTicker('BTCUSDT');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Bybit
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Bybit *Bybit = new TsgcWSAPI_Bybit(this);
Bybit->Client = WSClient;
Bybit->Bybit->Category = bcSpot;

WSClient->Active = true;
Bybit->SubscribeOrderbook("BTCUSDT", 50);
Bybit->SubscribePublicTrade("BTCUSDT");
Bybit->SubscribeTicker("BTCUSDT");

What's inside

Per-category WebSocket streams plus the signed REST surface — one component handles all four product categories.

Category-aware streams

Choose bcSpot, bcLinear, bcInverse or bcOption on Bybit.Category — the component switches the WebSocket base URL automatically.

Public channels

SubscribeOrderbook, SubscribePublicTrade, SubscribeTicker, SubscribeKline, SubscribeLiquidation register every Bybit v5 public stream.

Signed private streams

SubscribePosition, SubscribeExecution, SubscribeOrder, SubscribeWallet open authenticated channels — the component handles the auth handshake.

REST endpoints

Bybit.REST_API wraps spot/derivatives REST calls (place order, cancel, account info, market data fallback) under the same component.

TestNet

Toggle Bybit.TestNet to switch both WebSocket and REST base URLs to the api-testnet endpoints.

Heartbeat & sequence tracking

Bybit v5 uses connection-level ping/pong and per-channel sequence numbers; the component verifies sequence continuity and raises OnException on gaps.

Specifications & references

Authoritative sources for the APIs this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — API_Bybit Full property, method and event reference for this component.
Demo Project — Demos\05.Crypto\14.Bybit Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Frequently asked questions

Common questions about the Bybit API component for Delphi and C++ Builder.

Drop a TsgcWebSocketClient and a TsgcWSAPI_Bybit component on your form, assign the client to the API component's Client property, set Bybit.ApiKey and Bybit.ApiSecret for private channels, choose the product category via Bybit.Category, then set WSClient.Active := True and call subscribe methods like SubscribeOrderbook or SubscribeTicker.
Yes. The same TsgcWSAPI_Bybit component exposes the Bybit v5 WebSocket channels (public orderbook, trade, ticker, kline and signed position, execution, order, wallet streams) and the signed REST API through Bybit.REST_API for placing and cancelling orders, account info and market-data fallback.
Public channels such as orderbook, trades, ticker and kline work without credentials. You only need a Bybit API key and secret for the authenticated private streams (position, execution, order, wallet) and for signed REST calls. Set Bybit.ApiKey and Bybit.ApiSecret and the component handles the auth handshake.
sgcWebSockets supports Delphi 7 through the latest Delphi 13, plus the matching C++ Builder versions. The Bybit component runs on Windows, macOS, Linux, iOS and Android.

Ready to Trade on Bybit?

Download the free trial and stream Bybit spot, derivatives and account events from Delphi.