Socketrade

Broker guide · checked 29 November 2026

MT5 API for XM

XM splits its MT5 servers by legal entity and then by a number, and the number is separated by a space: XMGlobal-MT5 10, not XMGlobal-MT510. The entity prefix decides which servers your account can use, and the number decides which one holds it.

Server names

Use the exact name MetaTrader shows. A wrong server is the most common connection failure.

XM.COM-MT5Accounts under the XM.COM entity.
XMGlobal-MT5XM Global entity. The base name, before any number.
XMGlobal-MT5 2 … XMGlobal-MT5 22The numbered servers for that entity. Note the space, and use the exact number.
XMGlobalSC-MT5 4, 5, 6, 16Seychelles entity.
XMGlobalKE-MT5 4, XMGlobalMU-MT5, XMZA-MT5 15, XMMena-MT5Kenya, Mauritius, South Africa and MENA entities.
XMTrading-MT5, XMTrading-MT5 2, 3XMTrading brand (Japan region).
The account cardDemo and live logins use the server in the welcome email and the Members Area; copy it exactly, space included.

Symbols and contract sizes

The same name does not always mean the same size. Check the contract before you set a lot.

EURUSDStandard spelling on MT5. Confirm it in Market Watch on your account.
XAUUSDGold. Check the contract size before sizing a lot.
Indices and cryptoUse the names the account's Market Watch shows; they can differ by entity.

Connect it

One call adds the account. Wait for ready before sending an order.

curl -X POST https://api.socketrade.com/v2/accounts \
  -H "X-API-Key: $SOCKETRADE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountNumber": "12345678",
    "accountPassword": "your-password",
    "accountServerHost": "XMGlobal-MT5 10",
    "name": "XM account"
  }'

What to watch

  • The number is part of the server and the space is part of the name. XMGlobal-MT5 2 and XMGlobal-MT5 20 are different servers, and both differ from XMGlobal-MT5.
  • The entity prefix comes first. An XMGlobalSC account cannot log in to an XMGlobal-MT5 server, even with the right password.
  • XM's directory entry carries no separate demo server name; a demo login uses the server in its welcome email. Copy it rather than assuming the live one.
  • A wrong server returns an invalid-account error, which reads like a password problem. Check the server before resetting the password.

Sources