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.
Stream CEX.IO public ticker, trade and order book channels, or authenticate to drive private trading actions over the same WebSocket connection.
CEX.IO WebSocket client — ticker, trades and order book streams, plus authenticated channels for placing and managing orders.
TsgcWSAPI_Cex
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
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);
Public market streams plus authenticated trading endpoints — one component, two channel sets.
SubscribeTicker, SubscribeOrderBook and SubscribeTrade deliver public market data for the chosen currency pair without authentication.
Set Cex.ApiKey and Cex.ApiSecret — the component HMAC-signs the auth payload and unlocks the private trading channels.
PlaceOrder, CancelOrder, OrderBook snapshot, and OpenOrders calls reach the authenticated side of the same WebSocket connection.
OrderBook subscriptions deliver an initial snapshot followed by incremental updates — the component exposes both events separately so you can sync a local book.
On WatchDog reconnect the component re-subscribes to every previously active channel and replays the auth handshake transparently.
TsgcWSAPI_CexPlus targets the institutional CEX.IO Aggregator endpoint — same component surface with extended trading actions.
Authoritative sources for the APIs this component implements.
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. | Open | |
| Demo Project — Demos\05.Crypto\04.Cex Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |