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

# Orderbook Snapshot

> Orderbook Snapshot

 Get a point-in-time orderbook snapshot for a trading pair: the top bid
 and ask price levels, up to 1000 per side. Every snapshot carries
 bookSeq, the sequence it is exact as of, and reads the book the
 WebSocket orderbook and depth channels stream, which follows order
 acknowledgements by a short interval. This is a public endpoint that
 does not require authentication.



## OpenAPI

````yaml get /api/v1/orderbook/{tradingPairId}
openapi: 3.0.3
info:
  title: Monaco Protocol API
  description: REST API for the Monaco Protocol hybrid CLOB exchange.
  version: 1.0.0
servers:
  - url: https://apimonaco.xyz
    description: Production (Sei mainnet)
security: []
tags:
  - name: AccountsService
  - name: AnalyticsService
  - name: ApplicationsService
  - name: AuthService
  - name: BuildercodeRewardsService
  - name: ComplianceService
  - name: CopyTradingService
  - name: DelegatedAgentsService
  - name: FaucetService
  - name: FeesService
  - name: HealthService
  - name: ManagedMarketsService
    description: |-
      Wallet-authenticated maker assignments. The signed session must match both
       configured maker user and application. Owner IDs are process fences, never auth.
       Only wallet sessions are supported; delegated-agent sessions receive 403.
  - name: MarginAccountsService
    description: |-
      Current public isolated-margin semantics:
       - a user has one parent margin account per application scope
       - opening orders create or reuse isolated position buckets under that parent
       - parent account creation is handled internally by margin workflows
  - name: MarketService
  - name: OrderbookService
  - name: OrdersService
  - name: PositionsService
    description: |-
      Current public isolated-margin semantics:
       - positions link to a parent margin account and, when applicable, a bucket id
       - opening orders create or reuse isolated position buckets under the parent
       - users can open another isolated position by reusing the parent account with a different market bucket
  - name: PulseService
  - name: RfqService
  - name: SweeperService
  - name: TraderCodeService
  - name: TradesService
  - name: WithdrawalsService
paths:
  /api/v1/orderbook/{tradingPairId}:
    get:
      tags:
        - OrderbookService
        - Orderbook
      summary: Orderbook Snapshot
      description: |-
        Orderbook Snapshot

         Get a point-in-time orderbook snapshot for a trading pair: the top bid
         and ask price levels, up to 1000 per side. Every snapshot carries
         bookSeq, the sequence it is exact as of, and reads the book the
         WebSocket orderbook and depth channels stream, which follows order
         acknowledgements by a short interval. This is a public endpoint that
         does not require authentication.
      operationId: get_orderbook_snapshot
      parameters:
        - name: tradingPairId
          in: path
          required: true
          schema:
            type: string
            default: 893d2add-2f36-4ee7-b660-893d2add2f36
          example: 893d2add-2f36-4ee7-b660-893d2add2f36
        - name: levels
          in: query
          schema:
            type: integer
            format: uint32
            minimum: 1
            maximum: 1000
            default: 20
          description: >-
            Number of price levels per side (max 1000). A read above 100 levels
            draws the deep orderbook read budget; a read of 100 or fewer draws
            the orderbook read budget
        - name: tradingMode
          in: query
          schema:
            type: string
            enum:
              - SPOT
              - MARGIN
            minLength: 1
          description: Trading mode
        - name: magnitude
          in: query
          schema:
            type: string
            enum:
              - '0.000001'
              - '0.00001'
              - '0.0001'
              - '0.001'
              - '0.01'
              - '0.1'
              - '1'
              - '10'
              - '100'
              - '1000'
              - '10000'
            minLength: 1
          description: Price grouping magnitude
        - name: denomination
          in: query
          schema:
            type: string
            enum:
              - base
              - quote
            minLength: 1
          description: Price denomination
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderbookResponse'
        '400':
          description: >-
            levels outside 1 to 1000, a tradingMode that is invalid or not the
            pair's, or an invalid magnitude or denomination value
        '404':
          description: Trading pair not found
        '429':
          description: >-
            Orderbook read budget exceeded for this client IP on the public
            ingress: a read of 100 levels or fewer costs one unit of the
            orderbook read budget, a read above 100 levels costs
            ceil(levels/100) units of the deep orderbook read budget
            (PrivateLink is not metered); retry after the interval in
            details.retryAfter
        '500':
          description: Internal error
        '503':
          description: The book cannot be read right now, at any depth; retry
