The MetaTrader 5 Web API is MetaQuotes’ server-side interface for connecting an MT5 trade server to websites, CRMs and other company systems. An application logs in with a manager account and can manage users, balances, groups, symbols, orders, positions, deals, ticks and charts. It does not connect liquidity providers or stream an LP order book; those jobs belong to other MT5 APIs.
What is the MetaTrader 5 Web API?
The MetaTrader 5 Web API is the interface MetaQuotes provides for connecting an MT5 trade server to a broker’s own web services: the client portal, the CRM, payment processing, reporting and custom trading front ends. It runs against the server, not against a trader’s terminal, and it authenticates as a manager — the same kind of account your back-office staff use in the MT5 Manager terminal.
MetaQuotes’ own one-line definition is short, and it is accurate: the Web API is for integration with web resources and other company services. Everything else on this page is about what that means in practice. The full technical reference sits on MetaQuotes’ support site, which is available to licence holders after login; if you hold an MT5 server licence, or work for one, that reference is the authority over anything written here.
“Web API is used for platform integration with web resources and other services of the company.”
How is the Web API different from the other MetaTrader 5 APIs?
MetaQuotes publishes five APIs for MT5, and each one has a different job. The Web API is the one that talks to the server from outside over the network; the others either run inside the server, connect it to markets or extend its reports. The definitions in the second column are quoted from MetaQuotes’ broker page.
| API | MetaQuotes’ definition | Where your code runs | Typical broker job |
|---|---|---|---|
| Web API | “used for platform integration with web resources and other services of the company” | Your own server, connecting over the network | CRM, client portal, payments, custom WebTrader |
| Manager API | “allows you to develop custom administration and management utilities, or even your own manager terminal” | A manager application connecting to the server | Back-office tools, dealing and risk utilities |
| Server API | “can help you add more functions to MetaTrader 5 Trade Server and MetaTrader 5 History Server” | Inside the MT5 server as a plugin | Custom rules on every trade, bonuses, copy logic |
| Gateway API | “used for MetaTrader 5 integration with other trading systems and creation of custom data feeds” | A gateway attached to the platform | Liquidity providers, exchanges, data feeds |
| Report API | “expands the reports which are produced by the MetaTrader 5 trade servers” | Inside the reporting component | Custom regulatory and management reports |
Is the MT5 Web API REST or WebSocket?
The MT5 Web API is request and response: your application sends a command and waits for the answer. In current versions that means HTTPS requests to paths such as /api/user/get or /api/tick/last with JSON replies, alongside an older binary protocol over a persistent socket that MetaQuotes’ own sample code uses. We use both, for different jobs.
What it is not is a WebSocket API. Nothing in the Web API pushes a price or a position change to you on its own initiative; if you want live updates, you ask for them at a frequency you choose. When you read that a provider’s “MT5 Web API is WebSocket-based”, what they usually mean is that they built a WebSocket layer on top — which is exactly what we did for our branded WebTrader.
A second confusion is worth clearing up early. Several services sell an “MT5 API” that connects to a trader’s account through a terminal running on their cloud, or through MetaQuotes’ Python package for the desktop terminal. Those are account-level tools for traders and signal services. The Web API is broker-level: it sees every account on the server that the manager is allowed to see.
How does authentication to the MT5 Web API work?
Your application authenticates as an MT5 manager using a challenge-response exchange, so the manager password never travels in clear text. In the HTTPS form we use, it takes two calls:
- StartThe application calls the auth start command with its manager login, declaring itself as a Web API agent. The server replies with a random challenge.
- AnswerThe application combines the password hash with that challenge, sends the result, and adds a random challenge of its own.
- Verify the serverThe server answers the client’s challenge; the application checks that answer, so both sides have proved they know the password.
- Keep the sessionThe authenticated session is tied to the underlying connection. Drop the connection and you authenticate again.
What can you build with the MetaTrader 5 Web API?
Almost every client-facing system a broker needs can be built on the Web API, because it reaches the objects those systems care about: users, accounts, groups, symbols, orders, positions, deals and price history. The table maps the command areas we use to the jobs they serve.
| Area | What it covers | Typical use |
|---|---|---|
| Users and accounts | Create, update, delete and read accounts; check or change passwords; read balance, equity and margin | Account opening after KYC in the CRM, password resets, portal dashboards |
| Balance operations | Deposits, withdrawals, credit and corrections on an account | Crediting a card or bank deposit automatically |
| Groups and symbols | Read and maintain groups and symbol settings | Showing correct contract specs, margin and sessions in a front end |
| Orders, positions, deals, history | Open and historical trading data, including batch queries for many accounts | Trade history, statements, IB commission calculations |
| Prices and charts | Last ticks, tick statistics, tick history and chart bars | Quotes and charts in a WebTrader or mobile app |
| Trade requests | Requests executed on the server on behalf of an account, with a result code | Placing, modifying and closing orders from a custom front end |
| Mail and news | Internal mail and news to terminals | Service messages to clients |
What can the MT5 Web API not do?
The Web API cannot connect your server to liquidity, cannot run code inside the server and cannot push data to you. Those limits are by design: other MetaTrader 5 APIs exist for each of those jobs.
- No liquidity connectivity. Prices from banks or prime-of-prime providers arrive through a gateway, a liquidity bridge or Ultency — see the MT5 Gateway API and liquidity integration pages.
- No LP order book or market depth. The Web API gives you last ticks and statistics per symbol. It does not stream the aggregated book from your providers, so a Web API front end shows bid and ask, not a depth-of-market ladder.
- No logic inside the server. Rules that must run on every trade, before it is executed, need a Server API plugin. A Web API application only sees what has already happened.
- No push. Every update is a request; live quotes and positions mean polling at a rate you choose and the server can sustain.
- No custom server reports. Extending the reports the trade server itself produces is the Report API’s job.
How does FXUP use the MT5 Web API for its WebTrader?
Our WebTrader and mobile apps never talk to MT5 directly. They connect over secure WebSocket to a back end written in Go, and that back end talks to the MT5 server through the Web API using both the binary protocol and HTTPS requests. The client sees push-style updates; the MT5 server sees a small, predictable number of manager sessions.
You can try the result in the WebTrader demo and the mobile app demo, both connected to a real MT5 demo environment. FXUP is an independent developer and not affiliated with MetaQuotes; we build on the published interfaces like any other integrator. Our own CRM uses the same back end, and we also work with partner CRMs, proposing whichever fits the broker’s set-up.
Batch poller
One loop asks MT5 for ticks, positions, orders and account figures every 100 milliseconds using batch queries, so the load on the server does not grow with the number of connected users.
Per-client push
Each connected client receives only the symbols and accounts it subscribed to, and unchanged sections are not re-sent. Large frames are compressed.
History cache
Chart history is cached on disk and loaded lazily, so a trader scrolling back through years of H1 candles does not hit the MT5 server each time.
Trade safety
An identical order that is still executing is de-duplicated, and neither server nor apps automatically re-send a trade after a timeout — a double fill is worse than a retry the trader chooses.
How are trades placed through the Web API?
A trade through the Web API is a request executed on the server on behalf of the client’s account, followed by a result. Your application submits the request, receives an identifier, then reads the outcome: a return code such as 10009 (done) or 10008 (order placed), or a rejection such as invalid stops, market closed or not enough money.
Two practical consequences follow. First, the client’s own permissions still apply: group settings, symbol trading modes, stop levels and margin are enforced by the server, not by your front end, so the server is the final word. Second, a timeout does not mean the order failed. If the answer does not arrive, the honest response is to check positions and history before doing anything else. Our front ends tell the trader the outcome is uncertain rather than sending the same order again.
Timestamps are another detail that catches teams out. MT5 records times in the trade server’s configured time zone; anything you show to clients or store in a CRM should be converted to real UTC once, in one place.
How secure is an MT5 Web API integration?
The Web API itself uses challenge-response authentication and supports encrypted sessions; most of the remaining risk sits in how the integrator handles the manager account. A Web API manager can often move money and change accounts, so treat its credentials like the keys to a bank account. MetaQuotes states on its broker page that data exchange between system components runs over an encrypted connection; your own systems need the same discipline.
- Give the integration its own manager account with only the permissions and groups it needs; never reuse a dealer’s login.
- Restrict where that manager can connect from and keep the credentials in a secrets store, not in source code.
- Never expose the Web API to browsers or apps. Clients connect to your back end, which checks every request against the client’s own account.
- Rate-limit and lock out repeated failed logins per IP address on your side.
- Log every balance operation with who triggered it and why, and reconcile those logs against the CRM daily.
Does the MT5 Web API have rate limits?
MetaQuotes does not publish request limits on its public pages, and we will not quote numbers we cannot point to. In practice the limit is your server’s capacity and the behaviour of your integration, and a careless integration can slow a trade server for everyone.
What works for us is to keep a pool of authenticated sessions, separate trading requests from general queries, use batch commands wherever they exist, and cache anything that does not change every second, such as symbol settings and closed history. On the client side we apply a general message guard per connection but no limit on trades: a client is allowed to send orders back to back, because that is what trading is.
If you are designing your own integration, write down its load profile before go-live: how often you poll each data type, for how many accounts, and through how many sessions. That one page answers most of the questions a server administrator will ask.
Who can get MT5 Web API access?
Web API access comes from whoever controls the MT5 server, because it needs a manager account on that server. What that means depends on your setup. To see which FXUP setup gives you the access you need, with current prices and conditions on the same screen, compare the options in the solution finder.
| Setup | Who controls the server | What you can usually get |
|---|---|---|
| Own MT5 licence | Your company | Full access; you create managers and set permissions yourself |
| MT5 white label | The licence holder | A manager limited to your groups, if the agreement allows it |
| MT5 grey label | The provider | Varies by provider; with FXUP, a dedicated Manager account that sees only your users, plus Manager API and SDK access after payment |
What should be on an MT5 Web API integration checklist?
Before you write code, settle the things that are expensive to change later. This is the list we go through with clients connecting a broker CRM, portal or front end; the same checklist applies to the other custom integrations we build:
- Which server build and which Web API form (HTTPS, binary or both) you will use.
- A dedicated manager account, its permissions and the groups it can see.
- Which events trigger account creation, balance changes and group moves — and who approves them.
- Polling frequency per data type and the batch commands that cover it.
- Time zone handling and a single conversion point.
- What happens on a timeout for each operation, especially trades and balance changes.
- Monitoring: an alert when the MT5 connection drops, not a complaint from a client.
Questions buyers ask
What is the MetaTrader 5 Web API?
Is the MT5 Web API REST?
Can I build my own WebTrader on the MT5 Web API?
Does the Web API give access to market depth?
What is the difference between the Web API and the Manager API?
Can a grey label broker get API access?
Are there rate limits on the MT5 Web API?
Is the MT5 Web API secure?
How long does an MT5 Web API integration take?
Do I need permission from MetaQuotes to use the Web API?
Not covered here? Open the solution finder and see the setup, prices and conditions that fit your case.
Sources
- MetaQuotes — MetaTrader 5 trading platform for brokers and banks (accessed October 2026)
- MetaQuotes — MetaTrader 5 for brokers (metaquotes.net) (accessed October 2026)
- MetaQuotes — Liquidity providers for MetaTrader 5 (accessed October 2026)
- MQL5 Reference — Python integration for the MetaTrader 5 terminal (accessed October 2026)
FXUP is an independent consulting and technology firm and is not affiliated with MetaQuotes Ltd. MetaTrader 4 and MetaTrader 5 are trademarks of MetaQuotes Ltd. This page is general information, not legal, tax or investment advice; regulatory requirements depend on the jurisdiction and change over time. Current FXUP prices and conditions are shown in the solution finder.