GET /api/v1/accounts/{login}/deals reads the verified account’s MT5 history.
It appears in /openapi/partners.json, under the existing /api/v1 prefix.
This is a read-only query: no Idempotency-Key or trading enablement is required.
Access and parameters
The token needsGET:/api/v1/accounts/*/deals or a covering permission such as
GET:/api/v1/accounts/*. Existing tokens with that broad permission already cover
the route. The same token must hold an active verification for this account.
Do not send milliseconds or date strings. Accepted timestamps range from
0
to 253402300799. Keep the same from and to while paging.
Response fields
The response containsretcode and an answer list. An empty list is a successful
query with no records on that page. Numbers may be strings: preserve precision
and use decimal arithmetic for monetary amounts.
Storage is the swap field in this API. Missing or null values are unavailable,
not zero. Explicit zeros remain zero.
Closed deals and position results
The route returns all deals in the period, including entries, exits and balance transactions. For buy/sell deals (Action 0/1), Entry identifies 0 entry,
1 exit, 2 reversal or 3 close-by. An exit can be partial; a reversal combines
a close with a new entry.
When all four amounts are available, the booked net amount of a deal is
Profit + Storage + Commission + Fee, preserving the original signs. Group
all deals by PositionID, including entries that may carry commission, for
a position’s complete booked result. If the entry predates from, extend the
query. A partial date range is not a complete lifetime result.
An exit alone does not prove the whole position is closed. Account for partial
closes and reversals, and read open positions for current state. Daily/monthly
charges or records with PositionID=0 may not belong to one position. Do not
allocate them arbitrarily or add them to every position. This route neither
allocates unassociated charges nor computes a net result per position.
Pagination
Advanceoffset by the number of received rows. Stop on an empty page or a page
shorter than total; request another page when it is full. History is not a locked
snapshot: new activity and corrections can change it. Deduplicate by Deal when
synchronizing and reconcile periods that may receive corrections. Preserve MT5’s
order instead of assuming another sort order.
client is an authenticated instance of the supplied Python client. A 401 means
invalid token; 403, missing permission or verification; 422, invalid query.
Do not interpret 502/503 as an empty history.
Concept reference: MetaQuotes deal properties.
