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

# Enumerate active markets for a provider (MMC cursor page)

> Returns one cursor-paginated page of the active-market snapshot for a single provider. If the upstream listing is unavailable or the lookup otherwise fails, the route responds `503 Service Unavailable` ("Active market snapshot is temporarily unavailable") rather than fabricating an empty page — this can also happen for an exchange whose listing isn't ready yet. The response echoes back the validated/lowercased `provider` and a `source` field. `next_cursor` is opaque — pass it back verbatim as `cursor` to fetch the next page; `has_more: false` / `next_cursor: null` marks the last page.


Cursor page: pass the returned `next_cursor` back as `cursor`, and stop when `has_more` is `false`.


## OpenAPI

````yaml /openapi/data-api.yaml get /markets/active
openapi: 3.1.0
info:
  title: Kairos Data API
  version: 1.0.0
  summary: >-
    The full Kairos data plane — markets, candles, trades, search, discover,
    sports, trader analytics, and PnL.
  description: |
    The Kairos Data API at `data.kairos.trade` is the platform's primary data
    plane: market metadata and prices, OHLCV candles, live venue trade proxies,
    normalized trade history, full-text search, discovery feeds, the sports
    catalog, public trader analytics, and account PnL.

    ## Authentication

    Most endpoints accept a Kairos **API key** (`X-Client-Id` + `X-Api-Key` +
    `X-Api-Secret`, all three) or a first-party session JWT. Endpoints tagged
    `public` (trader analytics, provider configs, several sports feeds) need
    no credentials at all. Some endpoints additionally require an API-key
    **scope** (`trade:read`, `position:read`) — stated per operation.

    For high-volume market-data consumption (candles/trades/metadata at
    scale), prefer the dedicated **Market Data API** at `md.kairos.trade` —
    it has higher budgets, ETag caching, and a binary candle format.

    ## Rate limits

    Rate limits use a sliding window keyed on the authenticated user (JWT
    `sub`) or, for anonymous callers, the trusted client IP. Routes belong to
    a named **bucket** (`x-kairos-bucket`) whose per-minute budget is shared
    by every route in it; routes with no bucket run under the service default
    of 100/minute. `x-kairos-rate-limit` states the bucket's compile-time
    default — operators can raise or lower a bucket at runtime, so treat the
    documented number as the baseline, not a contract. 429 responses carry
    `Retry-After` and `X-RateLimit-*`.

    ## Conventions

    - Prices are on the **0–100 cents scale** unless a field says otherwise
      (trader-analytics position/trade prices use the 0–1 scale; each field's
      description states its scale).
    - Errors: `{"detail": "<message>"}` for handler errors; FastAPI's
      standard validation envelope for 422s. Errors surfaced from a venue
      adapter instead use `{"error", "provider", "operation", "message"}` —
      see `DataProviderError`. Unhandled failures always return the generic
      500 body; internal details are logged, never returned.
    - Every request body is capped at 8 MiB service-wide (413).
  contact:
    name: Kairos
    url: https://app.kairos.trade/docs/api-reference
  termsOfService: https://kairos.trade/terms
servers:
  - url: https://data.kairos.trade
    description: Production
  - url: https://staging-data.kairos.trade
    description: Staging
security:
  - apiKeyClientId: []
    apiKeyKey: []
    apiKeySecret: []
