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

# fetch_markets

> List markets, optionally filtered by status, ticker, event, or series.

List markets, optionally filtered by status, ticker, event, or series.


## OpenAPI

````yaml /openpx.openapi.yaml GET /v1/markets/fetch_markets
openapi: 3.1.0
info:
  title: OpenPX Unified API
  description: >-
    Unified API surface across prediction-market exchanges. One `Exchange`
    trait, one set of models, one shape — implemented in Rust with
    auto-generated Python and TypeScript SDKs.


    This OpenAPI spec is **auto-generated** from
    `engine/core/src/exchange/traits.rs` and `schema/openpx.schema.json`. Edit
    the trait or the schema, then regenerate via `just openapi`. The spec models
    trait methods as REST operations for documentation rendering only — OpenPX
    is an in-process Rust library, not a REST service.
  version: 0.3.1
  license:
    name: MIT
servers:
  - url: https://github.com/openpx-trade/openpx
    description: >-
      Documentation surface only. OpenPX is an in-process Rust library; there is
      no hosted REST endpoint.
security: []
tags:
  - name: Markets
  - name: Orders
  - name: Positions
  - name: Balance
  - name: Orderbook
  - name: Trades
  - name: Fills
  - name: Server
paths:
  /v1/markets/fetch_markets:
    get:
      tags:
        - Markets
      summary: Fetch markets
      description: List markets, optionally filtered by status, ticker, event, or series.
      operationId: fetch_markets
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            default: null
            type:
              - string
              - 'null'
          description: Opaque cursor returned by a prior page (e.g. `"eyJvIjoxMDB9"`).
        - name: event_ticker
          in: query
          required: false
          schema:
            default: null
            type:
              - string
              - 'null'
          description: >-
            Fetch all markets in this event — Kalshi event ticker or Polymarket
            event slug (e.g. `"KXBTC-25MAR14"`).
        - name: limit
          in: query
          required: false
          schema:
            format: uint
            minimum: 0
            type:
              - integer
              - 'null'
          description: >-
            Page size; clamped to per-exchange caps (Kalshi 1000, Polymarket
            500) (e.g. `100`).
        - name: market_tickers
          in: query
          required: false
          schema:
            default: []
            items:
              type: string
            type: array
          description: >-
            Fetch only these market tickers — Kalshi tickers or Polymarket slugs
            (e.g. `["KXBTCD-25APR1517"]`).
        - name: series_ticker
          in: query
          required: false
          schema:
            default: null
            type:
              - string
              - 'null'
          description: >-
            Fetch only markets in this Kalshi series ticker (e.g. `"KXBTC"`);
            ignored on Polymarket today.
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/MarketStatusFilter'
              - type: 'null'
            default: null
          description: >-
            Status filter; defaults to `active` (options: `active`, `closed`,
            `resolved`, `all`).
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketsPage'
        default:
          description: Unified error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenPxError'
