Call MT5 from n8n without an Expert Advisor
How the fxapis n8n templates call the REST API with the HTTP Request node. They do not require a local terminal or EA. n8n Cloud was not separately certified in this guide.
n8n workflows that talk to MetaTrader 5 often assume a custom polling Expert Advisor and a machine that stays on. fxapis replaces that bridge with HTTPS. The templates in fxapis-integrations use n8n's built-in HTTP Request node. There is no official n8n node.
This guide describes those templates. It does not claim a separate test on n8n Cloud. If Cloud blocks an environment variable or a header the template uses, that is a Cloud limit, not proof the API refused the call. Self-hosted n8n can set FXAPIS_KEY in the environment and send it as Authorization: Bearer ….
Start with a read, not an order.
- Create a key with
accounts:readandtrading:readonly. - Connect a broker demo account and bring it online.
- HTTP Request:
GET https://api.fxapis.com/v1/accountswith that header. - HTTP Request:
GET https://api.fxapis.com/v1/accounts/{{accountId}}/positions.
A write needs trading:execute and one Idempotency-Key you store on the n8n item and reuse if the node retries. A new key is a new order. n8n's default retry with a freshly generated UUID will place a second order. See Idempotency.
The account must be online before the order node runs. Poll GET /v1/accounts/{id}/status until state is ready, or the order returns 409 ACCOUNT_NOT_READY and nothing was sent.
Related: Webhooks, TradingView, and the n8n and Postman article.
Read MT5 quotes and recent candles over REST
What fxapis market data is, and is not: a REST poll of the account's broker quotes, and up to 1,000 recent candles from that terminal. No tick history, no deep archive, no WebSocket stream.
Connect MT5 accounts by login, password and server
How to connect a MetaTrader 5 account to the fxapis API: finding the exact server name, trading versus investor password, two-factor sign-in, handling credentials safely in your app, checking them immediately, needs-attention states, and disconnecting.