Docs

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

MetaApifxapis
PlatformsMetaTrader 4 and 5MetaTrader 5 only
InterfacesREST, WebSocket streaming, SDKs (Node.js, Python, Java)REST (plain HTTPS, any language), plus TypeScript and Python SDKs
Account lifecycleCreate, then deploy / undeployConnect, then a mode decides when it is online
Real-time updatesStreaming connection with synchronization listenersWebhooks for orders, positions and account state (guide); no streaming
Trade copyingCopyFactory productManaged copy trading, or multi-account orders to build your own
Order identityclientId on a tradeclientOrderId, plus an Idempotency-Key header: a retry returns the first answer
An order whose answer was lostSee MetaApi's docsReported as ORDER_UNRESOLVED, then confirmed against the broker's records
Market dataQuotes, candles, ticksNot 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 modeBehaves like
always_onAn account that is always deployed.
warm_on_demandDeployed automatically when you place an order or prepare it; undeployed automatically after 15 idle minutes.
coldDeploy 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:

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 its retcode), and ORDER_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", never 0.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

MetaApifxapis
POST /users/current/accounts (provisioning)POST /v1/accounts
POST …/accounts/:id/deployPOST /v1/accounts/{id}/warm, or a mode that does it for you
POST …/accounts/:id/undeployPOST /v1/accounts/{id}/cool
Removing an accountPOST /v1/accounts/{id}/disconnect — erases the password, keeps the history; or DELETE /v1/accounts/{id} — removes the account and its history
waitConnected() / waitSynchronized(), connectionStatusPoll 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_SELLPOST /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_MODIFYPOST /v1/accounts/{id}/positions/{ticket}/modify
POSITION_CLOSE_IDPOST /v1/accounts/{id}/positions/{ticket}/close
POSITION_PARTIALThe same close, with volume
ORDER_MODIFYPOST /v1/orders/{id}/modify
ORDER_CANCELPOST /v1/orders/{id}/cancel
POSITIONS_CLOSE_SYMBOL, POSITION_CLOSE_BYNo single call — close each position
GET …/accounts/:id/positionsGET /v1/accounts/{id}/positions
GET …/history-deals/time/:start/:endGET /v1/accounts/{id}/deals?since=…&until=…
History ordersGET /v1/orders?accountId=…
Margin calculationPOST /v1/accounts/{id}/calculate
clientId on a tradeclientOrderId, plus an Idempotency-Key header
CopyFactory strategies and subscriptionsManaged 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:

fxapis facts on this page are from our own API reference and measurements.

On this page