openapi: 3.0.3
info:
  title: Polymarket CLOB Timeseries Data API
  version: 1.0.0
  description: |
    The CLOB provides detailed price history for each traded token.

servers:
  - url: https://clob.polymarket.com

paths:
  /prices-history:
    get:
      summary: Get price history for a traded token
      description: |
        Fetches historical price data for a specified market token.
      parameters:
        - name: market
          in: query
          required: true
          schema:
            type: string
          description: The CLOB token ID for which to fetch price history.
        - name: startTs
          in: query
          required: false
          schema:
            type: number
          description: The start time, a Unix timestamp in UTC.
        - name: endTs
          in: query
          required: false
          schema:
            type: number
          description: The end time, a Unix timestamp in UTC.
        - name: interval
          in: query
          required: false
          schema:
            type: string
            enum: [1m, 1w, 1d, 6h, 1h, max]
          description: |
            A string representing a duration ending at the current time. 
            Mutually exclusive with `startTs` and `endTs`.
        - name: fidelity
          in: query
          required: false
          schema:
            type: number
          description: The resolution of the data, in minutes.
      responses:
        '200':
          description: A list of timestamp/price pairs
          content:
            application/json:
              schema:
                type: object
                properties:
                  history:
                    type: array
                    items:
                      type: object
                      properties:
                        t:
                          type: number
                          description: UTC timestamp
                        p:
                          type: number
                          description: Price
