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

# Get Aggregated Order Book

> Fetch aggregated order book across all or selected DEXes

Get aggregated order book data across all or selected DEX exchanges. This endpoint provides real-time bid and ask levels with exchange attribution.

## Features

* **Multi-exchange aggregation**: Combines order book data from multiple DEXes
* **Exchange filtering**: Use `exchanges[]` parameter to filter specific exchanges
* **Configurable depth**: Control the number of price levels returned
* **Real-time data**: Updated every 100ms for optimal accuracy

## Request

* **Method**: `GET`
* **Endpoint**: `/orderbook`
* **Query Parameters**: `symbol` (required), `depth`, `exchanges[]`

```bash theme={null}
curl -X GET "https://api.tide.ag/orderbook?symbol=BTC-USD&depth=5" \
  -H "Content-Type: application/json"
```

## Use Cases

* Display aggregated market depth in trading interfaces
* Calculate best bid/ask prices across exchanges
* Analyze liquidity distribution across DEXes
* Build market making strategies

<Note>
  For real-time order book updates, consider using the WebSocket `orderbook:{symbol}` topic instead of polling this endpoint.
</Note>


## OpenAPI

````yaml GET /orderbook
openapi: 3.1.0
info:
  title: Tide API
  description: >-
    Decentralized Perpetual Aggregator API for multi-exchange trading across
    Hyperliquid, Aster, Lighter, and Pacifica
  version: 1.0.0
  contact:
    name: Tide Support
    email: support@tide.ag
    url: https://tide.ag
  license:
    name: MIT
servers:
  - url: https://api.tide.ag
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Market Data
    description: Public market data endpoints
  - name: Trading
    description: Order placement and management
  - name: Positions
    description: Position management and history
  - name: Account
    description: Account and balance management
  - name: System
    description: System status and health
paths:
  /orderbook:
    get:
      tags:
        - Market Data
      summary: Get Aggregated Order Book
      description: Fetch aggregated order book across all or selected DEXes
      parameters:
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BTC-USD
          description: Trading pair symbol
        - name: depth
          in: query
          schema:
            type: integer
            default: 20
            maximum: 100
            minimum: 1
          description: Number of price levels to return
        - name: exchanges[]
          in: query
          style: form
          explode: true
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ExchangeName'
          description: Filter by specific exchanges
      responses:
        '200':
          description: Aggregated order book data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderBook'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    ExchangeName:
      type: string
      enum:
        - hyperliquid
        - aster
        - lighter
        - pacifica
    OrderBook:
      type: object
      properties:
        symbol:
          type: string
          example: BTC-USD
        timestamp:
          type: integer
          description: Timestamp in milliseconds
        bids:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
        asks:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP status code
            type:
              type: string
              description: Error type identifier
            message:
              type: string
              description: Human-readable error message
            details:
              type: string
              description: Additional error details
    OrderBookLevel:
      type: object
      properties:
        price:
          type: string
          description: Price level
        size:
          type: string
          description: Total size at this price level
        exchange:
          $ref: '#/components/schemas/ExchangeName'
        count:
          type: integer
          description: Number of orders at this level
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        API key for authentication. Also requires X-API-SECRET, X-API-TIMESTAMP,
        and X-API-SIGNATURE headers for private endpoints.

````