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

# List markets

> Paginated list of markets. Walk pages by passing `next_cursor`
back as a query param until the response returns
`next_cursor: "LTE="` (end-of-stream sentinel; NOT `null`).




## OpenAPI

````yaml /api-reference/openapi.yaml get /markets
openapi: 3.0.3
info:
  title: XO Orderbook API
  description: |
    Public REST surface of the XO CLOB API.

    XO mainnet chain id is `3223`. The EIP-712 order domain is
    `XO Market CLOB` with `verifyingContract` set to the
    [CTF Exchange](/) address. See
    [Smart accounts](../guides/smart-accounts) for the smart-account
    identity model and ERC-1271 order signing.

    Wire conventions:
      * Prices are trimmed decimal strings (e.g. `"0.5"`, `"0.555"`).
      * Sizes are decimal-string integers in human shares.
      * Timestamps in trade and book responses are stringified Unix
        seconds / milliseconds (the SDK uses `TimestampSeconds<String>`
        / `TimestampMilliSeconds<String>`).
      * Token IDs are decimal U256 strings; condition IDs are
        `0x`-prefixed 32-byte hex.
  version: 1.0.0
  contact:
    name: XO Market
    url: https://beta.xo.market
servers:
  - url: https://orderbooks.xo.market
    description: Mainnet (XO chain id 3223)
security: []
tags:
  - name: Authentication
    description: >-
      Create and manage API keys. The L1 ClobAuth EIP-712 flow mints HMAC
      credentials that authenticate every other private request.
  - name: Market Data
    description: >-
      Public reads for books, prices, midpoints, spreads, last trades, and price
      history. Also includes server time and per-token configuration.
  - name: Markets
    description: >-
      Discovery for tradable markets, including pagination and SDK-compatible
      simplified shapes.
  - name: Trade
    description: Place, cancel, and inspect orders and trades for the authenticated maker.
  - name: Account
    description: Maker balance, allowance, positions, and claimable settled positions.
paths:
  /markets:
    get:
      tags:
        - Markets
      summary: List markets
      description: |
        Paginated list of markets. Walk pages by passing `next_cursor`
        back as a query param until the response returns
        `next_cursor: "LTE="` (end-of-stream sentinel; NOT `null`).
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            type: integer
        - in: query
          name: next_cursor
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketsPage'
              examples:
                first_page:
                  summary: >-
                    first page (real shape from dev — pass `next_cursor` back to
                    paginate)
                  value:
                    limit: 100
                    count: 100
                    next_cursor: MTAw
                    data:
                      - condition_id: >-
                          0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb
                        tokens:
                          - token_id: >-
                              26516164265702901957933644848127860370782874751279270726689263951695181556943
                            outcome: 'Yes'
                            price: '0.5'
                          - token_id: >-
                              13730057904096984444199595880113152612639388204530324084054099203558669491245
                            outcome: 'No'
                            price: '0.5'
                        minimum_tick_size: 0.001
                        neg_risk: false
                        active: true
                      - condition_id: >-
                          0x4964fda3ba21713ea3ddd5c53e0061a695de4c9d5bd9743a8c8869b403f45d19
                        tokens:
                          - token_id: >-
                              104917912328586649182698603539137223011377182890747775468687635509771644211885
                            outcome: 'Yes'
                            price: '0.2'
                          - token_id: >-
                              54918778642903045521984667581133172019764154413366649039063773052788130028709
                            outcome: 'No'
                            price: '0.2'
                        minimum_tick_size: 0.001
                        neg_risk: false
                        active: false
                last_page:
                  summary: 'last page (`next_cursor: "LTE="` end-of-stream sentinel)'
                  value:
                    limit: 100
                    count: 27
                    next_cursor: LTE=
                    data:
                      - condition_id: >-
                          0xfb6344dfeb96819647e34603595733c2666e3b26fb70b207732f15d7e42ce09f
                        tokens:
                          - token_id: >-
                              25150076356755698896574043017974161452354242680008876696147914849853879915892
                            outcome: 'Yes'
                            price: '0.000'
                          - token_id: >-
                              99307581862032710106801147516675147845001860989706118423548290908308879014956
                            outcome: 'No'
                            price: '0.000'
                        minimum_tick_size: 0.001
                        neg_risk: false
                        active: false
      x-codeSamples:
        - lang: Rust
          label: xo-orderbook-client-rs
          source: >
            use xo_orderbook_client::orderbook::{Client, Config};


            let client = Client::new("https://orderbooks.xo.market",
            Config::default())?;


            // Single page:

            let page = client.markets(None).await?;

            println!("{} markets, next_cursor={}", page.count,
            page.next_cursor);


            // Walk every page via the SDK's stream helper:

            use futures::StreamExt as _;

            let mut stream = client.stream_data(|cursor|
            client.markets(cursor));

            while let Some(market) = stream.next().await {
                let market = market?;
                // ...
            }
components:
  schemas:
    MarketsPage:
      type: object
      required:
        - limit
        - count
        - next_cursor
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MarketObject'
        next_cursor:
          type: string
          description: |
            Base64-encoded offset cursor. Pass back as `next_cursor` on the
            next request. The literal string `"LTE="` is the canonical
            CLOB end-of-stream sentinel — when the gateway returns it,
            there are no more pages. Empty string is also accepted by
            SDKs for first-page requests. NOT nullable — always a string.
        count:
          type: integer
          description: >-
            Number of items in this page (may equal `limit` mid-stream, smaller
            on the final page).
        limit:
          type: integer
          description: Page size requested (default 100, max 500).
    MarketObject:
      type: object
      required:
        - condition_id
        - tokens
        - minimum_tick_size
        - neg_risk
        - active
      properties:
        condition_id:
          type: string
        tokens:
          type: array
          minItems: 2
          maxItems: 2
          items:
            $ref: '#/components/schemas/MarketTokenObject'
        minimum_tick_size:
          type: number
          example: 0.001
        neg_risk:
          type: boolean
        active:
          type: boolean
    MarketTokenObject:
      type: object
      required:
        - token_id
        - outcome
        - price
      properties:
        token_id:
          type: string
        outcome:
          type: string
          enum:
            - true
            - false
        price:
          type: string
          description: |
            Midpoint of this token's book; falls back to last-trade
            price; falls back to `"0.000"`.

````