Choosing an API

How to Choose an MT5 API: A Developer's Checklist

Twelve questions to ask before you build on an MT5 API: platforms, order types, hosting, errors, retries, multi-account trading, security, pricing and docs.

The fxapis team3 min read

In short

  • Start with fit: which platforms, order types and account counts you need, and where your code will run.
  • Then reliability: what happens when a request times out, and whether a retry can ever place a second trade.
  • Then trust: how broker passwords are stored, how keys are scoped, and whether you can audit every order.
  • Last, cost and docs — and check every claim on a demo account before you commit.
On this page
  1. Fit
  2. Reliability
  3. Trust
  4. Cost and docs
  5. Then test it
  6. Next steps

MT5 APIs look alike from their homepages: connect an account, place a trade. The differences show up later — at the first timeout, the fiftieth account, the first support ticket. Use these questions to compare providers on what your product will actually need, and test the answers on a demo account.

We make one of these APIs, so we have said where fxapis stands on each point, including where it falls short.

Fit

1. Which platforms does it support? MetaTrader 5 only, MT4 only, or both? If you need both, that settles a lot quickly. fxapis: MetaTrader 5 only.

2. Which order types? Market orders at least; pending orders (limit, stop, stop limit) if you trade levels; partial closes and stop changes for managing positions. fxapis: market and pending orders, partial closes, stop changes, and a margin and profit calculator.

3. Where does MetaTrader run, and where does your code run? Some APIs need a terminal or an Expert Advisor on your side; hosted ones run it for you. Check which operating systems and languages your code can use. fxapis: hosted in the EU; any language with HTTPS.

4. How many accounts, and how at once? Count the accounts you will connect, and whether one decision must reach many of them at the same moment. fxapis: up to 500 accounts on Enterprise; one multi-account order places a trade on many accounts and reports a result for each.

Reliability

5. What happens when a request times out? This is the question that separates APIs. A timed-out order may or may not have executed. Ask whether the API tells you which, and how. fxapis: an order whose outcome is unclear is marked unknown, confirmed against the broker's records, and moved to what actually happened — never guessed.

6. Can a retry place a second trade? Look for idempotency keys on every order-opening and closing request. fxapis: an Idempotency-Key on market orders, pending orders, closes and multi-account orders, honoured for 24 hours.

7. Are errors specific? You want stable codes you can branch on, the broker's own return code, and a clear "safe to retry" signal. fxapis: stable error codes, the MT5 retcode on every order, and a retryable flag on rejections.

8. How do you get updates? Streaming, webhooks or polling, and for which events? fxapis: polling. There are no outbound webhooks for account or trade events yet, and no price streaming.

Trust

9. How are broker passwords handled? Encrypted, never returned, erased on disconnect, every use audited? fxapis: all four, with a key unique to each account.

10. How are API keys scoped? A risk tool should be able to close positions without being able to open them. fxapis: per-key scopes, including reduce-only keys.

Cost and docs

11. What does it cost at your volume? Price per account, per order, per hour connected? What happens past the allowance — are closes ever blocked? fxapis: monthly plans by accounts and orders; closing is never refused for billing. See pricing.

12. Can you build from the docs alone? An OpenAPI specification, runnable examples in your language, and guides for the hard parts — not only an endpoint list. fxapis: an OpenAPI 3.1 spec, samples in 13 languages per endpoint, and guides.

Then test it

Every answer above is a claim until you see it. On a broker demo account, connect, place an order, close it, and then break things on purpose: a closed market, a double send, a wrong password. How an API behaves when things go wrong is most of what you are choosing. See testing an MT5 API without risking real money.

Next steps

FAQ

Questions people also ask

What should I look for in an MT5 API?

Platform support (MT5, MT4), the order types you need, how accounts are connected and hosted, how errors and timeouts are reported, whether retries are safe, multi-account support, credential security, pricing at your volume, and documentation you can build from.

Does fxapis support MT4?

No. fxapis supports MetaTrader 5 only.

Does fxapis stream prices?

No. fxapis covers accounts, orders, positions and trade history. It does not stream prices or serve bars and ticks, and it has no outbound webhooks for account or trade events yet; you poll.

How do I compare fxapis with MetaApi?

The fxapis vs MetaApi page compares the two on hosting, pricing, order handling and features, and the migration guide maps MetaApi concepts to fxapis calls.

All articles
> Connect. Execute. Scale.

Trade MT5 from your own code.

Connect accounts by login, password and server, and place orders over HTTPS. We run MetaTrader 5; you install nothing.