> ## 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 trades for a market

> Fetch historical trades for a specific market with pagination



## OpenAPI

````yaml openapi.json get /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:
  /trades:
    get:
      tags:
        - Trades
      summary: Get trades for a market
      description: Fetch historical trades for a specific market with pagination
      operationId: getTrades
      parameters:
        - schema:
            type: string
            description: Market ID to fetch trades for
            example: '524153'
          required: true
          name: market_id
          in: query
        - schema:
            type: string
            description: Number of trades to return (max 1000)
            example: '100'
          required: false
          name: limit
          in: query
        - schema:
            type: string
            description: Pagination cursor from previous response
          required: false
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Filter to taker-only trades (Polymarket only)
            example: 'true'
          required: false
          name: takerOnly
          in: query
      responses:
        '200':
          description: List of trades
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradesResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    TradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/Trade'
        pagination:
          $ref: '#/components/schemas/Pagination'
        meta:
          type: object
          properties:
            request_time:
              type: number
              example: 150
            market_id:
              type: string
              example: '524153'
            platform:
              type: string
              example: polymarket
            data_freshness:
              type: string
              example: '2025-01-01T00:00:00.000Z'
          required:
            - request_time
            - market_id
            - platform
            - data_freshness
      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
    Trade:
      type: object
      properties:
        trade_id:
          type: string
          example: 0x123abc...
        market_id:
          type: string
          example: '524153'
        platform:
          type: string
          example: polymarket
        side:
          type: string
          enum:
            - buy
            - sell
            - 'yes'
            - 'no'
          example: buy
        price:
          type: number
          example: 0.65
        size:
          type: number
          example: 100
        timestamp:
          type: number
          description: Unix timestamp in seconds
          example: 1704067200
        outcome:
          type: string
          example: 'Yes'
        taker:
          type: boolean
          example: true
        transaction_hash:
          type: string
          example: 0x456def...
        user:
          $ref: '#/components/schemas/TradeUser'
        metadata:
          type: object
          additionalProperties:
            nullable: true
      required:
        - trade_id
        - market_id
        - platform
        - side
        - price
        - size
        - timestamp
    Pagination:
      type: object
      properties:
        total:
          type: number
          example: 50
        limit:
          type: number
          example: 50
        has_more:
          type: boolean
          example: true
        next_cursor:
          type: string
          nullable: true
          example: WzMsW1swLDEsM11dXQ
      required:
        - total
        - limit
        - has_more
        - next_cursor
    TradeUser:
      type: object
      properties:
        name:
          type: string
          example: trader123
        pseudonym:
          type: string
          example: Anonymous Trader
        profile_image:
          type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````