OKX Exchange API

Stream spot, futures, perpetual swap, and options market data from OKX via WebSocket channels.

OKX Integration

Access OKX's comprehensive WebSocket API for real-time data across all instrument types.

Multi-Instrument Market Data

The sgcWebSockets OKX component connects to the OKX WebSocket API, providing unified access to spot, margin, futures, perpetual swaps, and options markets. Subscribe to tickers, order books, trades, candlesticks, and funding rates across all instrument types.

  • Spot, futures, swaps, and options data
  • Order book depth with multiple levels
  • Candlestick and index data channels
  • Private account and order channels

Delphi OKX Example

Subscribe to OKX ticker data.

uses
  sgcHTTP_API_OKX;

var
  OKX: TsgcHTTPAPI_OKX;

procedure TForm1.FormCreate(Sender: TObject);
begin
  OKX := TsgcHTTPAPI_OKX.Create(nil);
  OKX.OnOKXTicker := OnTicker;
  OKX.Connect;
end;

procedure TForm1.Subscribe;
begin
  OKX.SubscribeTicker('BTC-USDT');
end;

procedure TForm1.OnTicker(Sender: TObject;
  aInstId, aLast, aBidPx, aAskPx: string);
begin
  Label1.Caption := aInstId + ': $' + aLast;
end;

Documentation & Demos

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

Ready to Stream OKX Data?

Download the free trial and connect to OKX in minutes.