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

# Polymarket Market Price History API — All Tokens in One Market

> Get the full price history (probabilities from 0.0 to 1.0) for **all** outcomes of one market in a single request.

Use this when you want a market-wide price series — for example charting how a Yes/No market repriced over its life. One call returns every token, so you do not need to know token IDs in advance.

**When to use the token-scoped route instead:** if you already hold a CLOB token id and want only that one series, use `/v1/tokens/{token_id}/prices`. It returns a single token and is the cheaper call for that case.

**Pagination limits:**
- Default `limit`: 100 points per page
- Maximum `limit`: 200 points per page
- Use `cursor` from `metadata.next_cursor` to fetch the next page

**Aggregation:** Prices are averaged when aggregating to higher resolutions.

**Format:** JSON only. Covers Polymarket crypto and sports markets from the PolyOrderbooks historical archive.



## OpenAPI

````yaml /openapi.json get /v1/markets/{id_or_slug}/prices
openapi: 3.1.0
info:
  title: PolyOrderbooks API
  description: >
    # PolyOrderbooks API


    Historical Polymarket **crypto** and **sports** market data — discovery,
    prices, liquidity metrics, and L2 order books. Read paths query our
    historical data store; they never call Polymarket live.


    ## Categories


    `api.polyorderbooks.com` serves **crypto** and **sports** from one API. Pass
    `category=crypto`

    or `category=sports` to pin a request to one archive, or omit it for the
    union of both,

    ordered by `updated_at` across archives.


    ## Base URL


    `https://api.polyorderbooks.com`


    ## Authentication


    All `/v1/*` data routes require an API key.


    Send `X-API-Key: pob_…` or `Authorization: Bearer pob_…`. Dashboard JWT
    session tokens are **not** accepted on data routes.


    ## Plans (hosted)


    | Plan | Req/min | Req/day | Finest resolution | History |

    | --- | --- | --- | --- | --- |

    | Starter | 60 | 1,000 | 250ms | 3 days |

    | Pro | 300 | 50,000 | 250ms | 30 days |


    ## Workflow


    1. `GET /v1/markets` — discover

    2. `GET /v1/markets/{id_or_slug}` — detail

    3. `GET /v1/markets/{id_or_slug}/books` — history
  version: 0.1.0
servers:
  - url: https://api.polyorderbooks.com
    description: Production
security: []
tags:
  - name: Discovery
    description: >-
      Discover series, events, and markets. Use returned ids or slugs in History
      endpoints.
  - name: History
    description: Historical metrics, prices, and L2 order book snapshots.
  - name: Utility
    description: Usage and account metadata.
  - name: Backtest AI
    description: Natural-language and Strategy Builder backtesting over resolved markets.
