n8n and Postman Templates for the MT5 API
Explore the fxapis MT5 API in Postman and automate MT5 trades with n8n workflows: ready-made templates from fxapis-integrations, with demo accounts first.
On this page
Not everything that talks to MetaTrader 5 needs a program. fxapis-integrations collects the low-code ways in: a Postman collection for exploring the API, and n8n workflows for automations you would rather build on a canvas — plus TradingView alert messages, which have their own post.
Postman: try every endpoint by hand
postman/fxapis.postman_collection.json is a Postman collection covering every public endpoint — connecting accounts, bringing them online, market and pending orders, positions, history and multi-account orders — with a ready-to-send example body on every request that takes one. It is generated from the live API spec, one folder per section of the API.
- In Postman, choose Import and select the file.
- Open the collection's Variables and set
apiKeyto your key. Fill inaccountIdand the other ids as you go. - Send Connect an MT5 account with a demo login, then Bring an account online, then poll its status.
The collection's pre-request script gives every POST and PATCH a fresh Idempotency-Key, so clicking Send twice on an order cannot open two positions. If the API changes, node postman/generate.mjs regenerates the collection from the live spec.
TradingView alerts
The repository also has ready-to-paste TradingView alert messages for indicators, strategies and plain text. They work with a TradingView hook from the console, with no code at all; TradingView to MT5: EA bridge vs hosted API shows the message format and what to check, and the TradingView guide has the full field reference.
n8n: automations on a canvas
fxapis has no official n8n node yet, so the two templates in n8n/ use n8n's built-in HTTP Request node:
- TradingView webhook to market order — receives an alert-shaped body, places a market order, and responds with the result.
- Scheduled flat-all — every weekday at 21:00 UTC, lists an account's positions and closes each one.
Import either file from Workflows → Import from File. The API key is read from an environment variable ($env.FXAPIS_API_KEY), so it never lives inside the workflow JSON; the n8n notes cover instances where environment access is switched off.
The rules every template follows
- An idempotency key on every order — the Postman script and the n8n templates send
Idempotency-Key. - Volumes and prices are strings, and stops and targets are absolute prices, not pips.
- The hook URL and the API key are credentials. Keep them out of anything you commit, screenshot or share.
- Demo accounts first.
fx_test_is a label, not a sandbox.
Where to go next
- TradingView alerts to MT5 on the website, and the TradingView guide in the docs.
- The API reference — the same requests as the Postman collection, with samples in 13 languages.
- Runnable examples when you are ready to write code.