v6

OpenAPI 3.1.0raw.githubusercontent.com2026-08-0161197504.7 KB
performance

Retrieve earnings (P&L)

Retrieve an account's earnings (P&L) for the requested period. Note the period supports full date-times, with timezone information.

get/accounts/{account_id}/earnings

Path parameters

account_idstring required

Query parameters

period'1d' | '1w' | '1m' | 'this-month' | '3m' | '6m' | 'ytd' | '1y' | 'all'

Predefined period over which earnings are computed. Takes precedence over period_start/period_end when provided.

period_startstring date-time

The period start (in ISO 8601 format). If omitted, it defaults to the account opening date/time. Note that the period is interpreted as a half-open interval with period_start included and period_end excluded.

Example:period_start=2025-11-12T00:00:00Z

The period start (in ISO 8601 format). If omitted, it defaults to the account opening date/time. Note that the period is interpreted as a half-open interval with period_start included and period_end excluded.

period_endstring date-time

The period end (in ISO 8601 format). If omitted, it defaults to the current date/time. Note the period is interpreted as a half-open interval with period_start included and period_end excluded.

Example:period_end=2025-11-12T00:00:00Z

The period end (in ISO 8601 format). If omitted, it defaults to the current date/time. Note the period is interpreted as a half-open interval with period_start included and period_end excluded.

Response

OK

accountstring required

ID of the account the earnings were computed for.

currency'EUR' | 'USD' | 'GBP' required
feesstring required

Fees deducted from gross earnings.

gross_realizedstring required

Realized earnings before fees and taxes.

gross_totalstring required

Total realized and unrealized gross earnings.

gross_unrealizedstring required

Unrealized earnings before fees and taxes.

net_realizedstring required

Realized earnings after fees and taxes.

net_totalstring required

Total realized and unrealized net earnings.

net_unrealizedstring required

Unrealized earnings after fees and taxes.

period_endstring date-time required

End date and time of the earnings period.

period_startstring date-time required

Start date and time of the earnings period.

realized_capitalstring required

Realized earnings from capital appreciation.

realized_incomestring required

Realized earnings from income.

unrealized_capitalstring required

Unrealized earnings from capital appreciation.

unrealized_incomestring required

Unrealized earnings from income.

Example response

{
  "fees": "7.25",
  "gross_realized": "125.50",
  "gross_total": "209.75",
  "gross_unrealized": "84.25",
  "net_realized": "118.25",
  "net_total": "202.50",
  "net_unrealized": "84.25",
  "period_end": "2026-03-31T23:59:59Z",
  "period_start": "2026-01-01T00:00:00Z",
  "position_earnings": [
    {
      "cost_basis": "2000.00",
      "gross_realized": "125.50",
      "gross_total": "209.75",
      "gross_unrealized": "84.25",
      "gross_unrealized_percentage": "0.0421",
      "period_end": "2026-03-31T23:59:59Z",
      "period_start": "2026-01-01T00:00:00Z",
      "realized_capital": "100.00",
      "realized_income": "25.50",
      "unrealized_capital": "75.00",
      "unrealized_income": "9.25"
    }
  ],
  "realized_capital": "100.00",
  "realized_income": "25.50",
  "unrealized_capital": "75.00",
  "unrealized_income": "9.25"
}