---
title: "Get Order Book"
method: POST
path: "/market-data/order-book"
tags: ["Market Data"]
---

# Get Order Book

`POST /market-data/order-book`

Get order book snapshot with specified depth.

Args:
    request: Order book request with connector, trading pair, and depth
    market_data_manager: Injected market data feed manager
    
Returns:
    Order book snapshot with bids and asks
    
Raises:
    HTTPException: 500 if there's an error fetching order book

## Request body

- OrderBookRequest — Request model for getting order book data
  - `connector_name` string, required — Name of the connector
  - `trading_pair` string, required — Trading pair
  - `depth` integer — Number of price levels to return

## Response `200`

Successful Response

- OrderBookResponse — Response for order book data
  - `trading_pair` string, required — Trading pair
  - `bids` OrderBookLevel[], required — Bid levels (highest to lowest)
    - `price` number, required — Price level
    - `amount` number, required — Amount at this price level
  - `asks` OrderBookLevel[], required — Ask levels (lowest to highest)
    - `price` number, required — Price level
    - `amount` number, required — Amount at this price level
  - `timestamp` number, required — Snapshot timestamp

## Other responses

- `422` — Validation Error

## Changes

- **2026-04-08** `92703f48a69e` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2025-12-20** `1005bcd47280` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hummingbot/apis/hummingbot-api/changes/market-data/order-book/post.md)

---

[API](https://skmtc.dev/hummingbot/apis/hummingbot-api.md) · [All operations](https://skmtc.dev/hummingbot/apis/hummingbot-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hummingbot/hummingbot-api/revisions/5347fe79537f/schema)
