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.
What's new
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:
- Connect to public market data (tickers, trades, depth, etc.).
- Manage private data streams (orders, balances, positions).
- Execute REST calls for placing or canceling orders, checking balances, and retrieving account history.
- Handle real-time trading events through easy-to-use Delphi events.
All of this is implemented natively, no external dependencies, just pure Delphi / C++Builder performance.
Simple Integration for Delphi and CBuilder
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;
Real-Time Futures Trading with Delphi and CBuilder
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;
Unified Architecture and Documentation
The new component follows the same design philosophy that makes sgcWebSockets the most developer-friendly communication library for Delphi and CBuilder:
- Consistent class hierarchy across all exchanges (Binance, KuCoin, Bybit, and now MEXC).
- Unified event model for WebSocket messages.
- Simplified authentication and automatic request signing.
- Full SSL/TLS support and integrated logging.
You can explore the full API documentation at:
Why Developers Love It
- Native Integration: No external libraries — 100% Delphi and C++Builder.
- Cross-Platform: Supports Windows, macOS, Linux, and mobile.
- Event-Driven Design: Simplifies handling real-time data streams.
- Fast and Reliable: Built on sgcWebSockets' robust networking core.
- Unified API: A single, consistent interface for Spot and Futures.
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.
Conclusion
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.