components:
  schemas:
    GetOrderbookResponse:
      type: object
      properties:
        baseDecimals:
          example: 8
          type: integer
          description: Base token decimal places
          format: int32
          nullable: true
        baseToken:
          example: BTC
          type: string
          description: Base token symbol
          nullable: true
        data:
          $ref: '#/components/schemas/OrderbookData'
        eventType:
          example: orderbook_snapshot
          type: string
          description: Event type identifier
          nullable: true
        symbol:
          example: BTC/USDC
          type: string
          description: Trading pair symbol
          nullable: true
        tradingPairId:
          example: 123e4567-e89b-12d3-a456-426614174000
          type: string
          description: Trading pair UUID
          format: uuid
          nullable: true
        quoteDecimals:
          example: 6
          type: integer
          description: Quote token decimal places
          format: int32
          nullable: true
        quoteToken:
          example: USDC
          type: string
          description: Quote token symbol
          nullable: true
        sequenceNumber:
          example: 0
          type: integer
          description: Legacy field, always 0. bookSeq versions the snapshot.
          format: uint32
          nullable: true
        timestamp:
          example: '2023-11-13T10:30:00Z'
          type: string
          description: Snapshot timestamp
          nullable: true
        tradingMode:
          example: Spot
          type: string
          description: Trading mode
          nullable: true
        bookSeq:
          example: '184467'
          type: string
          description: >-
            Durable-log sequence this snapshot is exact as of, as a decimal
            string; set on every snapshot, and the watermark the orderbook and
            depth WebSocket channels carry. A point-in-time read and staleness
            check, not a base for applying WebSocket deltas: for a live local
            book use the depth WebSocket channel, whose snapshot is the handoff
            base. A side that returns as many levels as requested may hold more.
          nullable: true
      description: Orderbook snapshot with token metadata and sequence number.
    OrderbookData:
      type: object
      properties:
        bids:
          type: array
          items:
            $ref: '#/components/schemas/PriceLevel'
          nullable: true
        asks:
          type: array
          items:
            $ref: '#/components/schemas/PriceLevel'
          nullable: true
        bestBid:
          example: '34900'
          type: string
          description: Highest bid price, in the same form as the level prices
          nullable: true
        bestAsk:
          example: '35100'
          type: string
          description: Lowest ask price, in the same form as the level prices
          nullable: true
        bidVolume:
          example: '15.5'
          type: string
          description: Total bid-side volume
          nullable: true
        askVolume:
          example: '12.3'
          type: string
          description: Total ask-side volume
          nullable: true
        priceChange:
          $ref: '#/components/schemas/PriceChange'
    PriceLevel:
      type: object
      properties:
        price:
          example: '35000.5'
          type: string
          description: >-
            Price at this level, a decimal string. Without a magnitude it has no
            trailing zeros (an order entered at 35000.50 rests at "35000.5").
          nullable: true
        quantity:
          example: '1.5'
          type: string
          description: Total quantity at this price level
          nullable: true
        orderCount:
          example: 3
          type: integer
          description: Number of orders at this price level
          format: uint32
          nullable: true
    PriceChange:
      type: object
      properties:
        price24hAgo:
          example: '34500.00'
          type: string
          description: Price 24 hours ago
          nullable: true
        priceChange24h:
          example: '500.00'
          type: string
          description: Absolute price change in last 24 hours
          nullable: true
        priceChangePercent24h:
          example: '1.45'
          type: string
          description: Percentage price change in last 24 hours
          nullable: true

````

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