> ## 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 price history for markets

> Fetch historical price data (OHLC candlesticks) for one or more markets



## OpenAPI

````yaml openapi.json get /price-history
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:
  /price-history:
    get:
      tags:
        - Markets
      summary: Get price history for markets
      description: Fetch historical price data (OHLC candlesticks) for one or more markets
      operationId: getPriceHistory
      parameters:
        - schema:
            type: string
            description: Comma-separated list of market IDs (max 10)
            example: 524153,KXELONMARS-99
          required: true
          name: market_ids
          in: query
        - schema:
            type: string
            description: Start timestamp (Unix seconds)
            example: '1700000000'
          required: true
          name: start_ts
          in: query
        - schema:
            type: string
            description: End timestamp (Unix seconds)
            example: '1700100000'
          required: true
          name: end_ts
          in: query
        - schema:
            type: string
            enum:
              - '1'
              - '60'
              - '1440'
            description: >-
              Time interval in minutes. Supported: 1 (1 minute), 60 (1 hour),
              1440 (1 day)
            example: '60'
          required: false
          name: interval
          in: query
        - schema:
            type: string
            description: Maximum number of points to return (max 5000)
            example: '1000'
          required: false
          name: limit
          in: query
      responses:
        '200':
          description: Price history data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceHistoryResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    PriceHistoryResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PriceHistoryPoint'
        meta:
          type: object
          properties:
            total_points:
              type: number
              example: 500
            platforms:
              type: array
              items:
                type: string
              example:
                - polymarket
                - kalshi
            time_range:
              type: object
              properties:
                start:
                  type: number
                  example: 1700000000
                end:
                  type: number
                  example: 1700100000
              required:
                - start
                - end
            interval:
              type: string
              example: 1h
            request_time:
              type: number
              example: 250
            cache_hit:
              type: boolean
            data_freshness:
              type: string
          required:
            - total_points
            - platforms
            - time_range
            - interval
            - request_time
      required:
        - data
        - 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
    PriceHistoryPoint:
      type: object
      properties:
        timestamp:
          type: number
          example: 1700000000
        price:
          $ref: '#/components/schemas/OHLCPrice'
        volume:
          type: number
          example: 10000
        openInterest:
          type: number
          example: 5000
        bidAsk:
          $ref: '#/components/schemas/BidAsk'
        platform:
          type: string
          example: kalshi
        marketId:
          type: string
          example: KXELONMARS-99
        outcomeId:
          type: string
          example: 'yes'
      required:
        - timestamp
        - price
        - platform
        - marketId
    OHLCPrice:
      type: object
      properties:
        close:
          type: number
          example: 0.65
        open:
          type: number
          example: 0.6
        high:
          type: number
          example: 0.7
        low:
          type: number
          example: 0.55
      required:
        - close
    BidAsk:
      type: object
      properties:
        bid:
          $ref: '#/components/schemas/OHLCPrice'
        ask:
          $ref: '#/components/schemas/OHLCPrice'
      required:
        - bid
        - ask
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````