MetaTrader Server, Manager & Web API: What Brokers Get and Traders Don't

October 26, 2026·8 min read
A broker's MetaTrader server surrounded by the Server, Manager, Gateway, Web and Report APIs, with a trader's terminal outside it

Search for MetaTrader 4 Server API documentation and you land on vendor pages, MCP projects and forum threads from a decade ago. That is not because the documentation is hard to find. MetaQuotes' APIs are not public developer APIs at all. They are toolkits for brokers that run their own MetaTrader server, and they come with a license, not a sign-up page.

The short answer

MetaQuotes ships five APIs with its server platform: the Server, Manager, Gateway, Web and Report API (on MT4, the DataFeed and WebServices API take the place of Gateway and Web). All five are for brokers who operate a MetaTrader server. They are licensed, their documentation sits behind a MetaQuotes login, and they are not available to traders, developers or prop firms without a server of their own.

If you want to automate an MT4 or MT5 account, you work through the account's terminal instead, for example with a REST and WebSocket API on top of it.

The five MetaTrader APIs at a glance

MetaQuotes lists the APIs on its broker pages for MetaTrader 5 and MetaTrader 4. The two platforms cover the same five jobs, with two of them renamed on MT5:

MT5MT4What brokers use it for
Server APIServer APIPlugins inside the trade server: order handling, risk rules, custom server logic
Manager APIManager APIBack-office tools and custom manager terminals: accounts, groups, deposits
Gateway APIDataFeed APIConnecting the server to liquidity providers, exchanges and price feeds
Web APIWebServices APILinking the platform to the broker's website, client area and other systems
Report APIReport APICustom reports on accounts and financial operations

Server API: plugins inside the trade server

The Server API extends the trade server itself. On MT4, MetaQuotes describes it as the way to build server plugins that manage server parameters, orders and the customer base, and process trade requests. On MT5 it adds functions to the Trade Server and the History Server. Risk plugins and other server-side add-ons that brokers buy from vendors are built here, and on MT4 so are most bridges to liquidity providers. All of it runs on the broker's own machines.

Manager API: the manager terminal, in code

Brokers run their day-to-day operations in a manager terminal: opening accounts, moving them between groups, booking deposits and withdrawals, watching exposure. The Manager API exposes that work to code, so a broker can build its own administration tools or even its own manager terminal. It logs in with a manager account, which reaches every account the manager is allowed to see, not just one.

Most products sold as an "MT4 Web API" or "MT5 Manager JSON API" are this interface wrapped in HTTP. They are useful for brokers and their CRM vendors, and they all need manager credentials from the broker that runs the server.

Gateway API (MT5) and DataFeed API (MT4)

The Gateway API connects a MetaTrader 5 server to other trading systems and is used for custom data feeds. It is how a broker routes orders to liquidity providers or exchanges, and MetaQuotes also offers ready-made gateways for popular venues. On MT4, the DataFeed API covers news and quote feeds. This is also where FIX usually lives in a MetaTrader setup, between the broker and its liquidity, as our guide to the MetaTrader FIX API explains.

Web API (MT5) and WebServices API (MT4)

This is the one most often mistaken for a REST API for traders. It integrates the platform with the broker's web resources and other company systems. MetaQuotes' own MT4 description is concrete: it is for arranging user accounts and showing quotes on a website. Think of the registration form on a broker's site that opens a demo account, or the client area that shows your balance.

Report API

The Report API produces custom reports on financial operations and trader accounts, beyond the reports the trade server generates by default. Like the others, it runs on the broker side.

Why you can't find the documentation

  • The APIs come with a server license. MetaQuotes does not run MetaTrader as a hosted service: brokers deploy the software on their own hardware, and the APIs are part of that deployment.
  • The documentation sits behind a login. MetaQuotes keeps its API documentation on its support site, where the pages open only after signing in. The public broker pages only say what each API is for.
  • MT4 is closed to new brokers. MetaQuotes states that MetaTrader 4 platform licenses are no longer available for purchase and that further development goes into MetaTrader 5. The MT4 Server and Manager APIs are therefore limited to brokers that already run MT4.

