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

# Get the L2 order book snapshot

> Returns the live order book for an instrument, aggregated by price level. Requires MARKET_DATA permission.



## OpenAPI

````yaml /api-reference/derivatives-predictions-api/rest-api/cpm-spec.json get /api/orderbook/{instrument_id}
openapi: 3.0.3
info:
  title: CPM Public REST API
  version: 0.1.0
servers:
  - url: https://api.example.com
    variables: {}
security:
  - auth_api_key: []
  - auth_timestamp: []
  - auth_passphrase: []
  - auth_signature: []
paths:
  /api/orderbook/{instrument_id}:
    get:
      tags:
        - MarketData
      summary: Get the L2 order book snapshot
      description: >-
        Returns the live order book for an instrument, aggregated by price
        level. Requires MARKET_DATA permission.
      operationId: getOrderBook
      parameters:
        - name: instrument_id
          in: path
          description: Instrument ID.
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: Order book snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/L2BookResponse'
      deprecated: false
      security: []
components:
  schemas:
    L2BookResponse:
      type: object
      additionalProperties: false
      properties:
        instrument_id:
          type: string
          description: Instrument id, as a canonical decimal string.
          example: '598471892347'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/L2Level'
          description: Bid price levels for the YES contract, best (highest) price first.
        asks:
          type: array
          items:
            $ref: '#/components/schemas/L2Level'
          description: Ask price levels for the YES contract, best (lowest) price first.
    L2Level:
      type: object
      additionalProperties: false
      properties:
        price:
          type: string
          description: Price of this level per YES contract in USDC, as a decimal string.
          example: '0.590000'
        quantity:
          type: string
          description: >-
            Total resting quantity at this price, in contracts, as a decimal
            string.
          example: '15.00'
  securitySchemes:
    auth_api_key:
      name: CB-ACCESS-KEY
      description: The API key string for the request
      in: header
      type: apiKey
    auth_timestamp:
      name: CB-ACCESS-TIMESTAMP
      description: The request timestamp (epoch seconds)
      in: header
      type: apiKey
    auth_passphrase:
      name: CB-ACCESS-PASSPHRASE
      description: The passphrase for the API key
      in: header
      type: apiKey
    auth_signature:
      name: CB-ACCESS-SIGN
      description: HMAC SHA-256 signature over TIMESTAMP + METHOD + REQUEST_PATH + BODY
      in: header
      type: apiKey

````