MEXC Exchange API
Stream real-time market data and trading information from the MEXC cryptocurrency exchange.
Stream real-time market data and trading information from the MEXC cryptocurrency exchange.
Access MEXC's WebSocket API for real-time ticker, depth, and trade data across spot and futures markets.
The sgcWebSockets MEXC component connects to the MEXC WebSocket API, providing real-time market data for hundreds of trading pairs. Subscribe to ticker updates, order book depth, kline data, and trade events.
Subscribe to MEXC ticker data.
uses
sgcHTTP_API_MEXC;
var
MEXC: TsgcHTTPAPI_MEXC;
procedure TForm1.FormCreate(Sender: TObject);
begin
MEXC := TsgcHTTPAPI_MEXC.Create(nil);
MEXC.OnMEXCTicker := OnTicker;
MEXC.Connect;
end;
procedure TForm1.Subscribe;
begin
MEXC.SubscribeTicker('BTCUSDT');
end;
procedure TForm1.OnTicker(Sender: TObject;
aSymbol, aPrice, aVolume: string);
begin
Label1.Caption := aSymbol + ': $' + aPrice;
end;
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.