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

# Get a market's rules and their history

> The market's current rule text, the rulebooks in force above it with
their settlement sources, source links and contract terms documents,
every recorded version of the contract (hash, when it was first and
last seen, which fields changed, a unified diff from the version
before, and which rulebooks changed with it), and the ledger of every
change to the market's terms, including rulebook and document changes
under an unchanged contract. Use it to see exactly how a market is
decided, whether that changed since a position was taken, and what
the venue's own terms document says. Works for any market ever
recorded, listed or not.




## OpenAPI

````yaml /openapi.yaml get /v1/markets/{venue}/{id}/rules
openapi: 3.1.0
info:
  title: Routeur Graph API
  version: '2026-09-15'
  summary: >-
    Proven relations between Kalshi and Polymarket contracts, with the history
    and signals built on them.
  description: >
    Routeur reads every open market on Kalshi and global Polymarket, and proves

    which ones imply, exclude or equal each other from each venue's structured

    contract terms and exact arithmetic. No relation is inferred from prose, and

    ambiguous or conflicting evidence is withheld.


    ## Authentication

    Send your key in the `X-API-Key` header, or as `Authorization: Bearer
    <key>`.

    Keys look like `rk_live_<12-character id>_<43-character secret>` and are

    shown once when issued. Keep them server-side.


    ## Rate limits

    Every key has a per-minute limit and a per-day quota set by its tier:


    | Tier | Requests per minute | Requests per day |

    |---|---|---|

    | free | 30 | 2,000 |

    | trader | 120 | 50,000 |

    | pro | 600 | 500,000 |

    | institutional | 3,000 | 10,000,000 |


    Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and

    `X-RateLimit-Reset` (Unix seconds) for the minute window, and

    `X-Daily-Quota-Limit` and `X-Daily-Quota-Remaining` for the day (UTC).

    A request over either limit returns `429` with `Retry-After` in seconds.


    ## Conventions

    - Money and prices are decimal strings in USD (for example `"0.4100"`),
    never
      floats. Prices are per contract that pays $1.
    - Times are RFC 3339 in UTC.

    - Successful responses wrap results in `data`. Graph-derived responses also
      name the `graph_run` they were read from; runs finish hourly.
    - Paginated lists return `next_cursor` when more results exist. Pass it back
      as `cursor` unchanged; cursors are opaque.
    - Unknown or repeated query parameters are rejected with `400`, so typos
    never
      silently widen a query.

    ## Liquidity

    Every object that names a market carries its 24-hour volume, its spread and

    a `liquidity` grade, because a price nobody can trade at is not a price:


    | Grade | 24-hour volume or open interest | Round-trip spread |

    |---|---|---|

    | `deep` | $25,000 traded, or $250,000 open interest | 2¢ or less |

    | `tradeable` | $1,000 traded, or $25,000 open interest | 5¢ or less |

    | `thin` | anything less, or no quoted round trip | |


    Lists that suggest something to act on — price gaps, leads, movers, flows,

    large fills, closing soon, strategy matches — leave thin markets out by

    default, and rank what is left by the money behind it. Three parameters

    change that wherever it applies: `min_volume_usd`, `max_spread_usd` and

    `include_thin=true`, which drops both floors. Search and event listings show

    thin markets but rank them below what can be traded.


    ## Errors

    Errors return a JSON body `{"error": {"code": "...", "message": "..."}}`.

    Branch on `code`; messages may change.


    | Status | Code | Meaning |

    |---|---|---|

    | 400 | `invalid_parameter` | A query parameter is unknown, repeated or out
    of range. |

    | 400 | `invalid_market` | The venue is not `kalshi` or `polymarket`, or the
    market id is malformed. |

    | 400 | `invalid_rulebook` | The venue, rulebook kind or id is malformed. |

    | 401 | `api_key_required` | No key was sent. |

    | 401 | `invalid_api_key` | The key is malformed or unknown. |

    | 401 | `api_key_revoked` | The key was revoked. |

    | 404 | `market_not_found` | The market is not in the latest graph. |

    | 404 | `relation_not_found` | Both markets are listed, but no current proof
    relates them. |

    | 404 | `rulebook_not_found` | No such rulebook has been recorded. |

    | 404 | `book_not_found` | No order book is recorded for the market at that
    time. |

    | 404 | `not_found` | No such endpoint. |

    | 429 | `rate_limited` | The per-minute limit was exceeded. |

    | 429 | `daily_quota_exceeded` | The daily quota is used up. |

    | 429 | `too_many_streams` | The key already holds its concurrent live
    streams. |

    | 503 | `graph_unavailable` | No graph run has finished yet. |

    | 503 | `stream_unavailable` | No live stream capacity is free; retry
    shortly. |

    | 504 | `timeout` | The request took longer than 15 seconds. |

    | 500 | `internal` | Something failed on our side. |


    ## Webhooks

    Mispricing alerts are delivered as signed `POST` requests; see the

    `webhooks` section. Each request carries

    `Routeur-Signature: t=<unix seconds>,v1=<hex>`, where `v1` is

    HMAC-SHA256 of `<t>.<raw body>` keyed by your subscription's signing

    secret. Reject requests whose signature does not match or whose `t` is more

    than five minutes old, and respond `2xx` within 10 seconds.


    `Routeur-Delivery` identifies the delivery and stays the same across
    retries,

    so use it to ignore duplicates. Any response other than `2xx` or `410`, or
    no

    response, is retried with exponential backoff from 30 seconds for up to 8

    attempts; responding `410 Gone` disables the subscription. Endpoints must be

    HTTPS on a public address, and redirects are not followed.
  contact:
    name: Routeur
    url: https://routeur.app
