SWAGGER STYLE

MT5 Client Explorer

Explore MT5 order placement, analytics, account reads, and historical endpoints.

Base URLhttps://api.metatraderapi.xyz/mt5/client
AuthBearer API key + session header

How To Test This API

Warm the session with a lightweight account read before exercising order or analytics endpoints.

Use smaller history windows during manual testing so performance metrics return quickly and predictably.

  1. Open the MT5 bridge session and store the returned session id.
  2. Confirm account permissions and enabled symbols with /account and /symbols.
  3. Test a performance or history endpoint with a short time window.
  4. Subscribe to stream events before placing a live trade task.
HeaderValueNotes
AuthorizationBearer <api-key>Workspace API key.
x-session-idsess_mt5_live_07Bridge session id.
x-request-idreq_mt5_statsRecommended for writes and batch fetches.

Sample Request

BASH
curl https://api.metatraderapi.xyz/mt5/client/stats/performance \
  -H "Authorization: Bearer <api-key>" \
  -H "x-session-id: sess_mt5_live_07" \
  -G --data-urlencode "window=30d"

Sample Response

JSON
{
  "profitFactor": 1.94,
  "maxDrawdownPct": 6.2,
  "expectancy": 24.11,
  "sharpeRatio": 1.38
}

Common Status Codes

CodeMeaningTypical Cause
200OKRead or analytics request succeeded.
202AcceptedOrder or close request is queued for broker execution.
400Bad RequestPayload or window parameters are invalid.
429Rate LimitedHistory or analytics requests exceeded workspace limits.
503Stream UnavailableThe MT5 bridge or event stream is temporarily unavailable.