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

# List recently resolved markets

> Kalshi and Polymarket resolutions from the resolution read model, newest first, grouped once per event. market_tickers lists all markets in that event. limit defaults to 100 and is capped at 200. source optionally filters one exact resolution source. Pass both next_cursor fields as before_changed_at and before_id to fetch older events, preserving source. A null next_cursor ends pagination. Public resolution data is available to live and test keys. Requires read scope.



## OpenAPI

````yaml api-reference/openapi.json GET /resolution/markets
openapi: 3.0.0
info:
  title: Lean API
  version: 0.1.0
  description: >-
    Programmatic access to Lean: canonical sports markets, quotes, orders,
    positions and balances.
servers:
  - url: '{baseUrl}/v1'
    description: Lean API
    variables:
      baseUrl:
        default: https://api.lean.xyz
        description: >-
          The Lean API base URL, without /v1. Same value as LEAN_API_URL in the
          guides.
security:
  - apiKey: []
paths:
  /resolution/markets:
    get:
      tags:
        - Resolution
      summary: List recently resolved markets
      description: >-
        Kalshi and Polymarket resolutions from the resolution read model, newest
        first, grouped once per event. market_tickers lists all markets in that
        event. limit defaults to 100 and is capped at 200. source optionally
        filters one exact resolution source. Pass both next_cursor fields as
        before_changed_at and before_id to fetch older events, preserving
        source. A null next_cursor ends pagination. Public resolution data is
        available to live and test keys. Requires read scope.
      operationId: listResolutionMarkets
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 100
          required: false
          name: limit
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 128
          required: false
          name: source
          in: query
        - schema:
            type: string
            format: date-time
          required: false
          name: before_changed_at
          in: query
        - schema:
            type: string
            maxLength: 19
            pattern: ^\d+$
          required: false
          name: before_id
          in: query
      responses:
        '200':
          description: Recent event resolutions and pagination cursor
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - true
                      data:
                        type: object
                        properties:
                          livemode:
                            type: boolean
                          markets:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                ticker:
                                  type: string
                                event_ticker:
                                  type: string
                                  nullable: true
                                market_tickers:
                                  type: array
                                  items:
                                    type: string
                                title:
                                  type: string
                                  nullable: true
                                tags:
                                  type: array
                                  items:
                                    type: string
                                category_keys:
                                  type: array
                                  items:
                                    type: string
                                yes_sub_title:
                                  type: string
                                  nullable: true
                                no_sub_title:
                                  type: string
                                  nullable: true
                                venue:
                                  type: string
                                  enum:
                                    - kalshi
                                    - polymarket
                                    - hyperliquid
                                    - polymarket_us
                                    - lighter
                                status:
                                  type: string
                                  enum:
                                    - unopened
                                    - open
                                    - closed
                                    - resolving
                                    - resolved
                                result:
                                  type: string
                                  nullable: true
                                source:
                                  type: string
                                  minLength: 1
                                  maxLength: 128
                                tx_hash:
                                  type: string
                                  nullable: true
                                block_number:
                                  type: number
                                  nullable: true
                                changed_at:
                                  type: string
                                  format: date-time
                              required:
                                - id
                                - ticker
                                - event_ticker
                                - market_tickers
                                - title
                                - tags
                                - category_keys
                                - yes_sub_title
                                - no_sub_title
                                - venue
                                - status
                                - result
                                - source
                                - tx_hash
                                - block_number
                                - changed_at
                          next_cursor:
                            type: object
                            nullable: true
                            properties:
                              before_changed_at:
                                type: string
                                format: date-time
                              before_id:
                                type: string
                                maxLength: 19
                                pattern: ^\d+$
                            required:
                              - before_changed_at
                              - before_id
                        required:
                          - livemode
                          - markets
                          - next_cursor
                      meta:
                        type: object
                        properties:
                          timestampMs:
                            type: integer
                            minimum: 0
                          requestId:
                            type: string
                            minLength: 1
                          traceId:
                            type: string
                            minLength: 1
                          cachedAtMs:
                            type: integer
                            minimum: 0
                          source:
                            type: string
                            enum:
                              - cache
                              - database
                              - clickhouse
                              - upstream
                              - fallback
                              - internal
                        required:
                          - timestampMs
                          - requestId
                    required:
                      - success
                      - data
                      - meta
                  - $ref: '#/components/schemas/ApiError'
        '400':
          description: Invalid filters or incomplete cursor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: Invalid filters or incomplete cursor
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '401':
          description: Missing, invalid, expired or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid, expired or revoked API key
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '403':
          description: The key lacks the scope this route needs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: This API key lacks the scope this route needs
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '429':
          description: API error
          headers:
            Retry-After:
              description: Seconds remaining in the upstream read cooldown, when available
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: RATE_LIMITED
                  message: Too many requests for this API key
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '500':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: INTERNAL_ERROR
                  message: An internal error occurred.
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '503':
          description: Resolution read model is temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: UPSTREAM_ERROR
                  message: Resolution read model is temporarily unavailable
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
components:
  schemas:
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - NOT_FOUND
                - UNAUTHORIZED
                - FORBIDDEN
                - CONFLICT
                - UPSTREAM_ERROR
                - RATE_LIMITED
                - INTERNAL_ERROR
                - FEATURE_DISABLED
                - CONDITIONAL_SELL_REJECTED
                - CONDITIONAL_SELL_ACTIVE
            message:
              type: string
              minLength: 1
            details:
              nullable: true
          required:
            - code
            - message
        meta:
          type: object
          properties:
            timestampMs:
              type: integer
              minimum: 0
            requestId:
              type: string
              minLength: 1
            traceId:
              type: string
              minLength: 1
            cachedAtMs:
              type: integer
              minimum: 0
            source:
              type: string
              enum:
                - cache
                - database
                - clickhouse
                - upstream
                - fallback
                - internal
          required:
            - timestampMs
            - requestId
      required:
        - success
        - error
        - meta
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Lean API key, sent as `Authorization: Bearer <key>`. A test key
        (`lean_sk_test_...`) simulates orders and fills with no money; a live
        key (`lean_sk_live_...`) trades for real within the key's limits. Every
        successful response says which mode answered in `data.livemode`.

````

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