MetaTrader API — Help Center
Search or browse the categories on the left to find answers. Each question has its own shareable URL.
Search or browse the categories on the left to find answers. Each question has its own shareable URL.
MetaTrader API is a hosted REST API service that lets you interact with MT4 and MT5 trading accounts programmatically — without keeping a MetaTrader terminal open on your computer.
You connect your trading account once, and from that point on you can execute trades, retrieve account data, and read market prices from any programming language using standard HTTP requests.
For full technical details, see the official documentation.
Getting started takes under 30 minutes:
/RegisterAccount API endpoint.See the step-by-step guide in the Authentication docs.
Any language capable of making HTTP requests works with the MetaTrader API. Because it is a plain REST API over HTTPS, you can use Python, JavaScript/Node.js, Go, C#, Java, Ruby, PHP, or any other language.
It also works with no-code tools like Postman, Make (Integromat), n8n, Zapier, or anything that can call an HTTP endpoint.
Yes. The API supports both MetaTrader 4 (MT4) and MetaTrader 5 (MT5) accounts. You can connect and manage accounts from both platforms simultaneously, depending on your subscription plan.
MT4 and MT5 have some differences in their available API endpoints (e.g. MT5 has more order types and history options). See the documentation for the full endpoint reference per platform.
No. That is the core purpose of this service. MetaTrader API runs entirely server-side. You connect your broker credentials once, and the API maintains the connection to the broker on your behalf.
You do not need to install MetaTrader, keep a terminal running, or write any MQL Expert Advisors.
Authentication works differently depending on your plan:
Use your API key in the x-api-key header, and pass the account UUID as the id (or accountId) query parameter:
curl -X GET "https://api.metatraderapi.net/AccountSummary?id=YOUR_ACCOUNT_UUID" \
-H "x-api-key: YOUR_API_KEY"
You find your API key in the Settings tab of your dashboard.
Pro plan users receive a dedicated base URL along with a username and password. All requests are authenticated via Basic Auth:
Authorization: Basic BASE64_ENCODED(USERNAME:PASSWORD)
Your API key is in the Settings tab of the dashboard at app.metatraderapi.net.
Best practice: store it as an environment variable (e.g. MTAPI_KEY) and inject it at runtime.
You can connect accounts in two ways:
Log in at app.metatraderapi.net, go to the Accounts section, and add your MT4/MT5 credentials (login ID, password, broker server name). Once connected, you receive a unique UUID for that account.
Use the /RegisterAccount endpoint. The exact parameters and response format are in the API documentation.
BrokerName-Live or BrokerName-Demo.Use the /CheckConnect endpoint. It checks the connection status for the given account UUID and will attempt to reconnect automatically if the connection was lost.
For details on the request format and response values, see the documentation.
Use the /DeleteAccount endpoint to disconnect and remove a connected trading account. You can also list all currently connected accounts with the /GetAccounts endpoint.
See the API documentation for request parameters.
It depends on your plan:
The API covers the full trading lifecycle:
For full endpoint details, parameters, and response formats, see the API documentation.
Use the /OrderSend endpoint. You specify the symbol, operation type (Buy, Sell, Buy Limit, etc.), volume, and optionally stop loss, take profit, and a comment.
MT4 and MT5 have slightly different /OrderSend parameters — MT5 supports additional fields like expirationType and stopLimitPrice.
Use the /OrderHistory or /OrderHistoryPagination endpoints. You can filter by date range, ticket number, and sort order. MT5 also offers /PendingOrderHistory and /HistoryDealsByPositionId for more granular queries.
Full parameter reference is in the documentation.
Yes. The API provides a WebSocket (events) connection for real-time streaming. This allows you to receive live updates instead of repeatedly polling REST endpoints.
Through the WebSocket stream you can receive live market quotes and, for MT4, asynchronous responses to certain requests like price history.
For live bid/ask prices you can use the REST endpoint /GetQuote (or /GetQuoteMany for multiple symbols), or subscribe to quotes via the WebSocket stream for continuous real-time updates.
The /GetQuote endpoint accepts a msNotOlder parameter that controls whether the API waits for a fresh tick or returns the last known tick.
For historical OHLC candle data, use /QuoteHistory (MT4) or /PriceHistory (MT5) — see the documentation for timeframe options and parameters.
Three active plans are available (prices shown excl. VAT):
An Annual plan is also available, saving up to 25% depending on the plan. All prices are confirmed on the pricing page.
No. We do not currently offer a free trial. For questions about evaluating the API, contact us by Telegram or email [email protected].
If a trial is ever agreed individually, the Terms require cancellation to be sent by email to [email protected] before the trial expires — the purchase timestamp is the reference time, and an email is still required even if a payment has already been processed.
Yes. On the Single Account plan you get one connection per 30 days included. If you need more accounts, each additional account is billed at €10 per account per month, charged automatically at the end of each billing cycle.
If you need many accounts, upgrading to a Pro plan (unlimited accounts*) is more cost-effective at around 50+ accounts.
Payment is processed through Stripe. Accepted methods include credit/debit cards, crypto, and bank transfer.
By placing an order you also accept the Stripe Services Agreement.
Yes, you can cancel at any time. Cancellations take effect at the end of the current 30-day billing cycle — there are no partial refunds for unused days.
To cancel during a trial: send an email to [email protected] before the trial expires. If payment has already been charged, an email cancellation is still required to stop the subscription.
The service is operated by Apex Vanguard Dynamics LLC, a Limited Liability Company registered in the United States, with registered address at 30 N Gould St Ste R, Sheridan, WY 82801, United States.
Contact email: [email protected] · Phone: +1 (929) 333-6422
For legal details, see the Imprint.
The Terms and Conditions are governed by the laws of the State of Wyoming, United States. Any disputes are subject to the exclusive jurisdiction of the courts in Wyoming, and both parties agree to attempt resolution through good-faith negotiation first.
You can read the full Terms and Conditions on the website.
No. The Terms of Service explicitly require that you keep your login credentials and API keys confidential and must not share them with third parties without prior written consent from MetaTrader API.
If you are building a product or service on top of the API (e.g. for your own clients), you should build your own authentication layer and keep the MetaTrader API key server-side only — never expose it to end users.
No. The Terms of Service prohibit scraping or reselling data from the service without explicit written permission from MetaTrader API. Subscriptions are also non-transferable.
If you have a specific business case, contact [email protected].
Yes. NDAs are available upon request and must be mutually agreed upon in writing. Standard NDA terms apply unless otherwise negotiated.
Contact [email protected] to request one.
MetaTrader API advertises several security measures:
For more detail on security practices, see the Privacy Policy.
MetaTrader API is operated by a US company (see Who operates MetaTrader API?), and states that it complies with applicable data protection law, including the GDPR where it applies to users in the EU/EEA.
What personal data is collected: account information (name, email, billing details), usage data (API logs, IP address, browser/OS), and payment information processed through Stripe.
The company states it does not sell or share personal data with third parties. Full details are in the Privacy Policy.
According to the Privacy Policy, the following data may be collected:
Data may be processed within the EEA or in other countries with adequate data protection standards (given the 11 global data centers).
Read the full Privacy Policy for complete information.
The most common reasons a connection fails:
ICMarkets-Live02). Find it in MetaTrader under File → Open an Account.Use the /CheckConnect endpoint to verify the current connection status. If the problem persists, contact [email protected].
Authentication errors typically mean your API key is missing, wrong, or being sent in the incorrect format. Check the following:
x-api-key header — not Authorization: Bearer.api.metatraderapi.net base URL).See the Authentication documentation for the correct formats for each plan type.
MetaTrader API advertises 99.95% uptime across its 11 global data centers, with an average response time of around 47ms.
Note that per the Terms of Service, the service is provided "as is" and "as available" — uninterrupted or error-free operation is not formally guaranteed by contract. For production systems, always implement proper retry logic and error handling on your side.
Trade rejections come from the broker's trading server, not from the MetaTrader API itself. Common causes include:
EURUSD vs EURUSDm).Check the error response from the API — it will include a message and code field from the broker explaining the rejection reason.