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

# Game streams

> One call returns, per platform, the identifiers and the exact WebSocket subscribe messages needed to stream the books of a game. Platforms that publish only the YES book of a market (`book_semantics: yes_book_only_derive_no`) are subscribed once per market; the NO side is derived (price 1-p, bids and asks swapped). Where a platform needs an API key to stream (`socket.auth`), use your own key with that platform.



## OpenAPI

````yaml GET /api/v1/games/{id}/streams
openapi: 3.1.0
info:
  title: Vatic API
  version: 1.0.0
  description: >-
    Polymarket price targets, Hyperliquid prediction market data, market
    timestamps, fee calculators, and order management for systematic prediction
    market trading.
servers:
  - url: https://api.vatic.trading
    description: Production
security: []
paths:
  /api/v1/games/{id}/streams:
    get:
      tags:
        - Game Graph
      summary: Everything needed to open every orderbook of a game
      description: >-
        One call returns, per platform, the identifiers and the exact WebSocket
        subscribe messages needed to stream the books of a game. Platforms that
        publish only the YES book of a market (`book_semantics:
        yes_book_only_derive_no`) are subscribed once per market; the NO side is
        derived (price 1-p, bids and asks swapped). Where a platform needs an
        API key to stream (`socket.auth`), use your own key with that platform.
      operationId: getGameStreams
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Game id, e.g. `espn:401879264`. An id that was replaced still
            resolves to the new game.
          schema:
            type: string
            example: espn:401879264
        - name: markets
          in: query
          schema:
            type: string
            enum:
              - main
              - classified
              - all
            default: main
          description: '`main` = the full-game 1x2 / moneyline.'
        - name: source
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Stream descriptors
          headers:
            ETag:
              schema:
                type: string
              description: Weak ETag; send it back in `If-None-Match` for a 304.
            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:
                  data:
                    $ref: '#/components/schemas/GameGraphStreams'
                  meta:
                    $ref: '#/components/schemas/GameGraphMeta'
        '400':
          description: Invalid parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameGraphError'
        '401':
          description: Missing or invalid API key (code `unauthorized`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameGraphError'
        '404':
          description: No such game
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameGraphError'
        '429':
          description: Rate limit exceeded (code `rate_limited`); see `Retry-After`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameGraphError'
        '503':
          description: Auth service unavailable (code `unavailable`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameGraphError'
      security:
        - ApiKey: []
components:
  schemas:
    GameGraphStreams:
      type: object
      properties:
        game_id:
          type: string
        markets_scope:
          type: string
        venues:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              redistributable:
                type: string
              refs:
                type: array
                items:
                  type: string
              book_semantics:
                type: string
                enum:
                  - every_outcome_has_its_own_book
                  - yes_book_only_derive_no
              socket:
                type: object
                nullable: true
                properties:
                  url:
                    type: string
                  protocol:
                    type: string
                    enum:
                      - json
                      - engine.io-v4
                  auth:
                    type: object
                    nullable: true
                  heartbeat:
                    type: object
                    nullable: true
                  frames:
                    type: string
                  note:
                    type: string
              subscribe:
                type: array
                items:
                  type: object
                description: >-
                  The messages to send (json protocol) or the handshake steps
                  (engine.io).
        markets:
          type: array
          items:
            $ref: '#/components/schemas/GameGraphMarket'
    GameGraphMeta:
      type: object
      description: Always present.
      properties:
        as_of:
          type: string
          format: date-time
          description: >-
            When the read model behind this answer was last refreshed (about
            every 15 s).
        redistributable_filter:
          type: string
          enum:
            - yes_only
            - internal
        venues_checked:
          type: array
          items:
            type: string
          description: >-
            Platforms we integrate. A platform missing from a game's `platforms`
            is only "not offered" if its `coverage` says `not_listed`.
        total:
          type: integer
        withheld:
          type: object
          description: >-
            Games that exist but are not returned yet because their sources are
            not cleared for redistribution.
          properties:
            games:
              type: integer
            reason:
              type: string
    GameGraphError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: >-
            Stable machine-readable code: bad_request, unauthorized, forbidden,
            not_found, method_not_allowed, rate_limited, unavailable, internal.
        hint:
          type: string
      required:
        - error
        - code
    GameGraphMarket:
      type: object
      properties:
        id:
          type: string
          example: polymarket:0x9f1a...
        game_id:
          type: string
        source:
          type: string
        event_external_id:
          type: string
        title:
          type: string
        raw_type:
          type: string
          nullable: true
        canonical:
          type: object
          properties:
            key:
              type: string
              nullable: true
              example: 1x2
              description: >-
                1x2, moneyline, total:<line>, spread:<home line>, btts, or null
                (unclassified: stored but never compared across platforms).
            period:
              type: string
              nullable: true
            line:
              type: number
              nullable: true
            includes_overtime:
              type: boolean
              nullable: true
              description: >-
                null = the rules did not say; treated as different from true and
                false.
        redistributable:
          type: string
          enum:
            - 'yes'
            - 'no'
            - unknown
        active:
          type: boolean
        closed:
          type: boolean
        venue_meta:
          type: object
        outcomes:
          type: array
          items:
            $ref: '#/components/schemas/GameGraphOutcome'
    GameGraphOutcome:
      type: object
      properties:
        idx:
          type: integer
        label:
          type: string
        canonical_outcome:
          type: string
          nullable: true
          description: >-
            home, draw, away, over, under, yes, no, not:<outcome>. Always
            expressed against OUR home and away team, whatever the platform
            calls them.
        team_id:
          type: string
          nullable: true
        book:
          type: object
          description: The key that opens this outcome's orderbook.
          properties:
            type:
              type: string
              example: polymarket_asset_id
            ref:
              type: string
            side:
              type: string
              description: yes/no where the book is shared, empty otherwise.
        trade:
          type: object
          nullable: true
          description: >-
            Everything a frontend needs to act on this outcome on its venue:
            identifiers (`instrument`), limits (`order`), contract addresses
            (`contracts`), collateral, how to submit (`submit`), the opposite
            outcome (`complement`), whether it is tradable now, caveats and
            references. Information only: Vatic never places or signs orders.
            Fields a venue does not give us are `null`.
          properties:
            venue:
              type: string
              enum:
                - polymarket
                - hyperliquid
                - limitless
                - predictfun
            chain:
              type: object
              properties:
                name:
                  type: string
                id:
                  type: integer
                  nullable: true
            instrument:
              type: object
              description: >-
                Venue identifiers. Polymarket: token_id (= CTF position id),
                condition_id, neg_risk. Hyperliquid: asset (100000000 +
                10*outcome + side), coin, token_name. Limitless: market_slug,
                token_id, side. Predict.fun: market_id, token_id, is_neg_risk,
                is_yield_bearing, fee_rate_bps.
              additionalProperties: true
            order:
              type: object
              additionalProperties: true
            contracts:
              type: object
              nullable: true
              additionalProperties: true
            collateral:
              type: object
              nullable: true
              additionalProperties: true
            submit:
              type: object
              additionalProperties: true
            complement:
              type: object
              nullable: true
              additionalProperties: true
            tradable:
              type: boolean
            caveats:
              type: array
              items:
                type: string
            reference:
              type: array
              items:
                type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Required for order endpoints. Obtain your API key from the Vatic
        dashboard.

````

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