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.
https://mt5.mtapi.io/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 -X GET "https://mt5.mtapi.io/ConnectEx?user=5047396513&password=2eMn%21lYy&server=MetaQuotes-Demo"/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 -X GET "https://mt5.mtapi.io/AccountSummary?"/OpenedOrders
Step 3Returns 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 -X GET "https://mt5.mtapi.io/OpenedOrders?"/OrderSendTask
⚠ TradingSend 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.
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 -X GET "https://mt5.mtapi.io/OrderSendTask?id=YOUR_TOKEN&symbol=EURUSD&type=0&volume=0.01&sl=0&tp=0&deviation=10"/OrderCloseTask
⚠ TradingClose 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 -X GET "https://mt5.mtapi.io/OrderCloseTask?id=YOUR_TOKEN"/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 -X GET "https://mt5.mtapi.io/Subscribe?id=YOUR_TOKEN&symbol=EURUSD"/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.
wscat -c "wss://mt5.mtapi.io/OnQuote?id=YOUR_TOKEN"