Get Portfolio
get_portfolioRetrieve portfolio positions and totals for the account, including securities, money, and metals with pricing, P&L, and settlement term options.
Instructions
Portfolio of the account bound to the token: every position (securities, money, metals) with quantity, average/current price, value in RUB/USD/EUR, unrealized and daily P&L, portfolio share, accrued interest for bonds. Includes totals by instrument type. The API reports each position once per settlement term (T0/T1/T2/T365) — by default a single slice is returned and totals cover only it; term=all returns the raw duplicates (totals then count every position several times). csv output writes the positions array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | No | Settlement slice to return (the API duplicates positions per term) | T0 |
| outputPath | No | Write the full result to this file (path relative to the output root: BCS_OUTPUT_DIR or server cwd) instead of returning it inline. The response becomes a short summary {savedTo, records, bytes, sample}. Use for bulk data to keep the context clean. For get_candles this also enables full-history fetching (chunking beyond the 1000-bar API limit). | |
| outputFormat | No | File format; default json (or csv if outputPath ends with .csv). csv writes the main flat array of the response. |