MetaTrader API · 8 min read · 2026-09-03
The MetaTrader REST and Web API: What Exists, What Doesn't
By MetaTrader API Editorial Team

Four different things get called "the MetaTrader API" and only one of them is available to you. A straight map of MQL5, the Manager/Server API, the Web Terminal and third-party REST bridges — what each one is, who can actually get it, and which one fits what you are building.
Short answer: MetaQuotes publishes no REST or Web API for retail MetaTrader accounts. There is no api.metatrader.com, no developer portal, and no documentation to read — which is why searches for "MetaTrader 4 Web API" and "MetaTrader 5 REST API" return so much noise. What exists is four separate things sharing one name, and only one of them is available to someone who is not a broker.
This page is the map. It will not sell you anything for the first thousand words, because the most common reason these integrations fail is that people pick the wrong layer before they start.
The four things called "the MetaTrader API"
1. MQL5 (and MQL4)
A C-like language for Expert Advisors and indicators that runs inside a terminal. It can place orders, read prices and call out over HTTP with WebRequest.
Who can get it: anyone. Why it is usually the wrong answer: the code runs inside a GUI application that has to stay alive on a Windows machine. One terminal, one account, one desktop session. Scaling it means running N terminals on N VPSes and babysitting all of them. It is a scripting layer for a chart, not backend infrastructure.
2. The Manager API and Server API
A C++/.NET library from MetaQuotes that gives near-root control of a trade server: create accounts, adjust balances, read every position on the platform.
Who can get it: brokers only. MetaQuotes licenses it to the entity that operates the trade server. If you are building a SaaS product on top of someone else's brokerage, you will not be given this, and no amount of asking changes that. If you searched for "MetaTrader 5 Gateway API" or "MetaTrader 4 Manager API documentation", this is what you found — and it is almost certainly not available to you.
That is worth saying plainly because a large share of the traffic to these terms is developers who spend a week trying to license something they were never eligible for.
3. The Web Terminal
MetaQuotes' browser-based trading UI. It is an interface for humans. There is no documented machine interface behind it, and driving it programmatically means scraping a UI that changes without notice.
Who can get it: anyone. Useful as an API: no.
4. A third-party REST bridge
A service that speaks the MetaTrader protocol on your behalf and exposes it as ordinary HTTPS and WebSocket. You authenticate with account credentials or a key, and you get JSON.
Who can get it: anyone. This is the only category that gives a retail-side developer a real REST API, and it is what this site provides.
So which do you need?
| What you are building | Layer |
|---|---|
| An indicator or EA for your own chart | MQL5 |
| A bot managing one account on your own desktop | MQL5, or a REST bridge if you want it off your machine |
| A SaaS that connects customers' accounts | REST bridge |
| A copy-trading or signal platform | REST bridge |
| A prop-firm dashboard watching many accounts | REST bridge |
| Your own brokerage, on your own trade server | Manager/Server API, from MetaQuotes |
The dividing line is simple: if you do not own the trade server, the Manager API is not an option, and everything else routes through either a terminal or a bridge.
What a REST layer for MetaTrader looks like
Whatever provider you pick, the shape is the same. A request carries a key and an account identifier:
curl -X GET \
"https://api.metatraderapi.net/AccountSummary?id={{accountId}}" \
-H "x-api-key: YOUR_API_KEY"
and returns JSON rather than a terminal window:
{ "balance": 10000.00, "equity": 10234.50, "margin": 500.00, "profit": 234.50 }
Streaming is a WebSocket rather than a polling loop, because quote data at any useful frequency is not something to poll.
The three things worth checking before you commit to any provider:
- Does it need a terminal or an EA? If the answer is yes, you have bought a hosting problem, not an API. Latency and reliability both come from that answer.
- How is it billed? Per connected account gets expensive precisely when your product succeeds. Flat pricing does not.
- What happens to a disconnected account? Reconnection behaviour is the single most common source of production incidents in this category, and it is rarely documented. Ask.
Where the documentation actually is
There is no MetaQuotes REST documentation to find, which is why "MetaTrader 4 API documentation" and "MetaTrader 5 API documentation" are such frustrating searches. The documentation you want belongs to whichever bridge you use.
Ours is at app.metatraderapi.net/docs — endpoints, authentication, the WebSocket contract and the error semantics, in one place.
The short version
- MetaQuotes ships no public REST or Web API for retail accounts. Nothing you are failing to find.
- MQL5 runs inside a terminal. Fine for one chart, wrong for a backend.
- The Manager and Server API is real, powerful and licensed to brokers only.
- A third-party REST bridge is the only route to HTTPS-and-JSON access to an existing MT4 or MT5 account, and the questions that matter are terminal dependency, billing model and reconnection behaviour.
If you want to see the shape of it against a live account, the documentation has the full endpoint list, and an account takes about ten minutes to connect.
Ready to integrate the MetaTrader API?
Set up in under 30 minutes. No terminal required.
Get Started →