Conventions
Every endpoint of the fxapis API, generated from its OpenAPI description.
Each page in this section shows one endpoint: its parameters, its body, every response it can give, and a request in the language you choose. Send tries it against the live API with the key you enter. Every key reaches real brokers, so try it with a broker demo account.
| Base URL | https://api.fxapis.com |
| Authentication | Authorization: Bearer fx_live_… — see Authentication |
| Format | JSON in, JSON out; the payload is under data |
| Money and volumes | Decimal strings ("0.01", "1.13426"), never floats |
| Retries | Send an Idempotency-Key with every order |
| Errors | One shape everywhere, with a stable code — see Errors |
The machine-readable description is at
api.fxapis.com/docs/json — import it
into Postman or Insomnia, or generate a client from it. A ready-made
Postman collection covering
every endpoint is on GitHub (how to use it), and the
official SDKs are generated from the same description.
Changelog
What changed in the fxapis API, newest first.
Balance, equity and margin GET
The account's money as its MetaTrader terminal reports it: balance, equity, margin, free margin, margin level, credit and open profit, as decimal strings in the account's currency. Without `fresh`, the last read: taken every 15 seconds while the account is online, with `observedAt` saying when. With `fresh=true`, the terminal is asked now — the account must be `ready` (409 `ACCOUNT_NOT_READY` otherwise, including while it is `executing` an order or `degraded`); a terminal still on an older worker answers 501 `CAPABILITY_UNAVAILABLE` instead, rare in practice. Callers within the same second share one read, and only a read that reaches the terminal is charged to the account's live budget (300 a minute + 50 across every caller; 429 `RATE_LIMITED` with `retry-after` past it).