paths:
  /markets/active:
    get:
      tags:
        - Markets
      summary: Enumerate active markets for a provider (MMC cursor page)
      description: >
        Returns one cursor-paginated page of the active-market snapshot for a
        single provider. If the upstream listing is unavailable or the lookup
        otherwise fails, the route responds `503 Service Unavailable` ("Active
        market snapshot is temporarily unavailable") rather than fabricating an
        empty page — this can also happen for an exchange whose listing isn't
        ready yet. The response echoes back the validated/lowercased `provider`
        and a `source` field. `next_cursor` is opaque — pass it back verbatim as
        `cursor` to fetch the next page; `has_more: false` / `next_cursor: null`
        marks the last page.
      operationId: listActiveMarkets
      parameters:
        - name: provider
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 64
            default: polymarket
          description: >
            Provider/exchange id. Must be an active, known provider or the
            request is rejected with 400.
          example: polymarket
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 250
            default: 100
          example: 100
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            maxLength: 512
          description: Opaque pagination cursor from a previous page's `next_cursor`.
      responses:
        '200':
          description: One page of active markets for the provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketsActivePageResponse'
        '400':
          description: Unknown/inactive provider.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: 'Invalid provider: foobar'
        '401':
          $ref: '#/components/responses/DataUnauthorized'
        '403':
          $ref: '#/components/responses/DataForbidden'
        '422':
          $ref: '#/components/responses/DataValidationError'
        '429':
          $ref: '#/components/responses/DataRateLimited'
        '503':
          description: >-
            No active-market listing is ready for this provider yet, or the
            upstream lookup failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Active market snapshot is temporarily unavailable
components:
  schemas:
    MarketsActivePageResponse:
      type: object
      description: >-
        One page of the active-market listing for a provider, with
        `provider`/`source` stamped on by the API.
      required:
        - exchange_id
        - markets
        - count
        - next_cursor
        - has_more
        - provider
        - source
      properties:
        exchange_id:
          type: string
          description: Lower-cased exchange id the market is listed under.
          example: polymarket
        markets:
          type: array
          items:
            $ref: '#/components/schemas/MarketsActiveMarket'
        count:
          type: integer
          description: Number of markets in this page (`markets.length`).
          example: 100
        next_cursor:
          type:
            - string
            - 'null'
          description: Opaque cursor for the next page, or null if this is the last page.
        has_more:
          type: boolean
        provider:
          type: string
          description: Echo of the validated/lowercased `provider` query param.
          example: polymarket
        source:
          type: string
          description: >-
            Opaque internal origin marker. NOT a stable part of the contract —
            its value may change without notice; do not depend on or switch on
            it.
    MarketsActiveMarket:
      type: object
      description: One market's cached metadata, including its full upstream `raw` payload.
      properties:
        exchange_id:
          type: string
        market_id:
          type: string
        condition_id:
          type: string
        event_id:
          type: string
        title:
          type: string
        neg_risk:
          type: boolean
        tick_size:
          type:
            - number
            - 'null'
        taker_base_fee_bps:
          type:
            - integer
            - 'null'
        fees_enabled:
          type:
            - boolean
            - 'null'
        category:
          type:
            - string
            - 'null'
        group_slug:
          type:
            - string
            - 'null'
        fee_type:
          type:
            - string
            - 'null'
        status:
          type:
            - string
            - 'null'
        image:
          type:
            - string
            - 'null'
        icon:
          type:
            - string
            - 'null'
        end_date:
          type:
            - string
            - 'null'
        open_time:
          type:
            - string
            - 'null'
        outcomes:
          type: array
          items:
            $ref: '#/components/schemas/MarketsActiveMarketOutcome'
        raw:
          type: object
          additionalProperties: true
          description: Full upstream provider payload as last captured.
        resolution_status:
          type: string
          description: Present only once the market has a resolution status recorded.
        payout_numerators:
          type: array
          items:
            type: integer
          description: Present only once CTF payout numerators are known.
        resolved_ts:
          type: string
        proposed_price:
          type: number
        challenge_window_ends_at:
          type: string
    DataError:
      type: object
      description: Handler error envelope (FastAPI HTTPException).
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
          example: Invalid provider
    MarketsActiveMarketOutcome:
      type: object
      properties:
        outcome:
          type: string
          example: 'Yes'
        normalized_outcome:
          type: string
          example: 'yes'
        token_id:
          type: string
        outcome_index:
          type: integer
          description: Present only for exchanges keyed by market_id, index < 2.
        side:
          type: string
          enum:
            - true
            - 'no'
          description: Present only for exchanges keyed by market_id, index < 2.
  responses:
    DataUnauthorized:
      description: >
        No valid credential presented — missing/invalid API-key headers, or an
        invalid/expired session token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataError'
          example:
            detail: Not authenticated
    DataForbidden:
      description: >
        Authenticated but not permitted. Three distinct causes: the session user
        is not invited

        (`Invite required`), the API key lacks the operation's scope, or API-key
        access to the

        requested venue is switched off (`API access is disabled for
        <provider>`). Admin and API-key

        callers bypass the invite check; session and admin callers bypass scope
        and venue checks.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataError'
          example:
            detail: Invite required
    DataValidationError:
      description: Request failed FastAPI parameter validation.
      content:
        application/json:
          schema:
            type: object
            required:
              - detail
            properties:
              detail:
                type: array
                description: >-
                  One entry per failed field, with location, message, and error
                  type.
                items:
                  type: object
                  additionalProperties: true
    DataRateLimited:
      description: >
        Rate limit exceeded for this route's sliding window, keyed on the
        session `sub` when

        authenticated and on the trusted client IP otherwise. Honor
        `Retry-After`. A per-API-key

        data ceiling (set per credential) rejects with `{"detail": "API key data
        rate limit

        exceeded"}` instead of the `error` envelope below.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Rate limit exceeded: 100 per 1 minute'
  securitySchemes:
    apiKeyClientId:
      type: apiKey
      in: header
      name: X-Client-Id
      description: >-
        Credential client id (`kairos_ck_...`). Must be sent together with
        X-Api-Key and X-Api-Secret.
    apiKeyKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 64-char hex API key.
    apiKeySecret:
      type: apiKey
      in: header
      name: X-Api-Secret
      description: 64-char hex API secret.

````

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