Skip to content
Get started

Get Portfolio History

AccountGetPortfolioHistoryResponse v1().accounts().getPortfolioHistory(AccountGetPortfolioHistoryParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/accounts/{account_id}/portfolio-history

Retrieves daily portfolio history for the specified account.

ParametersExpand Collapse
AccountGetPortfolioHistoryParams params
Optional<Long> accountId
LocalDate startDate

Start date for the portfolio history range, in YYYY-MM-DD format.

formatdate
Optional<LocalDate> endDate

Defaults to today in America/New_York when omitted.

formatdate
ReturnsExpand Collapse
class AccountGetPortfolioHistoryResponse:
LocalDate date

The date for this segment

formatdate
String eodEquity

The equity at the end of the trading day.

String realizedPnl

Sum of the profit and loss realized from position closing trading activity.

String sodEquity

The equity at the start of the trading day.

String unrealizedPnl

Sum of the profit and loss from market changes.

Optional<String> boughtNotional

Amount bought MTM

Optional<String> dayPnl

Sum of the profit and loss from intraday trading activities for the trading day.

Optional<String> netPnl

P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses

Optional<String> positionPnl

P&L attributable to start-of-day (carried) positions from market movement during this trading day.

Optional<String> soldNotional

Amount sold MTM

Get Portfolio History

package com.clear_street.api.example;

import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams;
import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse;
import java.time.LocalDate;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        AccountGetPortfolioHistoryParams params = AccountGetPortfolioHistoryParams.builder()
            .accountId(0L)
            .startDate(LocalDate.parse("2019-12-27"))
            .build();
        AccountGetPortfolioHistoryResponse response = client.v1().accounts().getPortfolioHistory(params);
    }
}
{
  "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"
  }
}
{
  "data": {
    "segments": [
      {
        "bought_notional": null,
        "date": "2026-05-12",
        "day_pnl": null,
        "eod_equity": "100009.00",
        "net_pnl": null,
        "position_pnl": null,
        "realized_pnl": "12.00",
        "sod_equity": "100000.00",
        "sold_notional": null,
        "unrealized_pnl": "-3.00"
      }
    ]
  },
  "error": {
    "code": 500,
    "message": "upstream calc-engine returned an error"
  },
  "metadata": {
    "request_id": "2f3d7b0a-1111-4a4b-9e1f-8c4e5d3a9f12"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
Returns Examples
{
  "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"
  }
}
{
  "data": {
    "segments": [
      {
        "bought_notional": null,
        "date": "2026-05-12",
        "day_pnl": null,
        "eod_equity": "100009.00",
        "net_pnl": null,
        "position_pnl": null,
        "realized_pnl": "12.00",
        "sod_equity": "100000.00",
        "sold_notional": null,
        "unrealized_pnl": "-3.00"
      }
    ]
  },
  "error": {
    "code": 500,
    "message": "upstream calc-engine returned an error"
  },
  "metadata": {
    "request_id": "2f3d7b0a-1111-4a4b-9e1f-8c4e5d3a9f12"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}