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

# Polymarket Order Book API

> Live CLOB depth and historical spread for Polymarket positions.

The Order Book endpoints expose central limit order book (CLOB) depth for Polymarket positions: the current bids and asks for a position, the order books across a whole market, and historical depth and spread.

## Live depth

* [Get the live order book for a position](/api-reference/order-book/get-order-book), or [every order book in a market](/api-reference/order-book/get-order-books-for-a-market).

## History

* Track depth and spread over time with [order book history](/api-reference/order-book/get-order-book-history) and [spread history](/api-reference/order-book/get-spread-history).

## Market context

* Resolve the market behind a book with [get a market by condition ID](/api-reference/market/get-market-by-condition-id), read its [position metrics](/api-reference/market/get-position-metrics), or see the [holders of a position](/api-reference/holders/get-position-holders).

## Example

<CodeGroup>
  ```typescript SDK theme={null}
  import { StructClient } from "@structbuild/sdk";

  const client = new StructClient({ apiKey: "YOUR_API_KEY" });

  const { data: book } = await client.orderBook.getOrderBook({ position_id: "0xabc..." });

  const { data: spread } = await client.orderBook.getSpreadHistory({ position_id: "0xabc..." });
  ```

  ```bash cURL theme={null}
  curl "https://api.struct.to/v1/polymarket/order-book?position_id=0xabc..." \
    -H "X-API-Key: YOUR_API_KEY"
  ```
</CodeGroup>

## Related

* Guide: [CLOB Liquidity Markets Dashboard](/guides/clob-liquidity-markets-dashboard)
* SDK: [Order Book namespace](/sdk/rest-api#order-book)
* [Core concepts](/introduction/concepts)
