Building with fxapis

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.

Updated 2 min readLeer en español
On this page
  1. Postman: try every endpoint by hand
  2. TradingView alerts
  3. n8n: automations on a canvas
  4. The rules every template follows
  5. Where to go next

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.

  1. In Postman, choose Import and select the file.
  2. Open the collection's Variables and set apiKey to your key. Fill in accountId and the other ids as you go.
  3. 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

— Software architect and AI engineer with more than 15 years of building and scaling software systems. Designs and builds production-grade software and AI systems, and writes about how it's done.

elwizard.netGitHubInstagram

FAQ

Questions people also ask

Can n8n place MT5 trades?

Yes, through the fxapis REST API. The templates use n8n's HTTP Request node with an Idempotency-Key on every order: one turns an incoming webhook into a market order, the other closes an account's positions every weekday at 21:00 UTC. Try them on a demo account first.

Is there an official n8n node for fxapis?

Not yet. The templates use n8n's built-in HTTP Request node to call the REST API directly, with the API key read from an environment variable.

Does the Postman collection stay up to date?

It is generated from the live OpenAPI spec, and node postman/generate.mjs regenerates it whenever the API changes.

All in this topic
> 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.