CEX.IO WebSocket API

Stream CEX.IO public ticker, trade and order book channels, or authenticate to drive private trading actions over the same WebSocket connection.

TsgcWSAPI_Cex

CEX.IO WebSocket client — ticker, trades and order book streams, plus authenticated channels for placing and managing orders.

Component class

TsgcWSAPI_Cex

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

Pair the component with a TsgcWebSocketClient, set Cex.ApiKey / Cex.ApiSecret if you need private channels, then SubscribeTicker / SubscribeOrderBook / SubscribeTrade.

uses
  sgcWebSocket, sgcWebSocket_API_Cex;

var
  WSClient: TsgcWebSocketClient;
  Cex: TsgcWSAPI_Cex;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  Cex := TsgcWSAPI_Cex.Create(nil);
  Cex.Client := WSClient;
  Cex.Cex.ApiKey    := 'your-api-key';
  Cex.Cex.ApiSecret := 'your-api-secret';

  WSClient.Active := True;

  Cex.SubscribeTicker;
  Cex.SubscribeOrderBook('BTC', 'USD', 30);
  Cex.SubscribeTrade('BTC', 'USD');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Cex
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Cex *Cex = new TsgcWSAPI_Cex(this);
Cex->Client = WSClient;

WSClient->Active = true;
Cex->SubscribeTicker();
Cex->SubscribeOrderBook("BTC", "USD", 30);

What's inside

Public market streams plus authenticated trading endpoints — one component, two channel sets.

Public channels

SubscribeTicker, SubscribeOrderBook and SubscribeTrade deliver public market data for the chosen currency pair without authentication.

Authentication

Set Cex.ApiKey and Cex.ApiSecret — the component HMAC-signs the auth payload and unlocks the private trading channels.

Order management

PlaceOrder, CancelOrder, OrderBook snapshot, and OpenOrders calls reach the authenticated side of the same WebSocket connection.

Snapshot then deltas

OrderBook subscriptions deliver an initial snapshot followed by incremental updates — the component exposes both events separately so you can sync a local book.

Reconnection

On WatchDog reconnect the component re-subscribes to every previously active channel and replays the auth handshake transparently.

Higher-tier sibling

TsgcWSAPI_CexPlus targets the institutional CEX.IO Aggregator endpoint — same component surface with extended trading actions.

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_Cex Full property, method and event reference for this component.
Demo Project — Demos\05.Crypto\04.Cex 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.

Ready to Trade on CEX.IO?

Download the free trial and stream CEX.IO market data and account events from Delphi.