A trade history API for MetaTrader 4 and 5
MetaTrader has no public REST API. If your product needs a user's trade history, the usual choices are a file the user exports and uploads, an expert advisor running on their machine, or your own fleet of Windows terminals. Forexizer Connect replaces all three with one HTTP call.
Your user gives you their account number, broker server and investor password. We log in, read the history, log out, and hand you clean JSON. Then we keep it in sync.
What you get back
One object per closed trade, already paired from MetaTrader's separate entry and exit deals, with times in UTC:
GET /v1/accounts/acc_9f2k/trades
{
"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
}
- Closed trades: symbol, side, volume, open and close time and price, commission, swap and profit. A position closed in parts becomes one trade with volume-weighted prices.
- Balance operations: deposits, withdrawals and credits, kept apart from trades so they don't distort performance numbers (
GET /v1/accounts/{id}/operations). - Account state: current balance, equity and currency after every sync.
- Webhooks: a signed
trade.closedevent for each new trade, so you don't have to poll.
Not included: open positions, live price streams and order execution. Connect is for products that read what happened.
The hard parts we handle
MT5 deals are not trades
MetaTrader 5 reports an entry deal and one or more exit deals per position, plus balance deals mixed in with them. Pairing those correctly, including partial closes, is the bug-prone part of every homemade importer. Connect does it on our side, using the same code that runs inside Forexizer's own trading journal.
Broker server time
Every broker stamps times in its own server time zone, often shifting with daylight saving. We read the broker's clock at each login and give you UTC.
Terminals
MetaTrader terminals are Windows programs that need logging in, babysitting and updating. We run them in short-lived, memory-only containers: log in, read, log out, wipe. You never run one.
How fresh is the data?
You choose per account. Scheduled accounts sync every 15 minutes on paid plans (every 5 with an add-on). On-demand accounts sync only when you call POST /v1/accounts/{id}/sync, for example when a user opens your app. A sync typically takes about 10 seconds.
Who uses a trade history API
- Trading journals that are tired of asking users to export HTML statements.
- Educators and trading communities showing students' real results, with permission.
- Leaderboards and verification ranking traders on broker data instead of screenshots.
- Prop and risk dashboards that need to watch drawdown across many accounts.
Pricing
Free to build, in a Sandbox with up to 5 demo accounts. Paid plans start at $49 a month (excluding VAT) for 25 accounts, go down to $1.25 per account from 250 accounts, and $0.50 per account on the On demand plan. All plans.
Start in five minutes
Create a key, connect a broker demo account with its investor password, and call the trades endpoint. The quickstart walks through it in cURL, Node and Python.
Related: reading accounts with the investor password · Connect vs MetaApi · Connect vs API2Trade