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.
- Open the MT5 bridge session and store the returned session id.
- Confirm account permissions and enabled symbols with /account and /symbols.
- Test a performance or history endpoint with a short time window.
- Subscribe to stream events before placing a live trade task.
| Header | Value | Notes |
|---|---|---|
| Authorization | Bearer <api-key> | Workspace API key. |
| x-session-id | sess_mt5_live_07 | Bridge session id. |
| x-request-id | req_mt5_stats | Recommended 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
| Code | Meaning | Typical Cause |
|---|---|---|
| 200 | OK | Read or analytics request succeeded. |
| 202 | Accepted | Order or close request is queued for broker execution. |
| 400 | Bad Request | Payload or window parameters are invalid. |
| 429 | Rate Limited | History or analytics requests exceeded workspace limits. |
| 503 | Stream Unavailable | The MT5 bridge or event stream is temporarily unavailable. |