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

# Multi-series OHLCV for grouped Polymarket event

> Returns one candle series per market in a grouped Polymarket event (e.g. each World Cup country option). Each series includes groupItemTitle, market title, and OHLCV bars normalized to Yes-token prices.



## OpenAPI

````yaml /prediction-markets/openapi.json get /v1/events/{event_id}/candlesticks
openapi: 3.1.0
info:
  title: Prediction Market API (Beta)
  description: >-
    Unified **beta** prediction market API for Kalshi and Polymarket — markets,
    events, full historical trades and candlesticks, orderbooks, crypto up/down
    windows, and Polymarket wallet analytics. Read/market-data only.


    **Auth:** pass your Data API key in the `x-api-key` header.


    **Conventions:** response bodies use camelCase. Query params are snake_case
    (camelCase aliases accepted where noted).


    **Caching:** SWR endpoints may set `X-Cache` (`HIT` | `HIT-STALE` | `MISS`).
    Busy backends may return `503` with `SERVICE_BUSY`.


    **Realtime:** join `pm:*` rooms on
    `wss://datastream.solanatracker.io/{apiKey}` (same Datastream hub as other
    products — see Datastream → Prediction Markets).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://prediction-market-api.solanatracker.io
    description: Public beta
security:
  - apiKey: []
tags:
  - name: Exchange
    description: Exchange status
  - name: Events
    description: >-
      Cross-exchange event groupings (Kalshi event_ticker, Polymarket Gamma
      grouped/negRisk events). Includes metadata: image, icon, description,
      tags, and nested markets with groupItemTitle.
  - name: Crypto
    description: >-
      Polymarket crypto up/down (Chainlink) Price to Beat, final price, chart
      history, and series windows.
  - name: Meta
    description: Categories, series, sports, live data
  - name: Markets
    description: Market data, orderbooks, candles
  - name: Trades
    description: Trade feeds
  - name: Accounts
    description: Polymarket wallet analytics (FIFO PnL)
  - name: Leaderboard
    description: Top wallet PnL rankings (Polymarket; Kalshi has no public wallets)
  - name: Stats
    description: Platform statistics
paths:
  /v1/events/{event_id}/candlesticks:
    get:
      tags:
        - Events
      summary: Multi-series OHLCV for grouped Polymarket event
      description: >-
        Returns one candle series per market in a grouped Polymarket event (e.g.
        each World Cup country option). Each series includes groupItemTitle,
        market title, and OHLCV bars normalized to Yes-token prices.
      operationId: get_event_candlesticks_path
      parameters:
        - name: event_id
          in: path
          description: Polymarket id (30615), POLY-30615, or slug
          required: true
          schema:
            type: string
        - name: exchange
          in: query
          description: Force exchange lookup; auto-detect if omitted
          required: false
          schema:
            type: string
        - name: period_interval
          in: query
          description: 1m, 1h, or 1d (default 1h)
          required: false
          schema:
            type: string
        - name: start_ts
          in: query
          description: Range start (unix s or ms)
          required: false
          schema:
            type: string
        - name: end_ts
          in: query
          description: Range end
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Max candles per series (default 200, max 2000)
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: cursor
          in: query
          description: Pagination cursor for older bars
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: 'Market filter: all (default), active, closed, or inactive'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Per-option candle series
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventCandlesticksResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
components:
  schemas:
    EventCandlesticksResponse:
      type: object
      description: >-
        Multi-series OHLCV for a Polymarket grouped event (e.g. World Cup Winner
        options).
      required:
        - eventId
        - exchange
        - title
        - periodInterval
        - series
      properties:
        eventId:
          type: string
          description: Polymarket Gamma event id (numeric string).
        eventSlug:
          type:
            - string
            - 'null'
          description: URL slug for the parent event.
        exchange:
          $ref: '#/components/schemas/Exchange'
        nextCursor:
          type:
            - string
            - 'null'
        periodInterval:
          type: string
          description: 'Candle period: 1m, 1h, or 1d.'
        series:
          type: array
          items:
            $ref: '#/components/schemas/EventCandlestickSeries'
          description: One series per market in the group.
        title:
          type: string
          description: Parent event title.
    ApiErrorBody:
      type: object
      description: Standard API error response envelope.
      required:
        - error
        - code
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code (duplicated for convenience).
          minimum: 0
        error:
          type: string
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code: RATE_LIMITED, SERVICE_BUSY,
            BAD_REQUEST, NOT_FOUND, INTERNAL.
    Exchange:
      type: string
      enum:
        - polymarket
        - kalshi
    EventCandlestickSeries:
      type: object
      description: One market's candle series within a grouped Polymarket event.
      required:
        - marketId
        - title
        - status
        - candles
      properties:
        candles:
          type: array
          items:
            $ref: '#/components/schemas/Candlestick'
          description: OHLCV bars for this market's primary Yes outcome.
        gammaMarketId:
          type:
            - string
            - 'null'
          description: Polymarket Gamma numeric market id.
        groupItemTitle:
          type:
            - string
            - 'null'
          description: Short label within the parent event (e.g. "USA", "France").
        marketId:
          type: string
          description: >-
            Polymarket condition_id or internal market id used for chart
            queries.
        status:
          type: string
          description: 'Market status: "active", "closed", or "inactive".'
        title:
          type: string
          description: Full market question/title.
    Candlestick:
      type: object
      description: A single OHLCV candlestick bar.
      required:
        - timestamp
        - open
        - high
        - low
        - close
        - volume
        - tradeCount
        - ticker
        - exchange
        - periodInterval
      properties:
        close:
          type: number
          format: double
        exchange:
          type: string
        high:
          type: number
          format: double
        low:
          type: number
          format: double
        open:
          type: number
          format: double
        periodInterval:
          type: string
        ticker:
          type: string
        timestamp:
          type: string
          description: Start of the candle period (ISO-8601 or unix seconds).
        tradeCount:
          type: integer
          format: int64
          minimum: 0
        volume:
          type: number
          format: double
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Solana Tracker Data API key

````