Manager login vs trader login

The distinction that sorts out most of the confusion is which login an API works with.

Manager loginTrader login
Issued byThe broker, to its own staff and systemsThe broker, to each client
ReachesEvery account in the groups it may manageOne account
CanOpen accounts, book deposits, change settingsTrade and read that account (read-only with the investor password)
Used byManager API, Web API and the products built on themThe terminal, Expert Advisors, terminal-side APIs

A broker will not give you manager access, and it should not: one manager login reaches far more than your account. So when a product asks for manager credentials, it is a tool for brokers. A prop firm that runs its own MetaTrader server can use the Manager API for that server. A trader, a developer, or a prop firm working with accounts on someone else's server works with account logins.

Which one do you need?

  • Your CRM should open accounts and book deposits on your own MetaTrader server: the Manager API or the Web API.
  • Your MT5 server needs liquidity or exchange access: the Gateway API, or a ready-made gateway from MetaQuotes or a vendor.
  • You need custom logic inside the server, such as your own risk rules: a Server API plugin.
  • You need reports the server does not produce: the Report API.
  • You are a trader, developer, signal provider or prop firm working with accounts on a broker's server: none of the five. You work through the account's terminal.

Automating an account without the broker APIs

Everything a trader can do in MetaTrader goes through the terminal logged in to the account. There are three ways to drive it from code: an Expert Advisor written in MQL that runs inside the terminal, MetaQuotes' MetaTrader5 Python package (MT5 only, on Windows, next to a running terminal), or a hosted API that runs the terminal for you.

That last one is what FxSocket does. It starts a dedicated MT4 or MT5 terminal for each account in the cloud and gives you a REST API and a WebSocket stream, from any language:

# Balance, equity and margin of one account
curl -H "X-API-Key: $FXSOCKET_API_KEY" \
  https://api.fxsocket.com/mt5/$ACCOUNT/AccountSummary

To be clear about the scope: FxSocket works with ordinary account logins, not manager access. It cannot open accounts on a broker's server or move money, and your funds stay with your broker. What it gives you is the account you already have, from normal code, with the documentation and Python and Node.js SDKs to match.

Automate your MT4 or MT5 account, no broker API needed

Connect any MT4 or MT5 account with its normal login, demo or live, and control it over REST and WebSocket from Python, Node.js or any other language.

Frequently asked questions

Is there an official MetaTrader 4 REST API?

No. The web-facing interface MetaQuotes ships for MT4 is the WebServices API, which brokers use to connect the platform to their website. REST APIs for MT4 come from third parties: broker-side products wrap the Manager API and need manager credentials, while trader-side services such as FxSocket drive a terminal with an ordinary account login.

Where can I find the MetaTrader 4 Server API documentation?

MetaQuotes distributes it to licensed brokers, and its documentation sits behind a login on the MetaQuotes support site. The public page at metatrader4.com only describes what each MT4 API is for. If you are not a broker running your own MT4 server, there is no documentation to get, because there is nothing for you to connect it to.

Can a trader get access to the MT5 Manager API?

No. The Manager API connects to a MetaTrader 5 server with a manager account, and only the broker that runs the server can create one. Brokers do not hand manager access to clients, because it reaches far beyond a single account.

What is the difference between the MT5 Manager API and the Web API?

MetaQuotes describes the Manager API as the way to build custom administration and management utilities, up to a complete manager terminal. The Web API is for integrating the platform with web resources and the company's other services. Both are tools for the broker running the server.

What does the MT5 Gateway API do?

It connects a MetaTrader 5 server to other trading systems, such as liquidity providers and exchanges, and is used to build custom data feeds. On MT4, price and news feeds are built with the DataFeed API instead.

Can I still buy a MetaTrader 4 server license?

No. MetaQuotes states that MetaTrader 4 platform licenses are no longer available for purchase and that its development effort goes into MetaTrader 5. The MT4 Server and Manager APIs are therefore limited to brokers that already run MT4.