Migrating from MetaApi to fxapis
A concept-by-concept guide for moving an MT5 integration from MetaApi to fxapis: provisioning and deploy versus connect and modes, RPC and streaming versus REST and polling, a table of equivalent calls, and what has no equivalent yet — streaming, MT4 and CopyFactory features.
This guide is for teams with an MT5 integration on MetaApi who are evaluating or planning a move to fxapis. It maps MetaApi's concepts to ours, lists equivalent calls, and is explicit about what fxapis does not have yet, so you can decide with the full picture.
The MetaApi details below come from its public documentation, read on 30 September 2026; see Sources. MetaApi changes over time — check its current docs for anything your decision depends on.
The short version
| MetaApi | fxapis | |
|---|---|---|
| Platforms | MetaTrader 4 and 5 | MetaTrader 5 only |
| Interfaces | REST, WebSocket streaming, SDKs (Node.js, Python, Java) | REST (plain HTTPS, any language), plus TypeScript and Python SDKs |
| Account lifecycle | Create, then deploy / undeploy | Connect, then a mode decides when it is online |
| Real-time updates | Streaming connection with synchronization listeners | Webhooks for orders, positions and account state (guide); no streaming |
| Trade copying | CopyFactory product | Managed copy trading, or multi-account orders to build your own |
| Order identity | clientId on a trade | clientOrderId, plus an Idempotency-Key header: a retry returns the first answer |
| An order whose answer was lost | See MetaApi's docs | Reported as ORDER_UNRESOLVED, then confirmed against the broker's records |
| Market data | Quotes, candles, ticks | Not provided |
If your product depends on streaming updates, MT4, market data or CopyFactory's portfolios, news filters or cross-workspace marketplace, fxapis does not replace them today. If it places orders on MT5 accounts — one at a time or across many — and needs a recorded result for every order, with an unclear one confirmed with the broker rather than guessed, read on.
Concepts
Provisioning and deploy → connect and modes
In MetaApi you create an account through the provisioning API
(POST /users/current/accounts with name, server, login, password,
platform, magic and options such as type, region and reliability),
then deploy it (POST …/deploy), which starts an API server and a trading
terminal for it, and undeploy it to stop them.
In fxapis you connect an account with
POST /v1/accounts — login,
server, password, and a mode. The mode replaces manual deploy/undeploy:
| fxapis mode | Behaves like |
|---|---|
always_on | An account that is always deployed. |
warm_on_demand | Deployed automatically when you place an order or prepare it; undeployed automatically after 15 idle minutes. |
cold | Deploy and undeploy yourself, with warm and cool. |
Coming online takes about ten seconds in our tests. MetaApi's waitConnected() and
waitSynchronized() correspond to polling
GET /v1/accounts/{id}/status
until state is ready. POST /v1/accounts/prepare
brings up to 200 accounts online in one call.
There is no magic field: fxapis tags each order's MT5 comment so it can match
the broker's record to your order, and gives you clientOrderId for your own
reference.
RPC and streaming connections → REST and polling
MetaApi offers an RPC connection (account.getRPCConnection()), which its
docs recommend for monitoring apps and simple trading apps, and a streaming
connection (account.getStreamingConnection()), recommended for trade
copiers and automated strategies, which keeps a synchronized local terminal
state and calls your listeners on every change.
fxapis has one interface: REST. What you would read from a streaming connection's terminal state you read with requests:
- Positions:
GET /v1/accounts/{id}/positions— a snapshot refreshed about every 15 seconds while the account is online, withobservedAton each row.POST /v1/accounts/{id}/reconcilerefreshes it immediately. - Deals:
GET /v1/accounts/{id}/deals, including deals not caused by your orders (stop-outs, swaps, deposits, manual trades). - Order outcomes: returned by the order call itself, and by
GET /v1/orders/{id}.
Code that reacts to onPositionUpdated or similar listeners moves to
webhooks: subscribe to position.opened and
position.closed, which arrive within about 15 seconds of the broker's
change. Code that reacts to onDealAdded still becomes a polling loop; the
copier guide shows one.
Trades
MetaApi places trades through one endpoint, POST …/trade, with an
actionType. fxapis has one endpoint per intent, and every order that opens or
closes exposure takes an Idempotency-Key:
- A retry with the same key returns the first answer instead of placing a second order, for 24 hours.
- Three failures are distinguished:
SEND_FAILED(never reached the broker — safe to retry),ORDER_REJECTED(the broker refused, with itsretcode), andORDER_UNRESOLVED(the answer was lost — do not resend; the order is confirmed against the broker's records and moves to what actually happened). - Volumes and prices are strings:
"0.01", never0.01.
See Idempotent MT5 orders and Trading.
CopyFactory → managed copy trading, or your own copier
CopyFactory is a complete copy-trading product: strategies and subscribers, per-subscription copy ratios, symbol mapping, risk filters (drawdown, equity curve, leverage), stop-outs and signal filtering, with very low internal copying latency per its docs.
fxapis has managed copy trading: mark an always-on, hedging account as a strategy and subscribe followers in the same workspace, and fxapis copies opens, closes, partial closes and stop moves server-side — with sizing, symbol mapping, risk limits and an executions log with a reason for every copy. It does not yet have CopyFactory's portfolios, equity-curve or news filters, or followers outside your own workspace.
If you would rather own the copying rules, the same execution building block
it is built on is yours to call —
multi-account orders, one trade sent to up to
1,000 accounts together (your plan sets how many per multi-account order), with per-account volumes, barrier policies and a
dispatch spread of about 30 ms across 100 accounts in our benchmark against an
instant broker — every multi-account order reports its own. The
appendix of the copy-trading guide
is a working starting point. Single orders can name an instrument and have
each broker's own symbol picked for them (Instruments);
multi-account orders accept instrument too, so mapping across brokers there
is handled the same way.
Equivalent calls
| MetaApi | fxapis |
|---|---|
POST /users/current/accounts (provisioning) | POST /v1/accounts |
POST …/accounts/:id/deploy | POST /v1/accounts/{id}/warm, or a mode that does it for you |
POST …/accounts/:id/undeploy | POST /v1/accounts/{id}/cool |
| Removing an account | POST /v1/accounts/{id}/disconnect — erases the password, keeps the history; or DELETE /v1/accounts/{id} — removes the account and its history |
waitConnected() / waitSynchronized(), connectionStatus | Poll GET /v1/accounts/{id}/status until ready |
getAccountInformation() (balance, equity, margin) | GET /v1/accounts/{id}/figures — the last read, or ?fresh=true |
getSymbolPrice() | GET /v1/accounts/{id}/quotes — polled, up to 20 symbols |
POST …/trade with ORDER_TYPE_BUY / ORDER_TYPE_SELL | POST /v1/accounts/{id}/orders/market with side |
ORDER_TYPE_BUY_LIMIT, …_STOP, …_STOP_LIMIT (and sells) | POST /v1/accounts/{id}/orders/pending with kind |
POSITION_MODIFY | POST /v1/accounts/{id}/positions/{ticket}/modify |
POSITION_CLOSE_ID | POST /v1/accounts/{id}/positions/{ticket}/close |
POSITION_PARTIAL | The same close, with volume |
ORDER_MODIFY | POST /v1/orders/{id}/modify |
ORDER_CANCEL | POST /v1/orders/{id}/cancel |
POSITIONS_CLOSE_SYMBOL, POSITION_CLOSE_BY | No single call — close each position |
GET …/accounts/:id/positions | GET /v1/accounts/{id}/positions |
GET …/history-deals/time/:start/:end | GET /v1/accounts/{id}/deals?since=…&until=… |
| History orders | GET /v1/orders?accountId=… |
| Margin calculation | POST /v1/accounts/{id}/calculate |
clientId on a trade | clientOrderId, plus an Idempotency-Key header |
| CopyFactory strategies and subscriptions | Managed copy trading: POST /v1/copy/strategies and /v1/copy/subscriptions |
No equivalent yet
Be sure none of these is load-bearing for you:
- Streaming. No WebSocket connection or synchronization listeners: poll, or subscribe to webhooks.
- MetaTrader 4. fxapis connects MT5 accounts only.
- Some CopyFactory features. Managed copy trading covers strategies, subscriptions, sizing, symbol mapping (for multi-account orders too, which accept
instrument), risk limits and stop-outs within one workspace. Not yet: portfolios, copying pending orders as pending orders, netting accounts, news and trading-hours filters, and followers in other workspaces. - Market data. Live bid and ask are polled per account
(
GET /v1/accounts/{id}/quotes); no tick stream or candles. - Demo account creation. fxapis does not open accounts at brokers; you connect existing ones.
A migration plan
Try it on a demo account
Create an fxapis key and run the Quickstart or a
language guide against a broker demo account. fx_test_ keys still
reach real brokers — they are a label, not a sandbox.
Map your lifecycle
Decide each account's mode. Accounts you kept deployed all the time become
always_on; accounts you deployed around trades become warm_on_demand, and
the deploy/undeploy code goes away.
Collect credentials again
Connecting an account to fxapis needs its login, trading password and
server name, sent to POST /v1/accounts from your backend. Plan how each user
re-enters their password, and check it straight away — see
Connect MT5 accounts.
Port order placement
Replace each actionType with its endpoint from the table above. Add an
Idempotency-Key to every market order, pending order and close, derived from
your own decision (for example signal + account), and handle
ORDER_UNRESOLVED by polling, never resending.
Replace listeners with polling
Turn streaming listeners into loops over positions and deals, with the interval
your product needs. Show users observedAt so they know how fresh a view is.
Switch accounts over one at a time
Avoid having both platforms placing orders on the same account at the same time: each would treat the other's trades as unexplained. Move an account, confirm its orders and history in fxapis, then remove it from the old setup.
Sources
MetaApi documentation, read on 30 September 2026:
- MetaApi — Provisioning API overview
- Create account, Deploy account, Undeploy account
- MetaApi — Client API overview (REST and WebSocket, MT4 and MT5, SDKs)
- Execute trade, Read positions, Read deals by time range
- JavaScript SDK — RPC API and Streaming API
- CopyFactory overview
fxapis facts on this page are from our own API reference and measurements.
Monitor MT5 trader accounts for prop-firm rules
Use deals, positions and order history from the fxapis MT5 API to check prop-firm rules such as daily loss and maximum drawdown on your side, with read-only and reduce-only API keys, and close every position on an account that breaches.
Authentication
Keys, admin keys, environments, scopes and rotation.