## Get Portfolio History `client.V1.Accounts.GetPortfolioHistory(ctx, accountID, query) (*V1AccountGetPortfolioHistoryResponse, error)` **get** `/v1/accounts/{account_id}/portfolio-history` Retrieves daily portfolio history for the specified account. ### Parameters - `accountID int64` - `query V1AccountGetPortfolioHistoryParams` - `StartDate param.Field[Time]` Start date for the portfolio history range, in YYYY-MM-DD format. - `EndDate param.Field[Time]` Defaults to today in America/New_York when omitted. ### Returns - `type V1AccountGetPortfolioHistoryResponse struct{…}` - `Data PortfolioHistoryResponse` - `Segments []PortfolioHistorySegment` - `Date Time` The date for this segment - `EodEquity string` The equity at the end of the trading day. - `RealizedPnl string` Sum of the profit and loss realized from position closing trading activity. - `SodEquity string` The equity at the start of the trading day. - `UnrealizedPnl string` Sum of the profit and loss from market changes. - `BoughtNotional string` Amount bought MTM - `DayPnl string` Sum of the profit and loss from intraday trading activities for the trading day. - `NetPnl string` P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses - `PositionPnl string` P&L attributable to start-of-day (carried) positions from market movement during this trading day. - `SoldNotional string` Amount sold MTM ### Example ```go package main import ( "context" "fmt" "time" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.Accounts.GetPortfolioHistory( context.TODO(), 0, clearstreet.V1AccountGetPortfolioHistoryParams{ StartDate: time.Now(), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "segments": [ { "bought_notional": "39800.00", "date": "2026-04-15", "day_pnl": "850.25", "eod_equity": "100850.25", "net_pnl": "850.25", "position_pnl": "-350.25", "realized_pnl": "1200.50", "sod_equity": "100000.00", "sold_notional": "42500.00", "unrealized_pnl": "-350.25" } ] }, "error": null, "metadata": { "request_id": "f076d6f6-10c9-42a0-98c5-18cebc427e80" } } ```