API reference · v1
Forexizer Connect API
Connect reads MetaTrader 4 and 5 accounts for you. You send an account's login, server and investor password once. We log in on a schedule, read the history and give it back as JSON.
Early access. We issue API keys by hand while v1 settles. Field names on this page may still change before general availability, and we'll email key holders before any change.
Introduction
The base URL is https://connect.forexizer.com/v1. Requests and responses are JSON. Times are ISO 8601 in UTC, and money is a decimal number in the account's currency.
Authentication
Send your API key as a bearer token on every request. Keep it on your server. Never ship it in a browser or mobile app.
Authorization: Bearer fxc_live_…
Quickstart
- Ask your user for their account number, broker server and investor password.
- Connect the account. The first sync starts at once.
- Wait for the
account.connectedwebhook, or poll the account until its status isconnected. - Read the trades. After that, listen for
trade.closed.
Connect an account
| Field | Type | Description |
|---|---|---|
platform | string | mt4 or mt5. |
login | string | The account number. |
server | string | The broker server, exactly as MetaTrader shows it, such as Broker-Live. |
password | string | The investor (read-only) password. A trading password is refused and deleted. |
reference | string, optional | Your own id for this account, returned on every object and webhook. |
curl https://connect.forexizer.com/v1/accounts \ -H "Authorization: Bearer $CONNECT_KEY" \ -d '{"platform":"mt5","login":"12345678","server":"Broker-Live","password":"…","reference":"user_42"}'
Returns 201 with the account object, in status connecting.
The account object
{
"id": "acc_9f2k",
"platform": "mt5",
"login": "12345678",
"server": "Broker-Live",
"reference": "user_42",
"status": "connected",
"currency": "USD",
"balance": 10432.18,
"equity": 10518.02,
"last_synced_at": "2026-12-04T16:41:22Z",
"error": null
}
| Status | Meaning |
|---|---|
connecting | The first sync hasn't finished yet. |
connected | The last sync worked. |
login_failed | The broker refused the login, or the password was a trading password. error says which. Syncing stops until you connect it again with new details. |
unavailable | The broker couldn't be reached. We keep trying on schedule. |
The password is never returned.
Trigger a sync
Queues a sync now instead of waiting for the schedule. Returns 202. Available on paid plans, at most once per account every minute. Most syncs finish in about ten seconds; a first sync of a long history takes longer.
Delete an account
Stops syncing and deletes the account, its stored password and its trades from Connect. Returns 204. The account stops counting toward your plan at once.
Trades
Closed trades, newest first. Query parameters: since (ISO time, by close time), limit (up to 500, default 100) and cursor (from next_cursor).
{
"data": [{
"id": "trd_71hc",
"ticket": "48211937",
"symbol": "EURUSD",
"side": "buy",
"volume": 0.5,
"open_time": "2026-12-03T08:14:05Z",
"open_price": 1.08412,
"close_time": "2026-12-03T11:52:40Z",
"close_price": 1.08777,
"commission": -3.5,
"swap": 0,
"profit": 182.4
}],
"next_cursor": null
}
profit is the trade's gross result. Net result is profit + commission + swap. A position closed in parts returns one trade per partial close.
Balance operations
Deposits, withdrawals, credits and other non-trade changes to the balance, newest first. Same paging as trades.
{ "data": [{ "id": "op_2m8q", "type": "deposit", "amount": 5000, "time": "2026-11-28T09:00:11Z", "comment": "Deposit" }] }
Webhooks
Give us an HTTPS URL when you get your key and we'll POST events to it. Answer with any 2xx within 10 seconds. Failed deliveries are retried with growing delays for 24 hours.
| Event | Sent when |
|---|---|
account.connected | An account's first sync finished. |
account.login_failed | The broker refused the login, or a trading password was sent. |
trade.closed | A sync found a newly closed trade. One event per trade. |
operation.created | A sync found a new deposit, withdrawal or other balance operation. |
{
"id": "evt_5t0x",
"type": "trade.closed",
"created_at": "2026-12-03T11:55:02Z",
"account": { "id": "acc_9f2k", "reference": "user_42" },
"data": { /* the trade object */ }
}
Verifying a webhook
Each request carries a Connect-Signature header: the hex HMAC-SHA256 of the raw request body, keyed with your webhook secret. Compute it yourself and compare before trusting the payload. Events can arrive more than once, so treat the event id as a de-duplication key.
Errors
Errors use ordinary HTTP status codes and a JSON body.
{ "error": { "code": "account_limit_reached", "message": "Your plan allows 25 accounts." } }
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | A field is missing or malformed. |
| 401 | unauthorized | The API key is missing or wrong. |
| 402 | account_limit_reached | Your plan's account limit is full. |
| 404 | not_found | No such account under this key. |
| 409 | already_connected | This login and server are already connected under this key. |
| 429 | rate_limited | Too many requests. Wait for the seconds in Retry-After. |
Limits
- 10 requests a second per API key.
- One manual sync per account each minute.
- Scheduled syncs: every hour on Dev, every 15 minutes on Starter, every 5 minutes on Growth and Scale.
Questions or something missing? Email connect@forexizer.com.