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

# Get trader best and worst PnL periods

> Best and worst daily, weekly and monthly PnL and portfolio periods.



## OpenAPI

````yaml https://api.struct.to/openapi.json get /polymarket/trader/pnl/{address}/periods
openapi: 3.1.0
info:
  title: Polymarket API
  description: >-
    RESTful API for querying Polymarket prediction markets data including
    events, markets, traders, holders, and real-time metrics
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.struct.to/v1
security: []
paths:
  /polymarket/trader/pnl/{address}/periods:
    get:
      tags:
        - Trader
      summary: Get trader best and worst PnL periods
      description: Best and worst daily, weekly and monthly PnL and portfolio periods.
      operationId: get_trader_pnl_periods
      parameters:
        - name: address
          in: path
          description: Trader wallet address
          required: true
          schema:
            type: string
        - name: timeframe
          in: query
          description: 'Default: lifetime'
          required: false
          schema:
            $ref: '#/components/schemas/PnlAnalyticsTimeframe'
      responses:
        '200':
          description: Best and worst PnL periods
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PnlPeriodsResponse'
        '400':
          description: Invalid params or endpoint disabled
components:
  schemas:
    PnlAnalyticsTimeframe:
      type: string
      enum:
        - 1d
        - 24h
        - 7d
        - 30d
        - lifetime
    PnlPeriodsResponse:
      type: object
      required:
        - timeframe
        - resolution
        - points
        - total_pnl_day
        - total_pnl_week
        - total_pnl_month
        - portfolio_day
        - portfolio_week
        - portfolio_month
      properties:
        timeframe:
          type: string
          description: Timeframe.
        resolution:
          type: string
          description: Resolution.
        from:
          type:
            - integer
            - 'null'
          format: int64
          description: Window start timestamp.
          minimum: 0
        to:
          type:
            - integer
            - 'null'
          format: int64
          description: Window end timestamp.
          minimum: 0
        points:
          type: integer
          description: Points.
          minimum: 0
        total_pnl_day:
          $ref: '#/components/schemas/PnlPeriodExtremes'
          description: Total PnL day.
        total_pnl_week:
          $ref: '#/components/schemas/PnlPeriodExtremes'
          description: Total PnL week.
        total_pnl_month:
          $ref: '#/components/schemas/PnlPeriodExtremes'
          description: Total PnL month.
        portfolio_day:
          $ref: '#/components/schemas/PnlPeriodExtremes'
          description: Portfolio day.
        portfolio_week:
          $ref: '#/components/schemas/PnlPeriodExtremes'
          description: Portfolio week.
        portfolio_month:
          $ref: '#/components/schemas/PnlPeriodExtremes'
          description: Portfolio month.
    PnlPeriodExtremes:
      type: object
      properties:
        best:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PnlPeriodMetric'
              description: Best.
        worst:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PnlPeriodMetric'
              description: Worst.
    PnlPeriodMetric:
      type: object
      required:
        - from
        - to
        - change
      properties:
        from:
          type: integer
          format: int64
          description: Window start timestamp.
          minimum: 0
        to:
          type: integer
          format: int64
          description: Window end timestamp.
          minimum: 0
        change:
          type: number
          format: double
          description: Change.
        change_pct:
          type:
            - number
            - 'null'
          format: double
          description: Change percent.

````