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

# Get Prediction Order Book

> Get the live order book (bids and asks) for a specific outcome of a prediction market.

<Warning>**Alpha** — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.</Warning>

### Query Parameters

<ParamField query="platform" type="string" required>
  The prediction market platform (e.g., `polymarket`).
</ParamField>

<ParamField query="outcomeId" type="string" required>
  The outcome token ID to get the book for.
</ParamField>

### Response

<ResponseField name="data" type="object">
  Order book data.

  <Expandable title="Book Data">
    <ResponseField name="bids" type="array">
      Array of bid levels, sorted by price descending.

      <Expandable title="BookLevel">
        <ResponseField name="priceUSD" type="number">Price level in USD.</ResponseField>
        <ResponseField name="sizeToken" type="number">Total size in outcome tokens at this level.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="asks" type="array">
      Array of ask levels, sorted by price ascending.

      <Expandable title="BookLevel">
        <ResponseField name="priceUSD" type="number">Price level in USD.</ResponseField>
        <ResponseField name="sizeToken" type="number">Total size in outcome tokens at this level.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="hostname" type="string">Server node identifier.</ResponseField>
<ResponseField name="took" type="number">Request processing time in milliseconds.</ResponseField>

### Usage Example

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/pm/market/book?platform=polymarket&outcomeId=71321..."
```

### Example Response

```json theme={null}
{
  "data": {
    "bids": [
      { "priceUSD": 0.34, "sizeToken": 5000 },
      { "priceUSD": 0.33, "sizeToken": 12000 },
      { "priceUSD": 0.32, "sizeToken": 8000 }
    ],
    "asks": [
      { "priceUSD": 0.36, "sizeToken": 4500 },
      { "priceUSD": 0.37, "sizeToken": 9000 },
      { "priceUSD": 0.38, "sizeToken": 15000 }
    ]
  },
  "hostname": "node-xyz",
  "took": 42
}
```


## OpenAPI

````yaml GET /2/pm/market/book
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula Prediction Markets API
  description: >-
    Documentation of the Mobula Prediction Markets API.


    The PM API is currently served from a dedicated host:
    `pm-api-prod-eu.mobula.io`.

    All endpoints below require an API key (same key as the main Mobula API).


    Parameter names below are the **canonical names enforced by the API

    controllers** (Zod-validated). Following the wrong name (e.g. `?market=...`

    instead of `?platform=...&marketId=...`) returns `HTTP 400`.
servers:
  - url: https://pm-api-prod-eu.mobula.io/api/
    description: PM Production API (requires API key)
security: []
tags:
  - name: V2 - PM Market
    description: Prediction market data — details, prices, order book, trades, OHLCV
  - name: V2 - PM Discovery
    description: Search, trending, categories, live markets
  - name: V2 - PM Wallet
    description: Wallet prediction-market positions, balances, PnL, activity, status
paths:
  /2/pm/market/book:
    get:
      tags:
        - V2 - PM Market
      summary: Get Prediction Order Book
      description: >
        Get the live CLOB order book (bids and asks) for a specific outcome.


        Required params: `platform` + `outcomeId`. The order book is per-outcome
        (each side

        of the market has its own token id), so `marketId` is not used here.
      parameters:
        - $ref: '#/components/parameters/Platform'
        - $ref: '#/components/parameters/OutcomeId'
      responses:
        '200':
          description: Order book — top-of-book first (bids price desc, asks price asc).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bids:
                        type: array
                      asks:
                        type: array
components:
  parameters:
    Platform:
      name: platform
      in: query
      required: true
      description: >-
        Prediction market platform. Today only `polymarket` is supported; any
        other value returns 400.
      schema:
        type: string
        enum:
          - polymarket
        example: polymarket
    OutcomeId:
      name: outcomeId
      in: query
      required: true
      description: >-
        Polymarket outcome / token ID — uint256 decimal string (the ERC-1155
        token id of the YES/NO/etc. side).
      schema:
        type: string
        pattern: ^[0-9]+$
        example: >-
          59855952379545476461266875939089074481171378466995213858930892770855011813551

````