get_operations_by_cursor
Retrieve account operations with cursor-based pagination for large histories. Use returned nextCursor to fetch the next page; hasNext shows if more results exist.
Instructions
Get operations with cursor-based pagination. Better for large histories.
Returns hasNext and nextCursor for pagination: pass nextCursor as cursor to get the next page. Each operation item includes detailed info: id, type (the code, e.g. OPERATION_TYPE_BUY), name and description, state, date, payment, price, commission, yield, accruedInt, quantity, quantityDone, quantityRest, ticker, classCode, figi, instrumentType, instrumentUid, positionUid, tradesInfo.trades (the trades of the order) and childOperations (its commissions and taxes). A field that is zero or empty is left out, and so are fields that repeat another one or the request (instrumentKind, assetUid, brokerAccountId, the per-item cursor).
Canceled orders are operations as well, and carry the quantity and the payment they asked for — a canceled buy with a positive payment, where an executed one is negative: pass state="EXECUTED" before adding up money or quantities. quantity is what the order asked for, quantityDone what was executed (left out when nothing was) and quantityRest what was not — an order can be executed in part. A bond repayment has no quantity. Prices and quantities are as they were at the time: unlike candles, they are not adjusted for later splits. positionUid is the key of a position: one paper can come under several figi and instrumentUid. The API can send an operation twice under one id; within a page the two are merged, across pages add up by unique id.
Common operation types: BUY, SELL, DIVIDEND, COUPON, TAX, BOND_TAX, INPUT, OUTPUT, BROKER_FEE, BOND_REPAYMENT_FULL, BOND_REPAYMENT; DIV_EXT is a dividend paid out to a card, which never reaches the account.
Args: account_id: Account ID from_date: Start date (YYYY-MM-DD), default: 1 year ago to_date: End date (YYYY-MM-DD, inclusive), default: now cursor: Cursor from previous response for pagination limit: Number of operations per page (1-1000, default: 50; a page of 50 is about 28,000 characters, and a client refuses a result twice that) instrument_id: Filter by instrument — ticker, FIGI, ISIN or UID operation_types: Comma-separated operation types (e.g. "BUY,SELL,DIVIDEND"); a type the API does not have is an error state: Filter by state: EXECUTED, CANCELED, PROGRESS without_commissions: Exclude commission operations without_trades: Exclude trade details from response
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| state | No | ||
| cursor | No | ||
| to_date | No | ||
| from_date | No | ||
| account_id | Yes | ||
| instrument_id | No | ||
| without_trades | No | ||
| operation_types | No | ||
| without_commissions | No |