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

# Get market price history

> Returns OHLC price history data for one or more markets. Supports configurable time intervals and includes bid/ask spread data.



## OpenAPI

````yaml GET /v1/api/markets/price-history
openapi: 3.1.0
info:
  title: Dot Prediction API
  description: >-
    A unified API for accessing prediction market data across Kalshi,
    Polymarket, and Limitless.
  version: 1.0.0
servers:
  - url: https://api.dotprediction.io
security:
  - apiKey: []
paths:
  /v1/api/markets/price-history:
    get:
      tags:
        - Markets
      summary: Get market price history
      description: >-
        Returns OHLC price history data for one or more markets. Supports
        configurable time intervals and includes bid/ask spread data.
      operationId: getMarketPriceHistory
      parameters:
        - name: market_ids
          in: query
          required: true
          description: Comma-separated list of market IDs (maximum 10).
          schema:
            type: string
        - name: start_ts
          in: query
          required: true
          description: Start timestamp (Unix epoch).
          schema:
            type: integer
            format: int64
        - name: end_ts
          in: query
          required: true
          description: End timestamp (Unix epoch).
          schema:
            type: integer
            format: int64
        - name: provider
          in: query
          required: true
          description: The prediction market platform to query.
          schema:
            type: string
            enum:
              - kalshi
              - polymarket
              - limitless
        - name: interval
          in: query
          required: false
          description: >-
            Candlestick interval in minutes. `1` = 1 minute, `60` = 1 hour,
            `1440` = 1 day.
          schema:
            type: integer
            enum:
              - 1
              - 60
              - 1440
        - name: limit
          in: query
          required: false
          description: Maximum number of data points to return (max 5000).
          schema:
            type: integer
            maximum: 5000
      responses:
        '200':
          description: Price history data points.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketPriceHistoryResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    MarketPriceHistoryResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PriceHistoryPoint'
        meta:
          type: object
          properties:
            total_points:
              type: integer
            platforms:
              type: array
              items:
                type: string
            time_range:
              type: object
              properties:
                start:
                  type: integer
                  format: int64
                end:
                  type: integer
                  format: int64
            interval:
              type: string
            request_time:
              type: integer
            cache_hit:
              type: boolean
            data_freshness:
              type: string
    PriceHistoryPoint:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
          description: Unix timestamp.
        platform:
          type: string
        marketId:
          type: string
        volume:
          type: number
        openInterest:
          type: number
        outcomeId:
          type: string
        price:
          $ref: '#/components/schemas/OHLCPrice'
          description: OHLC price data.
        bidAsk:
          type: object
          properties:
            bid:
              $ref: '#/components/schemas/OHLCPrice'
            ask:
              $ref: '#/components/schemas/OHLCPrice'
          description: OHLC bid/ask spread data.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
            message:
              type: string
              description: Human-readable error message.
            resolution:
              type: string
              description: Suggested action to resolve the error.
            error_text:
              type: string
              description: Detailed error information.
    OHLCPrice:
      type: object
      properties:
        open:
          type: number
        high:
          type: number
        low:
          type: number
        close:
          type: number
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded. Check the `Retry-After` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Generate one via the dashboard or the
        `/v1/api/auth/api-keys` endpoint.

````