Skip to main content
Developers

Trade from your own code, or with an AI agent

The JAFX Trading API gives your programs access to your own JAFX trading account: live prices, account data and order execution, through the same broker routing as the web terminal. AI assistants connect through the JAFX MCP server, with the same keys and the same limits.

What you can build

  • Trading bots that read prices and candles, open and manage positions, and react to fills as they happen.
  • Dashboards and journals built on your balance, equity, open positions and closed trades.
  • AI assistants that analyse the market and your account, and propose trades you confirm with one click.
  • Bots from another platform. Strategy tags, idempotent orders and a separate budget for stop changes keep the habits of an existing bot (porting notes).

How it works

Your programA bot, a script or an AI agent holding an API key.
→
JAFX APIChecks the key, its scopes and its limits, and records every order.
→
JAFX trading platformRoutes and executes the order exactly as it does for the web terminal.

Each key belongs to one trading account and can only act on that account. Market data comes from the central JAFX quote board. Orders are decided by the broker at your account's own prices.

Safety built in

  • Scoped keys. Read-only, trading or proposals: give each program only what it needs. See API keys & security.
  • Limits enforced by the server. Volume per order, open positions, orders per minute and a daily loss stop apply whatever your code, or an AI, sends. See Limits.
  • Proposals. An agent can prepare trades that execute only after you confirm them in the web terminal.
  • No double trades. Every write carries an Idempotency-Key, so a retry never trades twice. See Idempotency.
  • Fast revocation. Revoke a key in the web terminal and it stops working within 5 seconds, open streams included.

Availability

Every JAFX Terminal account on the Live Server or the Demo Server can create keys, in the web terminal under Developers. Build and test with virtual money on a demo account first: demo orders go through the same routing as live. Live keys start with tight limits and confirm mode on; you set each key's limits when you create it.

Start here

  1. Quickstart: create a key and place your first demo order in about five minutes.
  2. Orders & positions: how orders, changes and closes work, and what each answer means.
  3. AI agents (MCP): connect your AI assistant in a couple of minutes.

Automated and AI-driven trading can lose money quickly; nothing in these docs is investment advice.

JAFX (PTY) LTD · FSCA FSP No. 52058 · Trading leveraged derivatives with JAFX carries a high risk of losing money rapidly. It is not suitable for everyone.