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

# Get user trades

> Fetch trade history for a user from Kalshi or Polymarket



## OpenAPI

````yaml openapi.json get /profile/trades
openapi: 3.1.0
info:
  title: Polyrouter API
  version: 2.0.0
  description: >-
    Unified API for prediction market platforms (Polymarket, Kalshi, Limitless,
    Manifold)
  contact:
    name: Polyrouter
    url: https://polyrouter.io
servers:
  - url: https://api-v2.polyrouter.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Health
    description: Health check and API info
  - name: Markets
    description: Prediction market operations
  - name: Events
    description: Event operations
  - name: Series
    description: Series operations
  - name: Platforms
    description: Platform information
  - name: Search
    description: Search across platforms
  - name: Trades
    description: Historical trades data
  - name: Orderbook
    description: Orderbook data (real-time and historical)
  - name: Sports
    description: Sports betting markets - games, awards, futures, and league info
  - name: Profile
    description: User profiles, trading metrics, and trade history
paths:
  /profile/trades:
    get:
      tags:
        - Profile
      summary: Get user trades
      description: Fetch trade history for a user from Kalshi or Polymarket
      operationId: getProfileTrades
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/ProfilePlatform'
              - description: Platform to query (kalshi or polymarket)
          required: true
          name: platform
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            description: >-
              User identifier (nickname for Kalshi, wallet address for
              Polymarket)
            example: trader123
          required: true
          name: user
          in: query
        - schema:
            type: string
            description: Number of trades to return (max 100)
            example: '50'
          required: false
          name: limit
          in: query
        - schema:
            type: string
            description: Pagination cursor
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: User trade history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileTradesResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    ProfilePlatform:
      type: string
      enum:
        - kalshi
        - polymarket
    ProfileTradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/UserTrade'
        pagination:
          $ref: '#/components/schemas/ProfileTradesPagination'
        meta:
          $ref: '#/components/schemas/ProfileMeta'
      required:
        - trades
        - pagination
        - meta
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: NOT_FOUND
            message:
              type: string
              example: Resource not found
            timestamp:
              type: string
              format: date-time
              example: '2025-01-01T00:00:00.000Z'
          required:
            - code
            - message
            - timestamp
      required:
        - error
    UserTrade:
      type: object
      properties:
        platform:
          $ref: '#/components/schemas/ProfilePlatform'
        trade_id:
          type: string
          example: trade_abc123
        user_id:
          type: string
          example: trader123
        market_id:
          type: string
          example: market_xyz
        ticker:
          type: string
          example: ELECTION-2024
        title:
          type: string
          example: Will X win the election?
        side:
          $ref: '#/components/schemas/TradeSide'
        outcome:
          $ref: '#/components/schemas/TradeOutcome'
        price:
          type: number
          example: 0.65
        size:
          type: number
          example: 100
        timestamp:
          type: string
          example: '2024-11-01T12:30:00Z'
        transaction_hash:
          type: string
          example: 0x123...
        metadata:
          type: object
          additionalProperties:
            nullable: true
      required:
        - platform
        - trade_id
        - user_id
        - market_id
        - ticker
        - title
        - side
        - outcome
        - price
        - size
        - timestamp
        - metadata
    ProfileTradesPagination:
      type: object
      properties:
        total:
          type: number
          example: 100
        limit:
          type: number
          example: 50
        has_more:
          type: boolean
          example: true
        next_cursor:
          type: string
          nullable: true
          example: eyJvZmZzZXQiOjUwfQ
      required:
        - total
        - limit
        - has_more
        - next_cursor
    ProfileMeta:
      type: object
      properties:
        request_time:
          type: number
          example: 150
        platform:
          $ref: '#/components/schemas/ProfilePlatform'
        data_freshness:
          type: string
          example: '2024-11-01T12:30:00Z'
      required:
        - request_time
        - platform
        - data_freshness
    TradeSide:
      type: string
      enum:
        - buy
        - sell
    TradeOutcome:
      type: string
      enum:
        - 'yes'
        - 'no'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````