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

# Get Orderbook

> Query for orderbook depth data.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/market/orderbook
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
security: []
paths:
  /api/v1/market/orderbook:
    get:
      tags:
        - Market
      summary: Get Orderbook
      description: Query for orderbook depth data.
      operationId: get_orderbook
      parameters:
        - name: symbol
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/Symbol'
        - name: depth
          in: query
          description: Depth level
          required: false
          schema:
            oneOf:
              - type: 'null'
              - 37b0ef62-fbec-47b3-81c7-24636ea343d9
      responses:
        '200':
          description: Orderbook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderBookResponse'
components:
  schemas:
    Symbol:
      type: string
      example: BTCUSDC
    GetOrderBookResponse:
      type: object
      description: Get OrderBook response.
      required:
        - result
        - time
      properties:
        result:
          $ref: '#/components/schemas/OrderBookSnapshot'
        time:
          type: string
          format: date-time
          example: '1672531200000'
    OrderBookSnapshot:
      type: object
      description: Order book Snapshot at a specific point in time.
      required:
        - s
        - ts
        - b
        - a
        - u
        - seq
        - mts
      properties:
        a:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
          description: Ask levels
        b:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
          description: Bid levels
        mts:
          type: string
          format: date-time
          description: >-
            The timestamp from the matching engine when this orderbook data is
            produced.

            It can be correlated with T from public trade channel
          example: '1672531200000'
        s:
          $ref: '#/components/schemas/Symbol'
          description: Symbol name
        seq:
          type: integer
          format: int64
          example: 21
          minimum: 0
        ts:
          type: string
          format: date-time
          description: The timestamp (ms) that the system generates the data
          example: '1672531200000'
        u:
          type: integer
          format: int64
          description: Update ID, is always in sequence
          example: 1
          minimum: 0
    OrderBookLevel:
      type: array
      items:
        type: string
        description: Order book level consisting of price and size.
      description: Order book level consisting of price and size.
      maxItems: 2
      minItems: 2

````