Interactive Explorer
MT5 Client API
Live API Playground

MT5 Client API Explorer

Connect to any MetaTrader 5 broker, get account data, trade, and stream live quotes — all from this page. Execute real API calls and see the responses instantly.

Base URL https://mt5.mtapi.io
GET /ConnectEx Step 1

Connect to a MetaTrader 5 trading account. Returns a token (session ID) used in all subsequent API calls. The token remains valid as long as the connection is alive.

MT5 account number (login)

MT5 account password

Broker server name as in MT5 terminal (e.g., MetaQuotes-Demo)

cURL
curl -X GET "https://mt5.mtapi.io/ConnectEx?user=5047396513&password=2eMn%21lYy&server=MetaQuotes-Demo"
GET /AccountSummary Step 2

Get comprehensive account information: balance, equity, margin, free margin, leverage, currency, and more. Requires a valid id (token from ConnectEx).

Auto-filled from ConnectEx response

cURL
curl -X GET "https://mt5.mtapi.io/AccountSummary?"
GET /OpenedOrders Step 3

Returns all currently open positions and pending orders on the account. Each order includes ticket, symbol, type (Buy/Sell), lots, open price, SL, TP, profit, swap, and more.

cURL
curl -X GET "https://mt5.mtapi.io/OpenedOrders?"
GET /OrderSendTask ⚠ Trading

Send a new order (market or pending). This will place a real trade on your account. Use a demo account for testing. Supports Buy, Sell, Buy Limit, Sell Limit, Buy Stop, Sell Stop.

This will place a real order on your account. Use a demo account!

Session token (auto-filled)

Trading symbol

Order type

Lot size (e.g., 0.01 = micro lot)

Price for pending orders. Leave 0 or empty for market orders.

Stop Loss price (0 = no SL)

Take Profit price (0 = no TP)

Max price deviation in points (slippage)

Order comment (optional)

cURL
curl -X GET "https://mt5.mtapi.io/OrderSendTask?id=YOUR_TOKEN&symbol=EURUSD&type=0&volume=0.01&sl=0&tp=0&deviation=10"
GET /OrderCloseTask ⚠ Trading

Close an existing open position by its ticket number. You can also do a partial close by specifying a volume less than the position size.

Session token (auto-filled)

Position ticket number from OpenedOrders

Volume to close. Leave empty to close entire position.

cURL
curl -X GET "https://mt5.mtapi.io/OrderCloseTask?id=YOUR_TOKEN"
GET /Subscribe Step 6a

Subscribe to a trading symbol's quote updates. This must be called before connecting to the /OnQuote WebSocket. You can subscribe to multiple symbols by calling this endpoint multiple times.

Trading symbol to subscribe to (e.g., EURUSD, GBPUSD, XAUUSD)

cURL
curl -X GET "https://mt5.mtapi.io/Subscribe?id=YOUR_TOKEN&symbol=EURUSD"
WSS /OnQuote Step 6b

Connect to the WebSocket to receive live bid/ask prices for all subscribed symbols. Call /Subscribe first, then open this WebSocket to stream quotes continuously.

WebSocket URL
wscat -c "wss://mt5.mtapi.io/OnQuote?id=YOUR_TOKEN"

Need help?

Our team is ready to help you integrate.