Broker API HubMenu

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.

Independent and unofficialNewest check

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 platformEndpointWhat the record says it doesSource
Capital.comGET/api/v1/history/activityAccount activity such as orders and positions, with optional detail and FIQL filtering. Default is the last 10 minutes.open-api.capital.comchecked
Capital.comGET/api/v1/history/transactionsMoney movements: trades, swaps, deposits, withdrawals and fees. Default is the last 10 minutes.open-api.capital.comchecked
DXtrade APIsGET/accounts/{accountCode}/orders/historyList an account's orders, both working and final, filtered by status, type, side, instrument or time.demo.dx.tradechecked
DXtrade APIsGET/accounts/{accountCode}/transfersList the cash movements on an account over a period: deposits, withdrawals, commissions, financing and settled profit and loss.demo.dx.tradechecked
eToroGET/api/v1/trading/info/trade/demo/historyReturns closed demo trades from a start date to now, with pagination.api-portal.etoro.comchecked
eToroGET/api/v1/trading/info/trade/historyReturns 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
IGGET/history/activityAccount activity (deals, amendments, order changes) over a date range, with optional detail.labs.ig.comchecked
IGGET/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
IGGET/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
IGGET/history/transactionsCash transactions (realised profit and loss, funding, deposits). This is the one you want for a trade journal or tax spreadsheet.labs.ig.comchecked
IGGET/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
IGGET/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 BrokersGET/iserver/account/tradesExecutions from the last 7 days at most, with symbol, side, size, price, commission and time.interactivebrokers.comchecked
Match-Trader Platform APIPOST/mtr-api/{SYSTEM_UUID}/closed-positionsList 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
MetaApiGET/users/current/accounts/{accountId}/history-deals/position/{positionId}List the history deals that belong to one position.metaapi.cloudchecked
MetaApiGET/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
MetaApiGET/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
OANDAGET/v3/accounts/{accountID}/transactionsTransaction history for a time range, returned as page URLs to fetch next.developer.oanda.comchecked
OANDAGET/v3/accounts/{accountID}/transactions/idrangeThe transactions between two transaction IDs, both included, returned in full.developer.oanda.comchecked
OANDAGET/v3/accounts/{accountID}/transactions/sinceidEvery transaction newer than the one you name, returned in full. Useful for catching up after a gap.developer.oanda.comchecked
Saxo OpenAPIGET/hist/v1/transactionsLists 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 OpenAPIGET/port/v1/closedpositions/meLists positions closed for the logged in client, with open and close prices, times and realised profit or loss.developer.saxochecked
TradeLocker APIGET/trade/accounts/{accountId}/ordersHistoryList the account's orders that reached a final status: filled, cancelled or rejected.public-api.tradelocker.comchecked
Trading 212GET/api/v0/equity/history/dividendsDividends paid into the account, paged, with the amount, the quantity held and the per share figure.docs.trading212.comchecked
Trading 212GET/api/v0/equity/history/ordersPast orders on the account, paged, each paired with the fill it produced.docs.trading212.comchecked
Trading 212GET/api/v0/equity/history/transactionsMovements 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.

APICallWhat the record says it doesSource
cTrader Open APImessageProtoOADealListReq cTrader Open APIAsks 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 APImessageProtoOAOrderListReq cTrader Open APIAsks for the account's orders in a period of time.help.ctrader.comchecked
Derivmessageprofit_table Deriv WebSocket APIReturns 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
Derivmessagestatement Deriv WebSocket APIReturns 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() MQL4Selects 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() MQL4Returns 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 packageReturns 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 packageReturns 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() MQL5Returns 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() MQL5Loads 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() MQL5Loads 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.

Brokers and platforms with no endpoint records at all are not listed above. The broker directory shows what is recorded for each.

Sections