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

# Get market statistics

> Measure trading activity for selected Rook listings over 1h, 24h, 7d or lifetime. The response identifies the actual window, units, currency, source and calculation method for each statistic.

Market-level values retain a scope_key so a client selecting YES and NO listings does not count the same underlying volume twice. Traded quantity, traded notional, open interest and liquidity are distinct measures; unavailable fields are explicit. Use /trades for the execution records behind activity measures and /orderbooks for current depth.

See the [integration guide](/guides/market-data) for the workflow and interpretation of this response.


## OpenAPI

````yaml GET /market-stats
openapi: 3.1.0
info:
  title: Rook API
  version: 0.1.0-design
  description: Markets, settlement relationships, scenarios, payouts and market data.
servers:
  - url: https://api.rook.pm/v1
    description: Proposed API origin; not an assertion these operations are callable.
security:
  - ApiKeyBearer: []
tags:
  - name: Reference data
    description: Events, unified markets and native-ID resolution.
  - name: Families and scenarios
    description: Family scope and versioned scenario columns.
  - name: Relationships and Combos
    description: Related-market discovery, selected-set inference and Combo interpretation.
  - name: Payouts and exposure
    description: Scoped per-unit payouts and stateless portfolio/candidate calculations.
  - name: Market data
    description: Current prices, history, L2 books, prints, statistics and published fees.
  - name: Fair values
    description: Future private customer estimates; not Rook forecasts.
  - name: Coverage and updates
    description: Supported capabilities and incremental semantic changes.
paths:
  /market-stats:
    get:
      tags:
        - Market data
      summary: Get market statistics
      description: >-
        Measure trading activity for selected Rook listings over 1h, 24h, 7d or
        lifetime. The response identifies the actual window, units, currency,
        source and calculation method for each statistic.


        Market-level values retain a scope_key so a client selecting YES and NO
        listings does not count the same underlying volume twice. Traded
        quantity, traded notional, open interest and liquidity are distinct
        measures; unavailable fields are explicit. Use /trades for the execution
        records behind activity measures and /orderbooks for current depth.
      operationId: getMarketStats
      parameters:
        - name: listing_ids
          in: query
          required: true
          description: >-
            Rook listing IDs from /markets or /markets:resolve. Select the venue
            and outcome side explicitly; repeat the query parameter for multiple
            listings.
          schema:
            type: array
            items:
              type: string
              description: Opaque text identifier. Preserve its exact value.
              minLength: 1
            minItems: 1
          style: form
          explode: true
          example:
            - lst_pm_fed_dec_2026_cut_yes
        - name: window
          in: query
          required: true
          description: >-
            Statistics window ending at the response observation time: 1h, 24h,
            7d or lifetime.
          schema:
            type: string
            enum:
              - 1h
              - 24h
              - 7d
              - lifetime
          example: 24h
        - name: X-Client-Request-Id
          in: header
          required: false
          schema:
            type: string
          description: Caller correlation reference; not an idempotency guarantee.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketStatsResponse'
              example:
                items:
                  - listing_id: lst_pm_fed_dec_2026_cut_yes
                    window: 24h
                    window_start: '2026-10-18T12:00:00Z'
                    window_end: '2026-10-19T12:00:00Z'
                    statistics:
                      - name: traded_quantity
                        value: '82000'
                        unit: shares
                        currency: null
                        scope_key: pm_demo_fed_dec_cut_market
                        source: polymarket
                        method: Sum of execution quantities in the window.
                        as_of: '2026-10-19T12:00:00Z'
                      - name: traded_notional
                        value: '33620'
                        unit: currency
                        currency: USDC
                        scope_key: pm_demo_fed_dec_cut_market
                        source: polymarket
                        method: Sum of price times quantity in the window.
                        as_of: '2026-10-19T12:00:00Z'
                      - name: trade_count
                        value: '74'
                        unit: executions
                        currency: null
                        scope_key: pm_demo_fed_dec_cut_market
                        source: polymarket
                        method: Distinct execution records in the window.
                        as_of: '2026-10-19T12:00:00Z'
                      - name: vwap
                        value: '0.41'
                        unit: USDC per share
                        currency: USDC
                        scope_key: pm_demo_fed_dec_cut_market
                        source: polymarket
                        method: Traded notional divided by traded quantity.
                        as_of: '2026-10-19T12:00:00Z'
                next_page_token: null
                snapshot_id: snap_rates_20261019_120000
                as_of: '2026-10-19T12:00:00Z'
          headers:
            X-Request-Id:
              description: Server request trace ID.
              schema:
                type: string
                description: Opaque text identifier. Preserve its exact value.
                minLength: 1
components:
  schemas:
    GetMarketStatsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/MarketStats'
        next_page_token:
          type: 'null'
          description: >-
            All requested IDs are accounted for in one bounded batch; no silent
            truncation.
        snapshot_id:
          type: string
          description: Opaque text identifier. Preserve its exact value.
          minLength: 1
        as_of:
          type: string
          format: date-time
      required:
        - items
        - next_page_token
        - snapshot_id
        - as_of
      additionalProperties: true
    MarketStats:
      type: object
      properties:
        listing_id:
          type: string
          minLength: 1
          description: >-
            Rook ID for one outcome listing on one venue; preserves venue
            provenance.
        window:
          type: string
        window_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        window_end:
          type: string
          format: date-time
        statistics:
          type: array
          items:
            $ref: '#/components/schemas/Statistic'
      required:
        - listing_id
        - window
        - window_start
        - window_end
        - statistics
      additionalProperties: true
    Statistic:
      type: object
      properties:
        name:
          type: string
        value:
          anyOf:
            - $ref: '#/components/schemas/Decimal'
            - type: 'null'
        unit:
          type: string
        currency:
          anyOf:
            - type: string
            - type: 'null'
        scope_key:
          type: string
          description: Opaque text identifier. Preserve its exact value.
          minLength: 1
        source:
          type: string
        method:
          type: string
        as_of:
          type: string
          format: date-time
        reason:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - name
        - value
        - unit
        - scope_key
        - source
        - method
        - as_of
      additionalProperties: true
    Decimal:
      type: string
      description: >-
        Exact base-10 value encoded as a string; no exponent or non-finite
        values.
      pattern: ^-?(0|[1-9][0-9]*)(\.[0-9]+)?$
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      description: >-
        Proposed server-to-server API key. No client request HMAC signing scheme
        is specified.

````

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