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

# Get Prediction Market OHLCV

> Get OHLCV (candlestick) data for a specific outcome of a prediction market.

<Warning>**Alpha** — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.</Warning>

### Query Parameters

<ParamField query="platform" type="string" required>
  The prediction market platform (e.g., `polymarket`).
</ParamField>

<ParamField query="outcomeId" type="string" required>
  The outcome token ID.
</ParamField>

<ParamField query="period" type="string" default="1h">
  Candle period. Possible values: `1s`, `5s`, `10s`, `1m`, `5m`, `15m`, `1h`, `4h`, `1d`, `1w`.
</ParamField>

<ParamField query="from" type="string | number">
  Start time. Accepts Unix timestamp in **milliseconds** (e.g., `1709913600000`) or ISO 8601 string (e.g., `2024-03-01T00:00:00Z`). If omitted, returns the most recent candles.
</ParamField>

<ParamField query="to" type="string | number">
  End time. Accepts Unix timestamp in **milliseconds** (e.g., `1709913600000`) or ISO 8601 string (e.g., `2024-03-01T00:00:00Z`). Defaults to now.
</ParamField>

<ParamField query="limit" type="number" default="500">
  Maximum number of candles to return (1 to 5000).
</ParamField>

<ParamField query="offset" type="number" default="0">
  Pagination offset (skips this many candles before applying `limit`).
</ParamField>

<ParamField query="offset" type="number" default="0">
  Number of records to skip for pagination.
</ParamField>

### Response

<ResponseField name="data" type="array">
  Array of OHLCV candle objects. Uses the same abbreviated field names as the spot OHLCV endpoint (`/2/token/ohlcv-history`).

  <Expandable title="Candle Object">
    <ResponseField name="t" type="number">Candle open timestamp in milliseconds.</ResponseField>
    <ResponseField name="o" type="number">Open price.</ResponseField>
    <ResponseField name="h" type="number">High price.</ResponseField>
    <ResponseField name="l" type="number">Low price.</ResponseField>
    <ResponseField name="c" type="number">Close price.</ResponseField>
    <ResponseField name="v" type="number">Trading volume in USD.</ResponseField>
    <ResponseField name="tradesCount" type="number">Number of trades in this candle (PM-specific).</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata.

  <Expandable title="Pagination Object">
    <ResponseField name="page" type="number">Current page number (1-based).</ResponseField>
    <ResponseField name="offset" type="number">Number of records skipped.</ResponseField>
    <ResponseField name="limit" type="number">Maximum records per page.</ResponseField>
    <ResponseField name="pageEntries" type="number">Number of records returned in this page.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="hostname" type="string">Server node identifier.</ResponseField>
<ResponseField name="took" type="number">Request processing time in milliseconds.</ResponseField>

### Usage Example

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/pm/market/ohlcv?platform=polymarket&outcomeId=71321...&period=1h&limit=100"
```

### Example Response

```json theme={null}
{
  "data": [
    { "t": 1709910000000, "o": 0.34, "h": 0.36, "l": 0.33, "c": 0.35, "v": 12500, "tradesCount": 45 },
    { "t": 1709913600000, "o": 0.35, "h": 0.37, "l": 0.34, "c": 0.36, "v": 8900, "tradesCount": 32 }
  ],
  "pagination": { "page": 1, "offset": 0, "limit": 500, "pageEntries": 2 },
  "hostname": "node-xyz",
  "took": 42
}
```


## OpenAPI

````yaml GET /2/pm/market/ohlcv
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula Prediction Markets API
  description: >-
    Documentation of the Mobula Prediction Markets API.


    The PM API is currently served from a dedicated host:
    `pm-api-prod-eu.mobula.io`.

    All endpoints below require an API key (same key as the main Mobula API).


    Parameter names below are the **canonical names enforced by the API

    controllers** (Zod-validated). Following the wrong name (e.g. `?market=...`

    instead of `?platform=...&marketId=...`) returns `HTTP 400`.
servers:
  - url: https://pm-api-prod-eu.mobula.io/api/
    description: PM Production API (requires API key)
security: []
tags:
  - name: V2 - PM Market
    description: Prediction market data — details, prices, order book, trades, OHLCV
  - name: V2 - PM Discovery
    description: Search, trending, categories, live markets
  - name: V2 - PM Wallet
    description: Wallet prediction-market positions, balances, PnL, activity, status
paths:
  /2/pm/market/ohlcv:
    get:
      tags:
        - V2 - PM Market
      summary: Get Prediction Market OHLCV
      description: >
        Get OHLCV (candlestick) data for a specific outcome of a prediction
        market.


        Required params: `platform` + `outcomeId`. The candle field is `period`

        (not `resolution`).


        ⚠️ `from` and `to` are in **MILLISECONDS** (not seconds). Passing
        seconds

        silently returns an empty window.
      parameters:
        - $ref: '#/components/parameters/Platform'
        - $ref: '#/components/parameters/OutcomeId'
        - name: period
          in: query
          required: false
          description: Candle resolution.
          schema:
            type: string
            enum:
              - 1s
              - 5s
              - 10s
              - 1m
              - 5m
              - 15m
              - 1h
              - 4h
              - 1d
              - 1w
            default: 1h
        - name: from
          in: query
          required: false
          description: Start time in **Unix milliseconds**.
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: to
          in: query
          required: false
          description: End time in **Unix milliseconds**.
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: limit
          in: query
          required: false
          description: Page size (1-5000).
          schema:
            type: integer
            minimum: 1
            maximum: 5000
            default: 500
        - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: OHLCV candles
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
components:
  parameters:
    Platform:
      name: platform
      in: query
      required: true
      description: >-
        Prediction market platform. Today only `polymarket` is supported; any
        other value returns 400.
      schema:
        type: string
        enum:
          - polymarket
        example: polymarket
    OutcomeId:
      name: outcomeId
      in: query
      required: true
      description: >-
        Polymarket outcome / token ID — uint256 decimal string (the ERC-1155
        token id of the YES/NO/etc. side).
      schema:
        type: string
        pattern: ^[0-9]+$
        example: >-
          59855952379545476461266875939089074481171378466995213858930892770855011813551
    Offset:
      name: offset
      in: query
      required: false
      description: Pagination offset.
      schema:
        type: integer
        minimum: 0
        default: 0

````