components:
  schemas:
    MarketStatusFilter:
      description: >-
        Market status filter for `fetch_markets`. Options: `active`, `closed`,
        `resolved`, `all`.
      enum:
        - active
        - closed
        - resolved
        - all
      type: string
    MarketsPage:
      type: object
      description: >-
        One page of `Market` results. `cursor` is `null` on the last page;
        otherwise pass it back in the next request to continue.
      required:
        - markets
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/Market'
        cursor:
          type:
            - string
            - 'null'
    OpenPxError:
      type: object
      description: >-
        Unified error type returned when an exchange call fails. The `kind`
        field is the canonical category; `message` carries the upstream
        explanation. Per-exchange variants are mapped into this shape before
        they cross the trait boundary.
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum:
            - Authentication
            - InsufficientFunds
            - MarketNotFound
            - OrderNotFound
            - RateLimited
            - NetworkError
            - Api
            - Config
            - NotSupported
        message:
          type: string
    Market:
      description: >-
        A prediction market on the unified surface. Prices are YES probabilities
        in `[0, 1]`.
      properties:
        best_ask:
          description: Best ask as YES probability in `[0, 1]` (e.g. `0.63`).
          format: double
          type:
            - number
            - 'null'
        best_bid:
          description: Best bid as YES probability in `[0, 1]` (e.g. `0.61`).
          format: double
          type:
            - number
            - 'null'
        close_time:
          description: Market close time in UTC (e.g. `"2026-04-25T20:00:00Z"`).
          format: date-time
          type:
            - string
            - 'null'
        condition_id:
          description: Polymarket CTF condition id (e.g. `"0xabc..."`); `null` on Kalshi.
          type:
            - string
            - 'null'
        created_at:
          description: Market creation time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        event_ticker:
          description: >-
            Parent event ticker — Kalshi event_ticker or Polymarket event slug
            (e.g. `"KXBTC-25MAR14"`).
          type:
            - string
            - 'null'
        exchange:
          description: 'Source exchange. Options: `kalshi`, `polymarket`.'
          type: string
        last_trade_price:
          description: Last trade price as YES probability in `[0, 1]` (e.g. `0.62`).
          format: double
          type:
            - number
            - 'null'
        market_type:
          allOf:
            - $ref: '#/components/schemas/MarketType'
          description: 'Outcome shape. Options: `binary`, `categorical`, `scalar`.'
        min_order_size:
          description: Minimum order size in contracts (e.g. `1.0`).
          format: double
          type:
            - number
            - 'null'
        neg_risk:
          description: Polymarket neg-risk flag; `null` on Kalshi.
          type:
            - boolean
            - 'null'
        neg_risk_market_id:
          description: Polymarket neg-risk market id; `null` on Kalshi.
          type:
            - string
            - 'null'
        numeric_id:
          description: >-
            Polymarket numeric DB id used for REST deep-links (e.g.
            `"1031769"`); `null` on Kalshi.
          type:
            - string
            - 'null'
        open_time:
          description: Market open time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        openpx_id:
          description: >-
            OpenPX primary key in `<exchange>:<ticker>` form (e.g.
            `"kalshi:KXBTCD-25APR1517"`).
          type: string
        outcomes:
          default: []
          description: >-
            Ordered outcomes; binary markets have two (`"Yes"`, `"No"`),
            categorical have N.
          items:
            $ref: '#/components/schemas/Outcome'
          type: array
        result:
          description: >-
            Winning outcome label after settlement (e.g. `"Yes"`); `null` until
            resolved.
          type:
            - string
            - 'null'
        rules:
          description: Resolution rules in plain text; `null` when upstream omits them.
          type:
            - string
            - 'null'
        settlement_time:
          description: Settlement time in UTC; `null` until the market resolves on-chain.
          format: date-time
          type:
            - string
            - 'null'
        status:
          allOf:
            - $ref: '#/components/schemas/MarketStatus'
          description: 'Lifecycle state. Options: `active`, `closed`, `resolved`.'
        tick_size:
          description: Minimum price increment in dollars (e.g. `0.01`).
          format: double
          type:
            - number
            - 'null'
        ticker:
          description: >-
            Native ticker — Kalshi market ticker or Polymarket slug (e.g.
            `"KXBTCD-25APR1517"`).
          type: string
        title:
          description: >-
            Human-readable market title (e.g. `"Will BTC close above $100k on
            Apr 15?"`).
          type: string
        volume:
          description: Lifetime trading volume in USD (e.g. `12345.67`).
          format: double
          type: number
        volume_24h:
          description: 24-hour trading volume in USD; `null` when upstream omits it.
          format: double
          type:
            - number
            - 'null'
      required:
        - exchange
        - market_type
        - openpx_id
        - status
        - ticker
        - title
        - volume
      type: object
    MarketType:
      description: >-
        Shape of a market's outcomes. Options: `binary`, `categorical`,
        `scalar`.
      enum:
        - binary
        - categorical
        - scalar
      type: string
    Outcome:
      description: One outcome of a prediction market.
      properties:
        label:
          description: Outcome label (e.g. `"Yes"`, `"No"`, or a categorical option name).
          type: string
        price:
          description: >-
            Current price as YES probability in `[0, 1]` (e.g. `0.62`); `null`
            when not yet quoted.
          format: double
          type:
            - number
            - 'null'
        token_id:
          description: >-
            Polymarket CTF token id used for per-outcome orderbook
            subscriptions; `null` on Kalshi.
          type:
            - string
            - 'null'
      required:
        - label
      type: object
    MarketStatus:
      description: 'Market lifecycle state. Options: `active`, `closed`, `resolved`.'
      enum:
        - active
        - closed
        - resolved
      type: string

````