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

# Get Price History

> Retrieve historical price data for a specific token over a given time interval.



## OpenAPI

````yaml /prediction-market-data-reference/openapi.json get /api/workflows/polymarket/getPriceHistory
openapi: 3.1.0
info:
  title: Prediction Market Data API
  description: >-
    Comprehensive API endpoints for querying data from prediction markets
    supported via workflows.
  version: 1.0.0
  contact:
    name: Swaps.xyz
    url: https://swaps.xyz
servers:
  - url: https://api-v2.swaps.xyz
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /api/workflows/polymarket/getPriceHistory:
    get:
      summary: Get Price History
      description: >-
        Retrieve historical price data for a specific token over a given time
        interval.
      operationId: getPriceHistory
      parameters:
        - name: clobTokenId
          in: query
          required: true
          description: CLOB token ID
          schema:
            type: string
          example: >-
            47380452228751713070322726097676074449505499789775322838989368264459427079864
        - name: interval
          in: query
          required: true
          description: Time interval for price history
          schema:
            type: string
            enum:
              - 1hr
              - 1d
              - 1w
              - 1m
              - max
          example: 1d
      responses:
        '200':
          description: Price history data
          content:
            application/json:
              schema:
                type: object
                required:
                  - history
                properties:
                  history:
                    type: array
                    items:
                      type: object
                      required:
                        - t
                        - p
                      properties:
                        t:
                          type: integer
                          description: Unix timestamp
                          example: 1735689600
                        p:
                          type: number
                          format: float
                          description: Price at timestamp
                          example: 0.52
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: Bad request due to missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
        code:
          type: integer
          description: Error code
        details:
          type: object
          description: Additional error details
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Contact Swaps.xyz to obtain an API key.

````