servers:
  - url: https://api.routeur.app
security:
  - apiKey: []
  - bearer: []
tags:
  - name: Events
    description: Real-world events across both venues, the way people browse them.
  - name: Graph
    description: Markets and the relations proven between them.
  - name: History
    description: Recorded quotes and trades.
  - name: Rules
    description: |
      Contract terms and their history. Every version of every market's rule
      text is kept from the day it was first seen, along with the rulebooks
      above it (Kalshi series and event terms, Polymarket resolution metadata)
      and the venue's contract terms documents, with diffs between versions.
  - name: Books
    description: >-
      Order books recorded live from each venue's feed, their history, and the
      health of the feeds.
  - name: Signals
    description: Mispricing leads and unusual trading derived from the graph and history.
  - name: Live
    description: Quotes, trades, relations and leads pushed as they happen.
  - name: Service
    description: Service status and this document.
paths:
  /v1/markets/{venue}/{id}/rules:
    parameters:
      - $ref: '#/components/parameters/Venue'
      - $ref: '#/components/parameters/MarketID'
    get:
      tags:
        - Rules
      summary: Get a market's rules and their history
      description: |
        The market's current rule text, the rulebooks in force above it with
        their settlement sources, source links and contract terms documents,
        every recorded version of the contract (hash, when it was first and
        last seen, which fields changed, a unified diff from the version
        before, and which rulebooks changed with it), and the ledger of every
        change to the market's terms, including rulebook and document changes
        under an unchanged contract. Use it to see exactly how a market is
        decided, whether that changed since a position was taken, and what
        the venue's own terms document says. Works for any market ever
        recorded, listed or not.
      operationId: getMarketRules
      responses:
        '200':
          description: The market's terms and history.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Daily-Quota-Limit:
              $ref: '#/components/headers/X-Daily-Quota-Limit'
            X-Daily-Quota-Remaining:
              $ref: '#/components/headers/X-Daily-Quota-Remaining'
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/RulesDetail'
              example:
                data:
                  venue: kalshi
                  id: KXCPI-26SEP-T3.0
                  title: CPI above 3.0% in September?
                  rules_hash: >-
                    6d1f0a4c2e8b9f70c13a5e7d2b4c6a8e0f1d3c5b7a9e1f3d5c7b9a1e3f5d7c9b
                  rules: >-
                    If the CPI for September 2026 is above 3.0%, then the market
                    resolves to Yes.


                    The Source Agency is the Bureau of Labor Statistics.
                  rulebooks:
                    - venue: kalshi
                      kind: series
                      id: KXCPI
                      content_hash: >-
                        2c9e7a1d4b6f8e0c1a3d5f7b9e1c3a5d7f9b1e3c5a7d9f1b3e5c7a9d1f3b5e7c
                      first_seen_at: '2026-09-14T12:00:00Z'
                      last_seen_at: '2026-09-17T09:00:00Z'
                      fields:
                        contract_terms_url: https://assets.kalshi.com/contract_terms/KXCPI.pdf
                        contract_url: >-
                          https://assets.kalshi.com/regulatory/product-certifications/KXCPI.pdf
                        settlement_sources:
                          - name: Bureau of Labor Statistics
                            url: https://www.bls.gov/cpi/
                        additional_prohibitions:
                          - >-
                            Persons who are employed by any of the Source
                            Agencies are not permitted to trade on the Contract.
                        product_metadata: {}
                      settlement_sources:
                        - name: Bureau of Labor Statistics
                          url: https://www.bls.gov/cpi/
                      source_url: https://assets.kalshi.com/contract_terms/KXCPI.pdf
                      document:
                        url: https://assets.kalshi.com/contract_terms/KXCPI.pdf
                        content_hash: >-
                          9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d
                        text: >-
                          KXCPI

                          Scope: These rules shall apply to this contract.

                          Underlying: The Consumer Price Index for All Urban
                          Consumers...
                        fetched_at: '2026-09-17T03:10:00Z'
                      changed_fields: []
                    - venue: kalshi
                      kind: event
                      id: KXCPI-26SEP
                      content_hash: >-
                        4e6a8c0e2a4c6e8a0c2e4a6c8e0a2c4e6a8c0e2a4c6e8a0c2e4a6c8e0a2c4e6a
                      first_seen_at: '2026-09-14T12:00:00Z'
                      last_seen_at: '2026-09-17T09:00:00Z'
                      fields:
                        mutually_exclusive: true
                        settlement_sources:
                          - name: Bureau of Labor Statistics
                            url: https://www.bls.gov/cpi/
                        strike_date: '2026-10-14T12:30:00Z'
                        strike_period: ''
                        collateral_return_type: MECNET
                      settlement_sources:
                        - name: Bureau of Labor Statistics
                          url: https://www.bls.gov/cpi/
                      changed_fields: []
                  versions:
                    - rules_hash: >-
                        1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c
                      first_seen_at: '2026-09-14T12:00:00Z'
                      last_seen_at: '2026-09-15T18:00:00Z'
                      changed_fields: []
                      rulebooks_changed: []
                    - rules_hash: >-
                        6d1f0a4c2e8b9f70c13a5e7d2b4c6a8e0f1d3c5b7a9e1f3d5c7b9a1e3f5d7c9b
                      first_seen_at: '2026-09-15T19:00:00Z'
                      last_seen_at: '2026-09-17T09:00:00Z'
                      changed_fields:
                        - rules
                      summary: Rules text changed (+1 −1 lines).
                      diff: >
                        --- rules@1a3c5e7b9d1f

                        +++ rules@6d1f0a4c2e8b

                        @@ -1,3 +1,3 @@

                        -If the CPI for September 2026 is above 3.0%, then the
                        market resolves to Yes.

                        +If the CPI for September 2026 is above 3.0%, then the
                        market resolves to Yes.
                         
                         The Source Agency is the Bureau of Labor Statistics.
                      rulebooks_changed: []
                  changes:
                    - scope: contract
                      from_hash: >-
                        1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c
                      to_hash: >-
                        6d1f0a4c2e8b9f70c13a5e7d2b4c6a8e0f1d3c5b7a9e1f3d5c7b9a1e3f5d7c9b
                      changed_at: '2026-09-15T19:00:00Z'
                      changed_fields:
                        - rules
                      summary: Rules text changed (+1 −1 lines).
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No contract terms have been recorded for the market.
components:
  parameters:
    Venue:
      name: venue
      in: path
      required: true
      description: The venue the market is listed on.
      schema:
        $ref: '#/components/schemas/Venue'
      example: kalshi
    MarketID:
      name: id
      in: path
      required: true
      description: >-
        The venue's market id, such as a Kalshi ticker or a Polymarket market
        slug.
      schema:
        $ref: '#/components/schemas/MarketID'
      example: KXNFLTEAMTOTAL-26SEP20MIASF-SF11
  headers:
    X-RateLimit-Limit:
      description: Requests allowed per minute for this key.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current minute.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix time when the minute window resets.
      schema:
        type: integer
    X-Daily-Quota-Limit:
      description: Requests allowed per UTC day.
      schema:
        type: integer
    X-Daily-Quota-Remaining:
      description: Requests left today.
      schema:
        type: integer
  schemas:
    RulesDetail:
      type: object
      additionalProperties: false
      required:
        - venue
        - id
        - title
        - rules_hash
        - rules
        - rulebooks
        - versions
        - changes
      properties:
        venue:
          $ref: '#/components/schemas/Venue'
        id:
          $ref: '#/components/schemas/MarketID'
        title:
          type: string
        rules_hash:
          type: string
          description: The current contract version.
        rules:
          type: string
          description: The current rule text as the venue serves it.
        rulebooks:
          type: array
          description: The rulebook versions in force for the current contract version.
          items:
            $ref: '#/components/schemas/RulebookVersion'
        versions:
          type: array
          description: Every contract version, oldest first.
          items:
            $ref: '#/components/schemas/RulesVersion'
        changes:
          type: array
          description: Every recorded change to the market's terms, oldest first.
          items:
            $ref: '#/components/schemas/RuleChange'
    Venue:
      type: string
      enum:
        - kalshi
        - polymarket
    MarketID:
      type: string
      pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$
    RulebookVersion:
      type: object
      additionalProperties: false
      required:
        - venue
        - kind
        - id
        - content_hash
        - first_seen_at
        - last_seen_at
        - fields
        - settlement_sources
        - changed_fields
      properties:
        venue:
          $ref: '#/components/schemas/Venue'
        kind:
          $ref: '#/components/schemas/RulebookKind'
        id:
          type: string
        content_hash:
          type: string
          description: Identifies this exact content of the rulebook's fields.
        first_seen_at:
          $ref: '#/components/schemas/Timestamp'
        last_seen_at:
          $ref: '#/components/schemas/Timestamp'
        fields:
          type: object
          description: The venue's settlement fields, verbatim.
          additionalProperties: true
        settlement_sources:
          type: array
          items:
            $ref: '#/components/schemas/SettlementSource'
        source_url:
          type: string
          description: The venue's own document or page for these terms.
        document:
          $ref: '#/components/schemas/RulebookDocument'
        changed_fields:
          type: array
          description: Fields that differ from the previous version.
          items:
            type: string
        diff:
          type: string
          description: Unified diff of the fields from the previous version.
    RulesVersion:
      type: object
      additionalProperties: false
      required:
        - rules_hash
        - first_seen_at
        - last_seen_at
        - changed_fields
        - rulebooks_changed
      properties:
        rules_hash:
          type: string
        first_seen_at:
          $ref: '#/components/schemas/Timestamp'
        last_seen_at:
          $ref: '#/components/schemas/Timestamp'
        changed_fields:
          type: array
          description: >-
            Recorded fields that differ from the previous version: rules, title,
            yes_label, no_label, event_id, strike, opens_at, closes_at,
            game_starts_at, outcome_tokens. Empty for the first version, or when
            the venue changed a term the recorded fields do not show.
          items:
            type: string
        summary:
          type: string
        diff:
          type: string
          description: Unified diff of the rule text from the previous version.
        rulebooks_changed:
          type: array
          items:
            $ref: '#/components/schemas/RulebookRef'
    RuleChange:
      type: object
      additionalProperties: false
      required:
        - scope
        - from_hash
        - to_hash
        - changed_at
        - changed_fields
        - summary
      properties:
        scope:
          $ref: '#/components/schemas/RuleChangeScope'
        rulebook_id:
          type: string
        from_hash:
          type: string
        to_hash:
          type: string
        changed_at:
          $ref: '#/components/schemas/Timestamp'
        changed_fields:
          type: array
          items:
            type: string
        summary:
          type: string
    Error:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: A stable machine-readable code.
            message:
              type: string
              description: A human-readable explanation.
    RulebookKind:
      type: string
      enum:
        - series
        - event
        - market
    Timestamp:
      type: string
      format: date-time
    SettlementSource:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
        url:
          type: string
          description: Absent unless the venue gave an https link.
    RulebookDocument:
      type: object
      additionalProperties: false
      required:
        - url
      properties:
        url:
          type: string
          description: The venue's contract terms document.
        content_hash:
          type: string
          description: SHA-256 of the document; a new hash is a new version.
        text:
          type: string
          description: The text extracted from the document.
        fetched_at:
          $ref: '#/components/schemas/Timestamp'
        error:
          type: string
          description: Why the last fetch or extraction failed, when it did.
        diff:
          type: string
          description: Unified diff of the text from the previous version's document.
    RulebookRef:
      type: object
      additionalProperties: false
      required:
        - kind
        - id
        - content_hash
      properties:
        kind:
          $ref: '#/components/schemas/RulebookKind'
        id:
          type: string
        content_hash:
          type: string
        from_hash:
          type: string
          description: The version in force for the previous contract version.
    RuleChangeScope:
      type: string
      description: >-
        `contract` is the market's own terms; `series`, `event` and `market` are
        rulebooks above it; `document` is the venue's contract terms document.
      enum:
        - contract
        - series
        - event
        - market
        - document
  responses:
    BadRequest:
      description: Invalid parameter or market.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_parameter
              message: 'Invalid or unsupported query parameter: limit.'
    Unauthorized:
      description: Missing, invalid or revoked API key.
      headers:
        WWW-Authenticate:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: api_key_required
              message: Send an API key in the X-API-Key header or as a Bearer token.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
    bearer:
      type: http
      scheme: bearer
      description: The same API key sent as a Bearer token.

````