# MT5 API: what MetaQuotes offers and what third parties add

URL: https://fincodelabs.com/en/blog/mt5-api · Publisher: Fincode (Fincode Yazılım ve Teknoloji A.Ş.), Istanbul, Turkey · Category: Stocks, forex and broker APIs · Published: 2026-11-06 · Updated: 2026-11-06

MT5 API means six different things. A map of MQL5, the Python package, the new MCP server, broker-side Manager and Web APIs, bridges and REST wrappers.

**Short answer:** **MT5 API** names several different things, and on 5 November 2026 no public REST trading API from MetaQuotes for retail accounts was found. A trader's official routes are MQL5 programs inside the terminal, the MetaTrader5 Python package beside a local terminal and, since build 6060 (23 July 2026), the terminal's MCP server for AI clients; the Manager, Web, Gateway, Server and Report APIs belong to brokers running the platform. The REST wrappers checked here still run on a logged-in terminal.

Search for MT5 API or MetaTrader API and you get wrappers, broker pages and server tools that each describe something different; this page sorts them out. Official pages were read on 5 November 2026. The Python package was installed and probed on Windows; the MetaTrader 5 terminal and MQL5 could not be run here and no broker account was used, so nothing was compiled and no order was placed.

If your bridge starts at TradingView: its [Terms of Use](https://www.tradingview.com/policies/) (section 3, read 5 November 2026) license alerts and webhooks for display use only and prohibit automated trading use, including through third-party products. Read them and take legal advice.

## What does MT5 API mean? Six things with one name

The name covers six products with different owners, hosts and credentials, so first find out which one a page or a quote is describing.

**What people mean by MT5 API, as read on 5 November 2026**

| What it is | Who it is for | Where it runs | Places trades? | Public documents? |
| --- | --- | --- | --- | --- |
| MQL5 programs: Expert Advisors and scripts | Traders and their developers | Inside the terminal | Yes | Yes, the MQL5 reference |
| MetaTrader5 Python package | Traders and their developers | Beside a terminal on the same Windows machine | Yes, `order_send` | Yes, the MQL5 reference |
| Terminal MCP server, new in build 6060 (23 July 2026) | AI agents and other MCP clients, set up by the trader | Inside the terminal, on an address such as 127.0.0.1 | Yes, `trade_send_market_order` and others | Yes, MetaTrader 5 help |
| Manager, Web, Server, Gateway and Report APIs | Brokers running the platform | Broker's side | Not verified | Purposes only; details behind a login |
| A broker's own API | That broker's clients | That broker | Depends on the broker | Depends on the broker |
| Third-party REST wrappers and hosted gateways | Anyone who wants HTTP | Usually a Windows terminal somewhere | Depends on the product | The vendor's own |

Most confusion comes from mixing these rows. Hands-on use of the package is in [MT5 Python](https://fincodelabs.com/en/blog/metatrader-5-python).

## Is there an official MT5 REST API for traders?

None was found on 5 November 2026: MetaQuotes' public pages describe no REST trading API for retail accounts, though the terminal now has an HTTP interface of another kind, and absence from those pages proves nothing.

What was checked: the MQL5 reference (network functions and Python integration), MetaTrader 5's page for brokers, and MetaQuotes' support site. MetaQuotes is also not the party holding your account: the MQL5 site's footer says it is not a broker and has no real trading accounts. Your account sits on your broker's server, and the terminal is the client.

The Python package shows the design. It looks like an API, but it has no address to call:

```python
import MetaTrader5 as mt5

print(mt5.__version__)
print("before initialize:", mt5.positions_get(), mt5.last_error())
print("initialize:", mt5.initialize(), mt5.last_error())
print("names with key or url:", [n for n in dir(mt5) if "key" in n.lower() or "url" in n.lower()])
```

Output on Windows with no terminal installed, package from PyPI, 5 November 2026:

```
5.0.6231
before initialize: None (-10004, 'No IPC connection')
initialize: False (-10003, 'IPC initialize failed, MetaTrader 5 x64 not found')
names with key or url: []
```

The package failed at once because it looks for a local terminal, not for a server. It has no URL or key setting. The WebTerminal in MetaQuotes' site menus is an application for people, not a documented API.

**The MCP server is the new exception.** MetaTrader 5's [release notes](https://www.metatrader5.com/en/releasenotes) date native Model Context Protocol support to build 6060, 23 July 2026. Its help pages, read 5 November 2026, describe a terminal server that listens on an address such as `http://127.0.0.1:22346/mcp`, takes a bearer token generated under Tools, Options, MCP, and offers tools such as `trade_send_market_order`, `get_trading_open_positions` and `get_chart_history`. A separate marketdata server sits at `https://www.metatrader.com/mcp`; it answered HTTP 401 to a request without a token that day. This is a protocol written for AI agents, not REST: the terminal must be running, the help says the tool list keeps growing, and it was not tested here.

## MT5 Manager API, Web API and Gateway API are broker tools

These five interfaces extend the broker's platform; MetaTrader 5's page for brokers lists them for running a brokerage.

**Purposes as stated on MetaTrader 5's page for brokers, read 5 November 2026**

| API | Stated purpose |
| --- | --- |
| Manager API | Custom administration and management utilities, or your own manager terminal |
| Web API | Integrating the platform with web resources and other company services |
| Gateway API | Integration with other trading systems and custom data feeds |
| Server API | Adding functions to the trade and history servers |
| Report API | Expanding the reports trade servers produce |

The detailed documents could not be read. On 5 November 2026 `support.metaquotes.net/en/docs/mt5/api` and every page tried under it redirected to a login page, for a plain and a browser-like request; no account was used. So this guide states nothing about their endpoints, authentication or limits.

**MT5 API cost:** no public price list for these interfaces was found; the broker page names three license types (Entry, Standard and Enterprise) without prices and asks you to order the platform. If you are a trader, they are not your route, even when a listing uses the same words. This is also where the MT5 web API query usually ends: a web server of yours can call a broker's Web API only with access the broker grants.

## What is an MT5 bridge?

The word has two unrelated meanings: a broker-side link to liquidity, and a trader-side link from an outside program to a terminal.

**Two meanings of MT5 bridge**

| Aspect | Liquidity bridge | Retail bridge |
| --- | --- | --- |
| Connects | A broker's MT5 server and its liquidity providers or exchanges | TradingView, Python or another program and one terminal |
| Used by | Brokers | Traders and their developers |
| MetaQuotes' term | Gateway: its page describes gateways for exchanges and ECNs and for brokers hedging risk | None; it is market usage |
| Built on | Gateway API or a ready gateway | WebRequest, sockets or the Python package |
| Risk to you | The broker's concern | Yours: duplicates, stale orders, a closed terminal |

The retail kind has its own failure modes, which [TradingView to MT5](https://fincodelabs.com/en/blog/tradingview-to-mt5) covers. If a seller says bridge, ask which side of the terminal it sits on. For direct broker connectivity outside MT5, compare [REST, WebSocket and FIX](https://fincodelabs.com/en/blog/broker-api-integration-fix-rest).

## MT5 API key: what exists and what it opens

Classic MT5 access uses account credentials rather than API keys; the one key MetaQuotes documents for reaching a terminal is the MCP token, so ask exactly what any key you are given opens.

**Credentials per route, from official pages read 5 November 2026**

| Route | What it uses | What that allows |
| --- | --- | --- |
| MQL5 program | The terminal's logged-in account | Trades only if automated trading is allowed |
| Python package | A saved account, or `login`, `password`, `server` | What that password allows |
| Master password | Account login | Full rights for working with the account |
| Investor password | Account login | See the account and analyze prices; no trading |
| MCP API key | A token generated in the terminal's MCP settings | That terminal's MCP tools, as your settings allow; the help's tool list includes trading and shell tools, so guard it like a password |
| Wrapper's own key | A key the wrapper issues | Access to that wrapper, not a broker-issued scope |

On exchanges you can often create a key limited to reading and trading (see [API key security](https://fincodelabs.com/en/blog/api-key-security-trading-bots)). MT5's help describes master and investor access and mentions money and trader passwords without defining them, so ask your broker what those allow.

> **Why a hosted service changes the risk.** A hosted gateway has to log in to your account for you, and a service that places trades cannot do that with an investor password. That usually means giving a third party a password with full rights on the account. Ask the provider before you do:
>
> - Where does the password live, who can read it and how is it removed?
> - Can it work with less than the master password for your use?
> - What happens to open orders when its terminal restarts?
> - Does your broker's agreement allow this, including logins from another machine?

A read-only dashboard is different: the investor password fits it, and it cannot trade. Never put any of these in a webhook message or a URL.

## REST wrappers and hosted gateways: what they add and still need

They add HTTP, JSON and access from any operating system. The wrappers checked here still depend on a logged-in terminal running somewhere, usually on Windows; some hosted services advertise trading without a running terminal, which could not be checked.

One open-source example, named as evidence and not as a recommendation, is `mt5api` 1.0.6 on PyPI (23 October 2026, MIT). Its description says the server must run on Windows with a logged-in terminal, HTTP clients can be on any system, API key auth is optional, and it validates trade requests but has no live order-send endpoint. So a REST wrapper is not automatically a trading API: read its route list.

**Questions for any wrapper or hosted gateway; no product is ranked here**

| Question | Why it matters |
| --- | --- |
| Whose machine runs the terminal? | Decides who holds the password and who restarts it |
| Can it send orders, or only read and validate? | Some cannot trade at all |
| How does it report an order whose result is unknown? | A timeout must not become a second order |
| How does it read state after a restart? | The terminal is polled, and nothing replays missed events |
| Filling modes, netting and hedging? | Return code 10030 and wrong closes still apply |
| Which broker terms apply? | Automation limits come from your broker |

Building your own is usually a thin service on a Windows machine around the same 32 functions, with authentication you own. Treat it like any other service: [trading bot development](https://fincodelabs.com/en/blog/trading-bot-development) covers the surrounding parts.

## Which MT5 route fits your project?

Start from the job, because the route follows from where the code must run and whose account it touches.

**Route by goal**

| Goal | Route | Next step |
| --- | --- | --- |
| Automate your rules with no outside server | MQL5 Expert Advisor | [MQL5 developer checklist](https://fincodelabs.com/en/blog/mql5-developer) |
| Analyze data or send orders from Python | MetaTrader5 package on Windows | [MT5 Python](https://fincodelabs.com/en/blog/metatrader-5-python) |
| Act on chart alerts | Receiver, queue and a terminal-side collector | [TradingView to MT5](https://fincodelabs.com/en/blog/tradingview-to-mt5) |
| Let an AI agent work with your terminal | Terminal MCP server | Read its settings; MetaTrader's help says you alone answer for AI-assisted actions and any losses |
| Serve many clients' accounts | Broker-side access or a contract with the broker | Legal advice first: acting for others can be licensed activity |
| Run a brokerage | Manager, Web and Gateway APIs | MetaQuotes |

Costs follow the route. The Python package is MIT-licensed and the terminal is a public download, so the spend is development, a Windows host and your broker's charges; hosted services set their own prices, which are not compared here. Broker terms may restrict automation, so read yours. Leveraged forex carries high risk, and automated orders can lose money quickly. Rules depend on your country, account types and API access vary by broker, and no broker is recommended, ranked or linked with a referral here.

For readers in Turkey: the Capital Markets Board (SPK) [said on 23 February 2023](https://spk.gov.tr/duyurular/basin-duyurulari/2023/izinsiz-kaldiracli-islemlere-iliskin-basin-duyurusu) that residents may carry out leveraged FX trades only through firms it has authorized. Offering such trades without authorization is a crime carrying two to five years in prison and a judicial fine, and SPK can order access blocked to sites offering leveraged trades abroad to residents ([Law No. 6362](https://www.mevzuat.gov.tr/mevzuatmetin/1.5.6362.pdf) Articles 99(4) and 109(2)).

For integration work in general, see [exchange API integration](https://fincodelabs.com/en/services/exchange-api-integration); naming MetaTrader 5 here does not mean Fincode integrates it or has built on it.

## Frequently asked questions

### Does MetaTrader 5 have a REST API?

No public REST trading API from MetaQuotes for retail accounts was found on 5 November 2026. Web API is a broker-side interface, the terminal's MCP server is for AI clients, and the third-party REST wrappers checked still run on a terminal.

### Where is the MT5 API documentation?

The MQL5 reference on mql5.com covers MQL5 and the Python package publicly, and MetaTrader 5 help covers the MCP server. MetaQuotes' API documents for brokers redirected to a login page when read on 5 November 2026.

### How much does the MT5 API cost?

The Python package is MIT-licensed and the terminal is a public download. No public price for the broker-side APIs was found on 5 November 2026, and hosted services set their own prices.

### Where do I get an MT5 API key?

MQL5 and the Python package have none: they use the account login and password, or a terminal already logged in. Since build 6060 the terminal's MCP settings can generate a token for its MCP server. A key from a wrapper opens that wrapper, not your broker account.

### Can I use the MT5 API from Linux?

The Python package has Windows wheels only, so a Linux application normally calls a service on a Windows machine that runs the terminal. MetaQuotes documents running the terminal itself under Wine.

## Sources

- [MetaTrader 5 for brokers: purposes of the Report, Server, Gateway, Manager and Web APIs](https://www.metatrader5.com/en/brokers)
- [MQL5 Reference: Python Integration](https://www.mql5.com/en/docs/python_metatrader5)
- [MetaTrader 5 Help: MCP Servers and AI Assistant (user responsibility for AI-assisted actions)](https://www.metatrader5.com/en/terminal/help/mcp_and_ai)
- [MetaTrader 5 Help: MCP and AI, configuration (address, API key, servers)](https://www.metatrader5.com/en/terminal/help/mcp_and_ai/configuration)
- [MetaTrader 5 Help: MCP and AI, capabilities (tool list)](https://www.metatrader5.com/en/terminal/help/mcp_and_ai/capabilities)
- [MQL5 Reference: initialize (login, password, server)](https://www.mql5.com/en/docs/python_metatrader5/mt5initialize_py)
- [MQL5 Reference: Network functions](https://www.mql5.com/en/docs/network)
- [MQL5 Reference: Trade Permission](https://www.mql5.com/en/docs/runtime/tradepermission)
- [MetaTrader 5 Help: Connect to an account (master and investor access)](https://www.metatrader5.com/en/terminal/help/startworking/authorization)
- [MetaTrader 5 Help: How to install the platform on Linux](https://www.metatrader5.com/en/terminal/help/start_advanced/install_linux)
- [PyPI: MetaTrader5 5.0.6231](https://pypi.org/project/MetaTrader5/)
- [PyPI: mt5api 1.0.6 (third-party REST wrapper, named as evidence only)](https://pypi.org/project/mt5api/)
- [SPK: Press notice on unauthorized leveraged trading, 23 February 2023 (Turkish)](https://spk.gov.tr/duyurular/basin-duyurulari/2023/izinsiz-kaldiracli-islemlere-iliskin-basin-duyurusu)
- [Capital Markets Law No. 6362, Articles 99 and 109 (Turkish, consolidated text)](https://www.mevzuat.gov.tr/mevzuatmetin/1.5.6362.pdf)
- [TradingView: Terms of Use, section 3 (display-only use, non-display prohibitions)](https://www.tradingview.com/policies/)

> This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the [editorial policy](https://fincodelabs.com/en/editorial-policy).

---

Published by Fincode (Fincode Yazılım ve Teknoloji A.Ş.), a software company in Istanbul, Turkey: https://fincodelabs.com/en/blog/mt5-api

Cite as: Fincode, "MT5 API: what MetaQuotes offers and what third parties add", updated November 6, 2026, https://fincodelabs.com/en/blog/mt5-api
