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

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# Get live orderbooks for multiple markets

> Returns live per-venue orderbooks for the explicit venueMarketIds requested. `venueMarketIds` accepts either a comma-separated string (`?venueMarketIds=a,b,c`) or repeated params (`?venueMarketIds=a&venueMarketIds=b`). Use /orderbooks/outcomes for batches keyed by venue market outcome IDs.



## OpenAPI

````yaml /openapi/openapi.json get /orderbooks
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
security: []
tags:
  - name: Authentication
    description: Sign users in and manage their session tokens.
  - name: Markets
    description: Find events, markets and outcomes to trade.
  - name: Market Data
    description: Live orderbooks, prices, charts and scores for those markets.
  - name: Trading
    description: Quote, place, sign, track and cancel orders.
  - name: Portfolio
    description: A user's orders, positions, balances and activity.
  - name: Funding
    description: Deposit addresses, withdrawals, balance refills and fiat on-ramp.
  - name: Users
    description: The signed-in user's profile, linked accounts, KYC and venue keys.
  - name: Hosted Venue Accounts
    description: Provision, fund and withdraw from venue accounts hosted for the user.
  - name: Webhooks
    description: Configure and operate webhook delivery to your server.
  - name: Partner Admin
    description: Server-side reads across your app's users, orders and analytics.
  - name: Paper Trading
    description: Simulated accounts and orders for testing without real funds.
  - name: News
    description: News feeds linked to markets.
  - name: Correlated Markets
    description: Markets related to a given market and the effect of its resolution.
paths:
  /orderbooks:
    get:
      tags:
        - Market Data
      summary: Get live orderbooks for multiple markets
      description: >-
        Returns live per-venue orderbooks for the explicit venueMarketIds
        requested. `venueMarketIds` accepts either a comma-separated string
        (`?venueMarketIds=a,b,c`) or repeated params
        (`?venueMarketIds=a&venueMarketIds=b`). Use /orderbooks/outcomes for
        batches keyed by venue market outcome IDs.
      operationId: getOrderbooks
      parameters:
        - name: venueMarketIds
          in: query
          required: true
          schema:
            anyOf:
              - maxItems: 20
                type: array
                items:
                  type: string
              - type: string
        - name: depth
          in: query
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: integer
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - venueMarketId
                        - status
                        - error
                        - requestedMarket
                        - venueOrderbooks
                        - matchedMarkets
                      properties:
                        venueMarketId:
                          type: string
                        status:
                          type: string
                          enum:
                            - ok
                            - market_not_found
                            - market_resolved
                            - market_closed
                            - market_paused
                            - market_unopened
                            - book_not_loaded
                        error:
                          type: object
                          required:
                            - code
                            - message
                            - retryable
                          properties:
                            code:
                              type: string
                              enum:
                                - market_not_found
                                - market_resolved
                                - market_closed
                                - market_paused
                                - market_unopened
                                - book_not_loaded
                            message:
                              type: string
                            retryable:
                              type: boolean
                          nullable: true
                        requestedMarket:
                          type: object
                          required:
                            - venueMarketId
                            - venue
                            - marketStatus
                            - tickSize
                            - endDate
                            - resolutionDate
                          properties:
                            venueMarketId:
                              type: string
                            venue:
                              $ref: '#/components/schemas/Venue'
                            marketStatus:
                              type: string
                              enum:
                                - open
                                - closed
                                - resolved
                                - unopened
                                - paused
                            tickSize:
                              type: number
                              nullable: true
                            endDate:
                              type: string
                              nullable: true
                            resolutionDate:
                              type: string
                              nullable: true
                          nullable: true
                        venueOrderbooks:
                          type: object
                          additionalProperties:
                            type: object
                            required:
                              - venueMarketId
                              - tickSize
                              - orderbook
                            properties:
                              venueMarketId:
                                type: string
                              tickSize:
                                type: number
                                nullable: true
                              orderbook:
                                type: object
                                required:
                                  - bids
                                  - asks
                                properties:
                                  bids:
                                    type: array
                                    items:
                                      type: object
                                      required:
                                        - price
                                        - size
                                      properties:
                                        price:
                                          minimum: 0
                                          maximum: 1
                                          type: number
                                        size:
                                          minimum: 0
                                          type: number
                                  asks:
                                    type: array
                                    items:
                                      type: object
                                      required:
                                        - price
                                        - size
                                      properties:
                                        price:
                                          minimum: 0
                                          maximum: 1
                                          type: number
                                        size:
                                          minimum: 0
                                          type: number
                                  negRisk:
                                    type: boolean
                              tick:
                                type: number
                                nullable: true
                              markSource:
                                $ref: '#/components/schemas/MarkSource'
                              deployerVenue:
                                type: string
                                nullable: true
                        matchedMarkets:
                          type: array
                          items:
                            type: object
                            required:
                              - venue
                              - venueMarketId
                              - marketStatus
                              - tickSize
                              - hasOrderbook
                            properties:
                              venue:
                                $ref: '#/components/schemas/Venue'
                              venueMarketId:
                                type: string
                              marketStatus:
                                type: string
                                enum:
                                  - open
                                  - closed
                                  - resolved
                                  - unopened
                                  - paused
                              tickSize:
                                type: number
                                nullable: true
                              hasOrderbook:
                                type: boolean
                              deployerVenue:
                                type: string
                                nullable: true
                  meta:
                    type: object
                    required:
                      - requestedCount
                      - okCount
                      - errorCount
                    properties:
                      requestedCount:
                        minimum: 0
                        type: integer
                      okCount:
                        minimum: 0
                        type: integer
                      errorCount:
                        minimum: 0
                        type: integer
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '503':
          description: '503'
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - retryable
                properties:
                  code:
                    type: string
                    enum:
                      - orderbook_service_unavailable
                  message:
                    type: string
                  retryable:
                    type: boolean
      security:
        - appId: []
components:
  schemas:
    Venue:
      type: string
      enum:
        - kalshi
        - polymarket
        - limitless
        - opinion
        - predict
        - pred
        - tiprun
        - probable
        - myriad
        - hyperliquid
        - novig
        - prophetx
        - betdex
    MarkSource:
      description: >-
        How `midpoint` was derived. `local`: (best bid + best ask) / 2 on this
        book. `local_merged`: a missing side was filled from the complementary
        outcome's book. `local_one_sided`: only one side exists, so the mark is
        that side's best price, not a true midpoint. `sibling`: 1 minus the
        complementary outcome's mark. `local_boundary`: the book sits at 0 or 1
        (e.g. a settled market). `local_stub`: the only book is a placeholder
        quote at the price bounds; indicative only, not tradeable quality.
        `none`: no mark available.
      type: string
      enum:
        - local
        - local_merged
        - local_one_sided
        - sibling
        - local_boundary
        - local_stub
        - none
    ErrorMessage:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID. Required for all app-tier and user-tier routes.

````