Trade history: broker API endpoints compared
26 documented calls from 11 of the 12 APIs with endpoint records here, and 11 functions and messages from 4 APIs whose interfaces are not HTTP, each with the page it was read on.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
What this task is
History calls return what has already happened on an account: closed trades, cash transactions such as funding and charges, and a log of activity. They are the calls behind a trade journal, a tax export or a profit and loss report.
Expect a date range, paging and a limit on how far back a single request may reach. Ask in small windows and store what you receive, rather than asking for everything each time.
The documented endpoint, API by API
Ordered by the name of the broker or platform API, then by path. The order is not a ranking. Open a row for the parameters, the response and a sample request.
| Broker or platform | Endpoint | What the record says it does | Source |
|---|---|---|---|
| Capital.com | GET/api/v1/history/activity | Account activity such as orders and positions, with optional detail and FIQL filtering. Default is the last 10 minutes. | open-api.capital.comchecked |
| Capital.com | GET/api/v1/history/transactions | Money movements: trades, swaps, deposits, withdrawals and fees. Default is the last 10 minutes. | open-api.capital.comchecked |
| DXtrade APIs | GET/accounts/{accountCode}/orders/history | List an account's orders, both working and final, filtered by status, type, side, instrument or time. | demo.dx.tradechecked |
| DXtrade APIs | GET/accounts/{accountCode}/transfers | List the cash movements on an account over a period: deposits, withdrawals, commissions, financing and settled profit and loss. | demo.dx.tradechecked |
| eToro | GET/api/v1/trading/info/trade/demo/history | Returns closed demo trades from a start date to now, with pagination. | api-portal.etoro.comchecked |
| eToro | GET/api/v1/trading/info/trade/history | Returns closed trades on the real account from a start date to now. eToro advises keeping each request's lookback under one year and paging through longer periods. | api-portal.etoro.comchecked |
| IG | GET/history/activity | Account activity (deals, amendments, order changes) over a date range, with optional detail. | labs.ig.comchecked |
| IG | GET/history/activity/{fromDate}/{toDate} | Account activity between two dates, both given in the path. This is the version 1 form: every value in the reply is a string. | labs.ig.comchecked |
| IG | GET/history/activity/{lastPeriod} | Account activity for a period counted back from now, given in milliseconds. This is the version 1 form: every value in the reply is a string. | labs.ig.comchecked |
| IG | GET/history/transactions | Cash transactions (realised profit and loss, funding, deposits). This is the one you want for a trade journal or tax spreadsheet. | labs.ig.comchecked |
| IG | GET/history/transactions/{transactionType}/{fromDate}/{toDate} | Transaction history of one type between two dates, all three given in the path. The version 1 form of the transactions call. | labs.ig.comchecked |
| IG | GET/history/transactions/{transactionType}/{lastPeriod} | Transaction history of one type for a period counted back from now, given in milliseconds. The version 1 form of the transactions call. | labs.ig.comchecked |
| Interactive Brokers | GET/iserver/account/trades | Executions from the last 7 days at most, with symbol, side, size, price, commission and time. | interactivebrokers.comchecked |
| Match-Trader Platform API | POST/mtr-api/{SYSTEM_UUID}/closed-positions | List the positions closed between two dates, each with its open and close price, volume, commission, swap and profit. The dates go in the body of a POST. | app.theneo.iochecked |
| MetaApi | GET/users/current/accounts/{accountId}/history-deals/position/{positionId} | List the history deals that belong to one position. | metaapi.cloudchecked |
| MetaApi | GET/users/current/accounts/{accountId}/history-deals/time/{startTime}/{endTime} | List the account's history deals inside a time range, a page at a time. | metaapi.cloudchecked |
| MetaApi | GET/users/current/accounts/{accountId}/history-orders/time/{startTime}/{endTime} | List the account's completed orders inside a time range, a page at a time. | metaapi.cloudchecked |
| OANDA | GET/v3/accounts/{accountID}/transactions | Transaction history for a time range, returned as page URLs to fetch next. | developer.oanda.comchecked |
| OANDA | GET/v3/accounts/{accountID}/transactions/idrange | The transactions between two transaction IDs, both included, returned in full. | developer.oanda.comchecked |
| OANDA | GET/v3/accounts/{accountID}/transactions/sinceid | Every transaction newer than the one you name, returned in full. Useful for catching up after a gap. | developer.oanda.comchecked |
| Saxo OpenAPI | GET/hist/v1/transactions | Lists historical transactions, such as trades, within a date range for a client or account. Filter by transaction type, asset type or instrument. | developer.saxochecked |
| Saxo OpenAPI | GET/port/v1/closedpositions/me | Lists positions closed for the logged in client, with open and close prices, times and realised profit or loss. | developer.saxochecked |
| TradeLocker API | GET/trade/accounts/{accountId}/ordersHistory | List the account's orders that reached a final status: filled, cancelled or rejected. | public-api.tradelocker.comchecked |
| Trading 212 | GET/api/v0/equity/history/dividends | Dividends paid into the account, paged, with the amount, the quantity held and the per share figure. | docs.trading212.comchecked |
| Trading 212 | GET/api/v0/equity/history/orders | Past orders on the account, paged, each paired with the fill it produced. | docs.trading212.comchecked |
| Trading 212 | GET/api/v0/equity/history/transactions | Movements of cash in and out of the account, paged: deposits, withdrawals, fees, transfers and interest. | docs.trading212.comchecked |
The same task where the interface is not HTTP
Some platform APIs, and the streaming interfaces of some broker APIs, are not sent as HTTP requests. A function is called from a program in its language, and a message is sent over an open connection. None has a method or a path, so each row is labelled with its kind and its interface. A record is put on this page by hand, from what the vendor's page says the call does, and one call can do several jobs, so the same function can be on more than one task page. Ordered by the name of the broker or platform API, then interface, then name.
| API | Call | What the record says it does | Source |
|---|---|---|---|
| cTrader Open API | messageProtoOADealListReq cTrader Open API | Asks for the account's deals in a period of time. A deal is one execution, so this is the trade history. | help.ctrader.comchecked |
| cTrader Open API | messageProtoOAOrderListReq cTrader Open API | Asks for the account's orders in a period of time. | help.ctrader.comchecked |
| Deriv | messageprofit_table Deriv WebSocket API | Returns the account's closed contracts with what each was bought and sold for, filtered by date and contract type and paged with limit and offset. | developers.deriv.comchecked |
| Deriv | messagestatement Deriv WebSocket API | Returns the account's transactions: buys, sells, deposits and withdrawals, filtered by date and type and paged with limit and offset. | developers.deriv.comchecked |
| MetaTrader 4 (MQL4) | functionOrderSelect() MQL4 | Selects one order, by its place in a list or by its ticket, so that the functions which read an order's properties read that one. | docs.mql4.comchecked |
| MetaTrader 4 (MQL4) | functionOrdersHistoryTotal() MQL4 | Returns how many closed orders are in the account history the terminal has loaded. | docs.mql4.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionhistory_deals_get() MetaTrader5 Python package | Returns deals from the account's trading history: those between two dates, optionally filtered by symbol, or those of one order, or those of one position. | mql5.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionhistory_orders_get() MetaTrader5 Python package | Returns orders from the account's trading history: those between two dates, optionally filtered by symbol, or the one with a given ticket, or those of one position. | mql5.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionHistoryDealGetTicket() MQL5 | Returns the ticket of the deal at a place in the loaded history, and selects that deal for the history deal functions. | mql5.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionHistorySelect() MQL5 | Loads the account's history of deals and orders for a period of server time, so the other history functions have something to read. | mql5.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionHistorySelectByPosition() MQL5 | Loads the deals and orders that belong to one position, by the position's identifier. | mql5.comchecked |
None documented here yet
These APIs have endpoint records on this site, but none is assigned to this task. That describes this dataset. It is not a statement that the API lacks such a call.
- Deriv: none documented here yet
Brokers and platforms with no endpoint records at all are not listed above. The broker directory shows what is recorded for each.