eSeGeCe
software
Trade Smarter with Native Delphi and CBuilder Integration for MEXC Spot and Futures
The new sgcWebSockets 2025.10.0 release takes cryptocurrency connectivity to the next level with the addition of a brand-new MEXC API component. Designed for Delphi and CBuilder developers, this component offers seamless access to MEXC's Spot and Futures APIs — supporting both WebSocket streaming and HTTP REST endpoints.
Whether you're building a trading bot, a market-data dashboard, or an analytics tool, the MEXC component provides a complete, native, and event-driven experience right inside your Delphi or CBuilder projects.
The release introduces two new classes:
TsgcWSAPI_MEXC – implements the Spot WebSocket and REST API.TsgcWSAPI_MEXC_Futures – implements the Futures WebSocket and REST API.Together, these components allow you to:
All of this is implemented natively, no external dependencies, just pure Delphi / C++Builder performance.
Using the MEXC API in sgcWebSockets is intuitive and consistent with other sgcWebSockets APIs like Binance, Bybit, or KuCoin.
Example: Connecting to the MEXC Spot WebSocket
var
WSClient: TsgcWebSocketClient;
MEXC: TsgcWSAPI_MEXC;
begin
WSClient := TsgcWebSocketClient.Create(nil);
MEXC := TsgcWSAPI_MEXC.Create(nil);
MEXC.Client := WSClient;
MEXC.MEXCAPI.ApiKey := 'YOUR_KEY';
MEXC.MEXCAPI.ApiSecret := 'YOUR_SECRET';
MEXC.MEXCUserDataStreams.UserStream := True;
if WSClient.Connect then
MEXC.SubscribeTrade('BTCUSDT');
end;
This snippet connects your Delphi application to the MEXC Spot exchange and subscribes to live trade updates for BTC/USDT.
The component handles message parsing, authentication, and reconnection automatically.
Example: Fetching Data via HTTP REST (Spot API)
var MEXC: TsgcWSAPI_MEXC; Response: string; begin MEXC := TsgcWSAPI_MEXC.Create(nil); MEXC.MEXCAPI.ApiKey := 'YOUR_KEY'; MEXC.MEXCAPI.ApiSecret := 'YOUR_SECRET'; // Retrieve account information Response := MEXC.REST_API.GetAccountInfo; Memo1.Lines.Text := Response; end;
The MEXC component also supports the Futures API, allowing developers to manage perpetual contracts and real-time positions.
Example: Subscribing to Futures Market Data
var
WSClient: TsgcWebSocketClient;
MEXC: TsgcWSAPI_MEXC_Futures;
begin
WSClient := TsgcWebSocketClient.Create(nil);
MEXC := TsgcWSAPI_MEXC.Create(nil);
MEXC.Client := WSClient;
MEXC.MEXCAPI.ApiKey := 'YOUR_KEY';
MEXC.MEXCAPI.ApiSecret := 'YOUR_SECRET';
if WSClient.Connect then
MEXC.SubscribeTrade('BTCUSDT');
end;
The new component follows the same design philosophy that makes sgcWebSockets the most developer-friendly communication library for Delphi and CBuilder:
You can explore the full API documentation at:
Whether you're creating trading dashboards, portfolio managers, or high-frequency bots, sgcWebSockets 2025.10.0 empowers you to focus on your logic, not on API plumbing.
With the release of sgcWebSockets 2025.10.0, Delphi and CBuilder developers can now integrate MEXC Spot and Futures APIs directly into their applications with minimal effort.
Real-time data, RESTful endpoints, authentication, and market access — all in one place, all natively coded in Delphi.
Upgrade today and start building the next generation of crypto trading applications with sgcWebSockets and the new MEXC component.
Find below a compiled version of the sample for MEXC.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.