> ## 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.

# Order book feed health

> The state of each venue's order book feed as its collector last
reported it: whether it is connected and since when, message and
level-change rates, how many markets are recorded at full depth and
how many polled (and how long a polling cycle takes), and the counts
since the collector started of reconnects, sequence gaps, resyncs and
level changes dropped under overload, with feed latency percentiles
where the venue stamps its messages. `status` is `up`, `degraded`
(silent for two minutes, or an issue reported) or `down` (not
connected, or no report for two minutes).




## OpenAPI

````yaml /openapi.yaml get /v1/books/health
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/books/health:
    get:
      tags:
        - Books
      summary: Order book feed health
      description: |
        The state of each venue's order book feed as its collector last
        reported it: whether it is connected and since when, message and
        level-change rates, how many markets are recorded at full depth and
        how many polled (and how long a polling cycle takes), and the counts
        since the collector started of reconnects, sequence gaps, resyncs and
        level changes dropped under overload, with feed latency percentiles
        where the venue stamps its messages. `status` is `up`, `degraded`
        (silent for two minutes, or an issue reported) or `down` (not
        connected, or no report for two minutes).
      operationId: getBooksHealth
      responses:
        '200':
          description: One entry per venue.
          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:
                    type: array
                    items:
                      $ref: '#/components/schemas/FeedHealth'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        default:
          $ref: '#/components/responses/Error'
components:
  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:
    FeedHealth:
      type: object
      additionalProperties: false
      required:
        - venue
        - status
        - connected
        - started_at
        - stale_seconds
        - messages_per_minute
        - events_per_minute
        - full_depth_markets
        - rest_markets
        - reconnects
        - gaps
        - resyncs
        - dropped
        - rest_errors
        - updated_at
      properties:
        venue:
          $ref: '#/components/schemas/Venue'
        status:
          type: string
          enum:
            - up
            - degraded
            - down
        connected:
          type: boolean
        started_at:
          $ref: '#/components/schemas/Timestamp'
          description: When the collector started; counters count from here.
        connected_since:
          $ref: '#/components/schemas/Timestamp'
        last_message_at:
          $ref: '#/components/schemas/Timestamp'
        stale_seconds:
          type: integer
          description: Seconds since the last feed message.
        messages_per_minute:
          type: integer
        events_per_minute:
          type: integer
          description: Level changes recorded per minute.
        full_depth_markets:
          type: integer
        rest_markets:
          type: integer
        rest_cycle_seconds:
          type: integer
          description: How long one pass over the polled markets takes.
        reconnects:
          type: integer
        gaps:
          type: integer
          description: Sequence gaps or books found to differ from the venue's copy.
        resyncs:
          type: integer
          description: Fresh snapshots taken after gaps and reconnects.
        dropped:
          type: integer
          description: >-
            Level changes not recorded because the writer was overloaded; the
            affected books were snapshotted afresh.
        rest_errors:
          type: integer
        latency_ms_p50:
          type: integer
          description: >-
            Feed latency, venue time to receipt, where the venue stamps
            messages.
        latency_ms_p99:
          type: integer
        issue:
          type: string
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    Venue:
      type: string
      enum:
        - kalshi
        - polymarket
    Timestamp:
      type: string
      format: date-time
    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.
  responses:
    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.
    TooManyRequests:
      description: Rate limit or daily quota exceeded.
      headers:
        Retry-After:
          description: Seconds until the limit resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error:
      description: Any other error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  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.

````