Open positions: broker API endpoints compared
22 documented calls from 11 of the 12 APIs with endpoint records here, and 8 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
A position is what you currently hold in a market: the direction, the size and the level it was opened at. Reading open positions is how a program learns its real exposure, as opposed to what it believes it holds.
Some APIs report one entry per deal, others net every deal in an instrument into a single entry, and some offer both views. Check which view a call returns before you add sizes together.
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/positions | All open positions on the active account, each with position and market details. | open-api.capital.comchecked |
| Capital.com | GET/api/v1/positions/{dealId} | One open position by its dealId. | open-api.capital.comchecked |
| DXtrade APIs | GET/accounts/{accountCode}/positions | List every open position on an account. | demo.dx.tradechecked |
| eToro | GET/api/v1/trading/info/demo/pnl | Returns the demo account's credit, unrealised profit or loss, open positions, pending orders and copy relationships. | api-portal.etoro.comchecked |
| eToro | GET/api/v1/trading/info/real/pnl | Returns the real account's credit, unrealised profit or loss, open positions, pending orders and copy relationships. | api-portal.etoro.comchecked |
| IG | GET/positions | All open positions on the active account, each with its market snapshot. | labs.ig.comchecked |
| IG | GET/positions/{dealId} | A single open position by deal ID. | labs.ig.comchecked |
| Interactive Brokers | GET/portfolio/{accountId}/positions/{pageId} | All positions in an account, one page at a time, with size, market price, market value and unrealised profit and loss. | interactivebrokers.comchecked |
| Match-Trader Platform API | GET/mtr-api/{SYSTEM_UUID}/open-positions | List every open position on the trading account, with its side, volume, open price, stop loss, take profit and running profit. | app.theneo.iochecked |
| MetaApi | GET/users/current/accounts/{accountId}/positions | List the open positions on the MetaTrader account. | metaapi.cloudchecked |
| MetaApi | GET/users/current/accounts/{accountId}/positions/{positionId} | Read one open position by its id, the ticket number. | metaapi.cloudchecked |
| OANDA | GET/v3/accounts/{accountID}/openPositions | Positions with open trades, netted per instrument with long and short sides. | developer.oanda.comchecked |
| OANDA | GET/v3/accounts/{accountID}/openTrades | All open trades on the account. | developer.oanda.comchecked |
| OANDA | GET/v3/accounts/{accountID}/positions | Every position the account has ever held, one per instrument, including those now flat. For open positions only there is a separate call. | developer.oanda.comchecked |
| OANDA | GET/v3/accounts/{accountID}/positions/{instrument} | The position in one instrument on the account, whether it is open or not. | developer.oanda.comchecked |
| OANDA | GET/v3/accounts/{accountID}/trades | Trades on the account, filtered by state, instrument or ID. Open trades are returned unless you ask for another state. | developer.oanda.comchecked |
| Saxo OpenAPI | GET/port/v1/netpositions/me | Lists positions netted per instrument for the logged in client, with average open price and profit or loss. Add SubPositions to FieldGroups to include the underlying positions. | developer.saxochecked |
| Saxo OpenAPI | GET/port/v1/positions | Lists open positions for a client, an account group, an account or one net position, chosen by query parameters. | developer.saxochecked |
| Saxo OpenAPI | GET/port/v1/positions/{PositionId} | One open position by its id, with opening details in PositionBase and the live view in PositionView. | developer.saxochecked |
| Saxo OpenAPI | GET/port/v1/positions/me | Lists each open position for the logged in client, with opening details in PositionBase and live price and profit or loss in PositionView. | developer.saxochecked |
| TradeLocker API | GET/trade/accounts/{accountId}/positions | List every position currently open on the account. | public-api.tradelocker.comchecked |
| Trading 212 | GET/api/v0/equity/positions | Every open position on the account, with quantity, average price paid, current price and the effect on the account in its own currency. | 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 | messageProtoOAReconcileReq cTrader Open API | Asks for the account's open positions and pending orders as they stand now. | help.ctrader.comchecked |
| Deriv | messageportfolio Deriv WebSocket API | Lists the contracts the account holds open now. It is a single answer, not a stream. | developers.deriv.comchecked |
| Deriv | messageproposal_open_contract Deriv WebSocket API | Returns the current price and state of a contract the account holds. With subscribe set to 1 an update follows each time it changes, and with no contract_id the stream covers every open contract. | 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) | functionOrdersTotal() MQL4 | Returns how many market and pending orders the account has. | docs.mql4.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionpositions_get() MetaTrader5 Python package | Returns the open positions on the account: all of them, those in one symbol, those whose symbol matches a filter, or the one with a given ticket. | mql5.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionPositionGetTicket() MQL5 | Returns the ticket of the open position at an index in the list of positions, and selects that position so its properties can be read. | mql5.comchecked |
| MetaTrader 5 (Python package and MQL5) | functionPositionsTotal() MQL5 | Returns how many positions are open on the account. | 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.