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

# Get user PnL

> Returns profit and loss data over time for a specific user. Supports configurable time granularity and optional date range filtering.



## OpenAPI

````yaml GET /v1/api/profile/pnl
openapi: 3.1.0
info:
  title: Dot Prediction API
  description: >-
    A unified API for accessing prediction market data across Kalshi,
    Polymarket, and Limitless.
  version: 1.0.0
servers:
  - url: https://api.dotprediction.io
security:
  - apiKey: []
paths:
  /v1/api/profile/pnl:
    get:
      tags:
        - Profiles
      summary: Get user PnL
      description: >-
        Returns profit and loss data over time for a specific user. Supports
        configurable time granularity and optional date range filtering.
      operationId: getUserPnL
      parameters:
        - name: provider
          in: query
          required: true
          description: The prediction market platform.
          schema:
            type: string
            enum:
              - kalshi
              - polymarket
        - name: user
          in: query
          required: true
          description: The user identifier on the platform (username or address).
          schema:
            type: string
        - name: granularity
          in: query
          required: true
          description: Time granularity for PnL data points.
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - year
              - all
        - name: start_time
          in: query
          required: false
          description: Start timestamp (Unix epoch) for filtering PnL data.
          schema:
            type: integer
            format: int64
        - name: end_time
          in: query
          required: false
          description: End timestamp (Unix epoch) for filtering PnL data.
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: PnL time-series data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfilePnLResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    ProfilePnLResponse:
      type: object
      properties:
        granularity:
          type: string
          enum:
            - day
            - week
            - month
            - year
            - all
          description: Time granularity of the data points.
        start_time:
          type: integer
          format: int64
          description: Start of the time range.
        end_time:
          type: integer
          format: int64
          description: End of the time range.
        user:
          type: string
          description: User identifier.
        pnl_over_time:
          type: array
          items:
            $ref: '#/components/schemas/PnLDataPoint'
          description: PnL data points over the requested time range.
    PnLDataPoint:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
          description: Unix timestamp for this data point.
        pnl:
          type: number
          description: Profit/loss for this period.
        cumulative_pnl:
          type: number
          description: Cumulative profit/loss up to this point.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
            message:
              type: string
              description: Human-readable error message.
            resolution:
              type: string
              description: Suggested action to resolve the error.
            error_text:
              type: string
              description: Detailed error information.
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded. Check the `Retry-After` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Generate one via the dashboard or the
        `/v1/api/auth/api-keys` endpoint.

````