paths:
  /v1/markets/{id_or_slug}/prices:
    get:
      tags:
        - History
      summary: Get price history for every token in a market
      description: >-
        Get the full price history (probabilities from 0.0 to 1.0) for **all**
        outcomes of one market in a single request.


        Use this when you want a market-wide price series — for example charting
        how a Yes/No market repriced over its life. One call returns every
        token, so you do not need to know token IDs in advance.


        **When to use the token-scoped route instead:** if you already hold a
        CLOB token id and want only that one series, use
        `/v1/tokens/{token_id}/prices`. It returns a single token and is the
        cheaper call for that case.


        **Pagination limits:**

        - Default `limit`: 100 points per page

        - Maximum `limit`: 200 points per page

        - Use `cursor` from `metadata.next_cursor` to fetch the next page


        **Aggregation:** Prices are averaged when aggregating to higher
        resolutions.


        **Format:** JSON only. Covers Polymarket crypto and sports markets from
        the PolyOrderbooks historical archive.
      operationId: get_market_prices_v1_markets__id_or_slug__prices_get
      parameters:
        - name: id_or_slug
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            description: Market ID or market slug.
            examples:
              - '618831'
            title: Id Or Slug
          description: Market ID or market slug.
        - name: start_ts
          in: query
          required: true
          schema:
            type: string
            description: Inclusive range start. Accepts ISO 8601 timestamp or Unix seconds.
            examples:
              - '2025-09-01T00:00:00Z'
              - '1756684800'
            title: Start Ts
          description: Inclusive range start. Accepts ISO 8601 timestamp or Unix seconds.
        - name: end_ts
          in: query
          required: true
          schema:
            type: string
            description: Exclusive range end. Accepts ISO 8601 timestamp or Unix seconds.
            examples:
              - '2025-09-05T00:00:00Z'
              - '1757030400'
            title: End Ts
          description: Exclusive range end. Accepts ISO 8601 timestamp or Unix seconds.
        - name: resolution
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/Resolution'
            description: Aggregation bucket size.
          description: Aggregation bucket size.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: >-
              Maximum number of points to return in this page. Default: 100,
              max: 200.
            examples:
              - 100
            default: 100
            title: Limit
          description: >-
            Maximum number of points to return in this page. Default: 100, max:
            200.
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque cursor from a previous response metadata.next_cursor.
            title: Cursor
          description: Opaque cursor from a previous response metadata.next_cursor.
        - name: category
          in: query
          required: false
          schema:
            type: string
            enum:
              - crypto
              - sports
            description: >-
              Restrict results to one category. Omit to search every category
              this deployment holds.
            title: Category
          description: >-
            Restrict results to one category. Omit to search every category this
            deployment holds.
      responses:
        '200':
          description: Historical prices for all tokens in the market.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricesResponseAllTokens'
        '400':
          description: >-
            Invalid timestamp format, limit, cursor, or market point
            constraints.
          content:
            application/json:
              examples:
                invalid_limit:
                  value:
                    error: bad_request
                    message: 'limit too large. Requested: 250, Maximum: 200'
                small_limit:
                  value:
                    error: bad_request
                    message: 'limit too small for this market. Minimum required: 3'
                many_tokens:
                  value:
                    error: bad_request
                    message: >-
                      Market has more than 200 tokens. Use
                      /v1/tokens/{token_id}/prices instead.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: API key is missing, invalid, or expired.
          content:
            application/json:
              example:
                error: unauthorized
                message: Invalid or expired API key.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Plan does not allow the requested data point, granularity, or date
            range.
          content:
            application/json:
              example:
                error: forbidden
                message: Your plan does not allow historical order books.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource (market or token) was not found.
          content:
            application/json:
              examples:
                market:
                  value:
                    error: not_found
                    message: 'Market not found: 618831'
                token:
                  value:
                    error: not_found
                    message: 'Token not found: 12345'
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error for one or more request parameters.
          content:
            application/json:
              example:
                detail:
                  - loc:
                      - query
                      - resolution
                    msg: >-
                      Unsupported resolution '2m'. Allowed: 250ms, 1s, 60s, 1m,
                      5m, 10m, 15m, 1h, 6h, 1d
                    type: enum
        '429':
          description: Rate limit exceeded for the current API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: rate_limited
                message: Rate limit exceeded. Please try again later.
        '500':
          description: Unexpected server-side error.
          content:
            application/json:
              example:
                error: internal_error
                message: Failed to fetch data.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Resolution:
      type: string
      enum:
        - 250ms
        - 1s
        - 1m
        - 5m
        - 10m
        - 15m
        - 1h
        - 6h
        - 1d
      title: Resolution
      description: Supported time resolutions for historical endpoints.
    PricesResponseAllTokens:
      properties:
        market_id:
          type: string
          title: Market Id
          description: Canonical market ID.
          examples:
            - '618831'
        resolution:
          type: string
          title: Resolution
          description: Applied resolution.
          examples:
            - 1h
        tokens:
          additionalProperties:
            type: string
          type: object
          title: Tokens
          description: Mapping of token label to token ID.
          examples:
            - 'No': '12346'
              'Yes': '12345'
        data:
          additionalProperties:
            items:
              $ref: '#/components/schemas/PriceDataPoint'
            type: array
          type: object
          title: Data
          description: Time series points grouped by token label.
        metadata:
          $ref: '#/components/schemas/HistoryPageMetadata'
          description: Pagination metadata for this history page.
      type: object
      title: PricesResponseAllTokens
      description: Response for `GET /markets/{id_or_slug}/prices`.
      example:
        data:
          'No':
            - p: 0.29
              t: '2025-09-05T10:00:00Z'
            - p: 0.27
              t: '2025-09-05T11:00:00Z'
          'Yes':
            - p: 0.71
              t: '2025-09-05T10:00:00Z'
            - p: 0.73
              t: '2025-09-05T11:00:00Z'
        market_id: '618831'
        metadata:
          count: 4
          limit: 100
        resolution: 1h
        tokens:
          'No': '12346'
          'Yes': '12345'
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: Stable machine-readable code. Branch on this, not on `message`.
          examples:
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - rate_limited
        message:
          type: string
          title: Message
          description: Human-readable explanation, usually naming the offending value.
          examples:
            - >-
              Unsupported resolution '30s'. Allowed: 250ms, 1s, 60s, 1m, 5m,
              10m, 15m, 1h, 6h, 1d
      required:
        - error
        - message
      type: object
      title: ErrorResponse
      description: Error envelope returned for every 4xx and 5xx response.
    PriceDataPoint:
      properties:
        t:
          type: string
          format: date-time
          title: T
          description: Bucket timestamp in ISO 8601 format.
          examples:
            - '2025-09-05T12:00:00Z'
        p:
          type: number
          title: P
          description: Token price/probability between 0.0 and 1.0.
          examples:
            - 0.73
      type: object
      title: PriceDataPoint
      description: Single token price data point.
    HistoryPageMetadata:
      properties:
        count:
          type: integer
          title: Count
          description: Number of points returned in this page.
        limit:
          type: integer
          title: Limit
          description: Effective page limit used for this response.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Opaque cursor for the next page. Null when the page is complete.
      type: object
      title: HistoryPageMetadata
      description: Pagination metadata for history responses.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.