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

# /kalshi/markets/history

> Get OHLC price-history candlesticks for a prediction-market contract over a time window

**Price:** 10 credits per 1 results

**⚠️ Common errors:** 412: Market not found



## OpenAPI

````yaml /openapi/finance-markets.json post /api/kalshi/markets/history
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/kalshi/markets/history:
    post:
      tags:
        - /kalshi
      summary: /kalshi/markets/history
      description: >-
        Get OHLC price-history candlesticks for a prediction-market contract
        over a time window


        **Price:** 10 credits per 1 results


        **⚠️ Common errors:** 412: Market not found
      operationId: __api_kalshi_markets_history_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KalshiMarketHistoryPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KalshiCandlestick'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    KalshiMarketHistoryPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        series_ticker:
          type: string
          minLength: 1
        ticker:
          type: string
          minLength: 1
        start_ts:
          type: integer
          minimum: 0
        end_ts:
          type: integer
          minimum: 0
        period_interval:
          $ref: '#/components/schemas/KalshiCandleInterval'
      type: object
      required:
        - series_ticker
        - ticker
        - start_ts
        - end_ts
        - period_interval
    KalshiCandlestick:
      properties:
        '@type':
          type: string
          default: KalshiCandlestick
        end_period_at:
          type: integer
        open:
          anyOf:
            - type: number
            - type: 'null'
        high:
          anyOf:
            - type: number
            - type: 'null'
        low:
          anyOf:
            - type: number
            - type: 'null'
        close:
          anyOf:
            - type: number
            - type: 'null'
        mean:
          anyOf:
            - type: number
            - type: 'null'
        previous:
          anyOf:
            - type: number
            - type: 'null'
        volume:
          anyOf:
            - type: integer
            - type: 'null'
        open_interest:
          anyOf:
            - type: integer
            - type: 'null'
        yes_bid:
          anyOf:
            - $ref: '#/components/schemas/KalshiCandlestickOHLC'
            - type: 'null'
        yes_ask:
          anyOf:
            - $ref: '#/components/schemas/KalshiCandlestickOHLC'
            - type: 'null'
      type: object
      required:
        - end_period_at
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    KalshiCandleInterval:
      type: integer
      enum:
        - 1
        - 60
        - 1440
    KalshiCandlestickOHLC:
      properties:
        '@type':
          type: string
          default: KalshiCandlestickOHLC
        open:
          anyOf:
            - type: number
            - type: 'null'
        high:
          anyOf:
            - type: number
            - type: 'null'
        low:
          anyOf:
            - type: number
            - type: 'null'
        close:
          anyOf:
            - type: number
            - type: 'null'
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````