> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paperdrill.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get portfolio history

> Returns persisted portfolio snapshots for a chart. Recent history keeps
every minute; older rows are thinned to one per hour, day, and week, and
snapshots expire after one year. At most 2000 rows are read before the
response is downsampled to 120 chart points. Requires the `ACCOUNT_READ` scope.




## OpenAPI

````yaml /openapi.yaml get /portfolio/history
openapi: 3.1.0
info:
  title: PaperDrill REST API
  version: 1.0.0
  description: >
    Trade PaperDrill credit markets and read live market data.


    Prices, quantities, balances, and other decimal values are encoded as
    strings so clients do not lose precision.
servers:
  - url: https://api.paperdrill.dev/v1
    description: Production
security: []
tags:
  - name: Market data
    description: Public markets, tickers, candles, trades, and order-book snapshots.
  - name: Trading
    description: Create, inspect, and cancel orders with a scoped API key.
  - name: Account
    description: Read balances, portfolio performance, and private trade history.
  - name: Leaderboard
    description: Live public standings and your personal ranking.
  - name: Rewards
    description: >-
      Starter and daily simulated-fund credit status and claims for signed-in
      users.
paths:
  /portfolio/history:
    get:
      tags:
        - Account
      summary: Get portfolio history
      description: >
        Returns persisted portfolio snapshots for a chart. Recent history keeps

        every minute; older rows are thinned to one per hour, day, and week, and

        snapshots expire after one year. At most 2000 rows are read before the

        response is downsampled to 120 chart points. Requires the `ACCOUNT_READ`
        scope.
      operationId: getPortfolioHistory
      parameters:
        - name: range
          in: query
          description: Time window for the series. `all` covers retained history.
          schema:
            type: string
            enum:
              - 24h
              - 7d
              - 30d
              - 90d
              - all
            default: 30d
        - name: limit
          in: query
          description: Maximum number of stored snapshots to read.
          schema:
            type: integer
            minimum: 10
            maximum: 5000
            default: 2000
      responses:
        '200':
          description: Portfolio history returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioHistory'
        default:
          $ref: '#/components/responses/RequestError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PortfolioHistory:
      type: object
      required:
        - quoteAsset
        - range
        - from
        - to
        - points
      properties:
        quoteAsset:
          type: string
        range:
          type: string
          enum:
            - 24h
            - 7d
            - 30d
            - 90d
            - all
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        points:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioHistoryPoint'
    PortfolioHistoryPoint:
      type: object
      required:
        - at
        - cash
        - positionsValue
        - equity
        - realizedPnl
        - unrealizedPnl
        - netContributions
        - totalPnl
        - partial
      properties:
        at:
          type: string
          format: date-time
        cash:
          $ref: '#/components/schemas/DecimalString'
        positionsValue:
          $ref: '#/components/schemas/DecimalString'
        equity:
          $ref: '#/components/schemas/DecimalString'
        realizedPnl:
          $ref: '#/components/schemas/SignedDecimalString'
        unrealizedPnl:
          $ref: '#/components/schemas/SignedDecimalString'
        netContributions:
          $ref: '#/components/schemas/DecimalString'
        totalPnl:
          $ref: '#/components/schemas/SignedDecimalString'
        partial:
          type: boolean
    ApiError:
      type: object
      required:
        - error
        - requestId
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiErrorDetail'
        requestId:
          type: string
          format: uuid
      example:
        error:
          code: VALIDATION_ERROR
          message: Request validation failed
          details:
            - field: qty
              message: invalid decimal format
        requestId: f4c0baf4-b8d2-4c9a-a17b-c8656c4a7b0e
    DecimalString:
      type: string
      pattern: ^\d+(\.\d+)?$
      description: A non-negative decimal encoded as a string.
      example: '125.50'
    SignedDecimalString:
      type: string
      pattern: ^[+-]?\d+(\.\d+)?$
      description: A signed decimal encoded as a string.
      example: '+3.40'
    ApiErrorDetail:
      type: object
      required:
        - message
      properties:
        field:
          type: string
        message:
          type: string
  responses:
    RequestError:
      description: The request failed. See Errors and rate limits for recovery guidance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: A scoped API key created in the PaperDrill dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.