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

# Get Order Book

> Get Order Book.

Returns the current order book for a token.

**Base URL:** `https://api.dexbuilder.com`

**Authentication:** This is a public market-data endpoint and does not require authentication.

## Request

```bash theme={null}
curl -G "https://api.dexbuilder.com/api/v4/event_contracts/tokens/{token_id}/order_book"
```

`token_id` identifies the token. Use `depth` to request a supported number of levels.

The OpenAPI panel below is the source of truth for required parameters, types, enum values, and request-body fields. Timestamps are Unix timestamps unless the field description states otherwise.

## Response

Returns the token ID and ordered bid/ask levels. Each level contains price and size.

A successful response uses HTTP 200. Invalid parameters or request bodies return HTTP 400. Private endpoints can return HTTP 401 when authentication fails, and temporary upstream failures can return HTTP 503. The error response contains a machine-readable label and message.

For order, position, claim, transfer, and account operations, treat the response as the current server result and query the resource again when the operation is asynchronous.


## OpenAPI

````yaml openapi/event-contracts-en.yaml GET /api/v4/event_contracts/tokens/{token_id}/order_book
openapi: 3.0.3
info:
  title: DexBuilder Event Contracts API
  version: 1.0.0
  description: DexBuilder Event Contracts REST API.
servers:
  - url: https://api.dexbuilder.com
security: []
paths:
  /api/v4/event_contracts/tokens/{token_id}/order_book:
    get:
      summary: Get Order Book
      description: Get Order Book.
      operationId: query_order_book
      parameters:
        - name: token_id
          in: path
          required: true
          schema:
            type: string
        - name: depth
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: Request succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderBookResponse'
        '400':
          description: Invalid request or parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    OrderBookResponse:
      type: object
      properties:
        asks:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
        condition_id:
          type: string
        hash:
          type: string
          nullable: true
        last_trade_price:
          type: string
          nullable: true
        min_order_size:
          type: string
          nullable: true
        neg_risk:
          type: boolean
          nullable: true
        tick_size:
          type: string
          nullable: true
        timestamp:
          type: integer
          nullable: true
        token_id:
          type: string
      description: Response object.
    Error:
      type: object
      description: Error response.
      properties:
        label:
          type: string
          example: INVALID_ARGUMENT
        message:
          type: string
          example: invalid request
    OrderBookLevel:
      type: object
      properties:
        price:
          type: string
        size:
          type: string
      description: Response object.

````

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