MetaTrader 5 REST & WebSocket API
FxSocket exposes each connected MetaTrader 5 account through a REST API and a WebSocket stream. Every account gets its own dedicated MT5 terminal in our cloud — requests to your account hit your own terminal, nobody shares it. All endpoints return JSON.
https://api.fxsocket.com/mt5/{account_id}{account_id} is the UUID of your connected MT5 account — copy it from the Accounts page. Your API key lives on the API Key page.
You can link, list, and remove accounts from the dashboard, or programmatically through the account-management API at https://api.fxsocket.com/v1 — see Managing Accounts.
Request Builder
Fill in your account ID and API key, pick an endpoint, and copy a ready-to-run command. The API serves no CORS headers, so requests run from your terminal or server — not from this page.
curl -H "X-API-Key: fxs_live_YOUR_API_KEY" \ "https://api.fxsocket.com/mt5/YOUR_ACCOUNT_ID/AccountSummary"
Both links carry your API key in the URL so they open ready to use — Swagger arrives pre-authorized (and scrubs the key from the address bar); the WS tester URL keeps it and will appear in your browser history.
Explore the MT5 API
Authentication
API keys — header or query parameter.
Managing Accounts
Link, list, and remove accounts via /v1.
Account Data
Balances, positions, history, and connection status.
Market Data
Symbols, quotes, price history, and contract specs.
Trading
Place, modify, and close orders.
WebSocket Streams
Live ticks, bars, positions, and trades.
Errors & Rate Limits
Error envelope, status codes, and rate limits.
OpenAPI & Generated Clients
There are no official SDKs — the API is plain HTTP and JSON, and every account serves its own live OpenAPI 3 spec, so you can generate a typed client for any language instead:
- Swagger UI:
https://api.fxsocket.com/mt5/{account_id}/swagger-ui/— browsable, per-account interactive docs (keep the trailing slash). No API key needed — open yours from the Request Builder above. - Raw spec:
https://api.fxsocket.com/mt5/{account_id}/api-doc/openapi.json— point any OpenAPI generator (openapi-generator, openapi-typescript, oapi-codegen, …) at this URL.
These two routes (plus /) are the only ones served without an API key.