A push feed for live MetaTrader market data.
The MetaTrader WebSocket API lets any application subscribe to a live MT4 or MT5 account and receive market data as a continuous stream instead of repeatedly asking for it. You open one connection to wss://api.metatraderapi.net/v1/stream, send a subscribe message per symbol, and the server pushes a JSON frame when the price changes (at most one per 200 ms per symbol) — bid, ask, last, real volume and trade flags — plus positions with live profit, pending orders, executed trades and a connection-state heartbeat on the same socket. It removes the polling loop that makes REST-based quote apps slow, expensive and always a step behind the market.
Why not just poll a REST quote endpoint?
Because the market moves between your requests. Streaming pushes price changes as they arrive (up to five quotes a second per symbol); polling gives you snapshots with gaps — and burns requests doing it.
REST POLLING The old way
- You ask "what's the price?" 10× a second and hope you didn't miss a spike between calls.
- Thousands of wasted requests when nothing changed.
- Latency = your polling interval. Fast enough hits rate limits.
WEBSOCKET With streaming
- Price changes are pushed as they arrive — at most one quote every 200 ms per symbol.
- One connection, many symbols. Frames don't count as REST requests.
- Positions, orders, executed trades and connection state on the same socket.
Live data in three steps.
Get a key
Connect an MT4/MT5 account in the dashboard and copy its API key.
Open the socket
Point a WebSocket at wss://api.metatraderapi.net/v1/stream with your key and account id.
Subscribe
Send {action:"subscribe",symbol:"EURUSD"} and read the frames.
// One socket, pushed quotes — no polling loop. Browsers pass ?apiKey=; servers send the x-api-key header. const ws = new WebSocket("wss://api.metatraderapi.net/v1/stream?id=<accountId>&apiKey=mt5api_…"); ws.onopen = () => { ws.send(JSON.stringify({ action:"subscribe", symbol:"EURUSD" })); ws.send(JSON.stringify({ action:"subscribe", symbol:"XAUUSD" })); }; ws.onmessage = (e) => { const f = JSON.parse(e.data); // { type:"QUOTE", data:{ symbol:"EURUSD", bid:1.16395, ask:1.16403, // timeMsc:1788975235949, last:0.0, volumeReal:0 } } if (f.type === "QUOTE") console.log(f.data.symbol, f.data.bid, f.data.ask); };
Built for anyone who can't wait for the next poll.
Trading dashboards
Live price charts and blotters that update as the price changes, without hammering an endpoint.
Algo & signal bots
Fire strategy logic on each pushed quote, not on a timer. TRADE frames report every executed deal.
Price alerts & copy tools
Watch dozens of symbols on one connection and react to level crossings as the quotes arrive.
One socket does the work of thousands of requests.
Frequently asked
What is the MetaTrader WebSocket API?+
wss://api.metatraderapi.net/v1/stream, subscribe to symbols, and receive JSON frames for quote changes (at most one per 200 ms per symbol), positions, orders, executed trades and connection state — instead of polling a REST endpoint.How is streaming different from the REST quotes endpoint?+
Does it work with both MT4 and MT5?+
What data does each quote frame contain?+
QUOTE frame carries the symbol, bid, ask, last price, volume, real volume, millisecond timestamps (timeMsc, plus UTC fields) and trade flags — enough to build tick charts, VWAP or microstructure analytics.Can I get trade events and connection status on the same socket?+
Is there a REST or gRPC option too?+
Point a WebSocket at your account and watch it tick.
Connect an MT4 or MT5 account, grab your key, and stream live prices in three lines of code.