Broker Directory
API for XM — REST & WebSocket for MT4 & MT5
Operating as XM (BVI) Limited
Connect XM MT4 and MT5 accounts to a professional REST & WebSocket API. Retrieve live balances, execute trades, and stream real-time market data programmatically -- no terminal, no Expert Advisor, no MQL required.
Get API Access for XM
Set up in under 30 minutes. Works with any XM MT4 or MT5 account.
Get API Access →Is There an API for XM?
Yes. API2Trade is an independent REST and WebSocket API that bridges XM MT4 and MT5 trading accounts to external applications -- it is not operated by XM and is not a MetaTrader terminal replacement or Expert Advisor. You authenticate with your existing XM account credentials (or an API key), and API2Trade handles the live connection to XM's MT4/MT5 trading servers on your behalf. Once connected, you can retrieve live balance, equity, and margin data, execute or modify trades, and subscribe to real-time price and order-update streams over WebSocket -- all through standard HTTP and WebSocket calls in any programming language. No Expert Advisor, MQL code, or running MetaTrader terminal is required at any point, and setup typically takes under 30 minutes.
What You Can Do With the XM API
- Retrieve live balance, equity, margin, and full trading history via REST
- Open, modify, and close market or pending orders programmatically
- Subscribe to live quotes, order updates, and equity changes via WebSocket
- Manage unlimited XM accounts through a single API key
Where XM Operates
XM runs MT4/MT5 trading servers reachable from the following regions:
Need a dedicated VPS for XM instead?
If you need a low-latency Windows VPS running your own MetaTrader terminal or Expert Advisor near XM's trading servers, metatrader-vps.com -- a separate VPS-hosting service -- matches you to the closest available datacenter. (metatrader-vps.com does not provide REST/WebSocket API access; for programmatic account access without a terminal, use API2Trade above.)
Find a VPS for XM →Frequently Asked Questions
Does API2Trade support XM?
Yes. API2Trade connects to XM MT4 and MT5 accounts via REST and WebSocket, using standard investor/master credentials -- no Expert Advisor or running terminal required.
Do I need to install an EA to connect XM to an API?
No. API2Trade bridges the MetaTrader account directly, so no Expert Advisor deployment or MQL coding is required.
Is there a REST API for XM MT4/MT5?
Yes -- API2Trade exposes REST endpoints for account data and trade execution, plus a WebSocket feed for live quotes and order updates, for any XM MT4 or MT5 account.