> ## 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.

# 查询订单簿

> 查询订单簿

查询订单簿。

> [!NOTE]
>
> 该接口为公开接口，不需要认证。


## OpenAPI

````yaml openapi/event-contracts.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 事件合约 REST API
servers:
  - url: https://api.dexbuilder.com
security: []
paths:
  /api/v4/event_contracts/tokens/{token_id}/order_book:
    get:
      summary: 查询订单簿
      description: 查询订单簿
      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: 请求成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderBookResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: 服务暂时不可用
          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: 响应对象。
    Error:
      type: object
      description: 错误响应。
      properties:
        label:
          type: string
          example: INVALID_ARGUMENT
        message:
          type: string
          example: invalid request
    OrderBookLevel:
      type: object
      properties:
        price:
          type: string
        size:
          type: string
      description: 响应对象。

````

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