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

# Polymarket Get Orderbook

Get the order book for one or more Polymarket tokens showing all bids and asks. Supports single token (tokenId) or batch mode (tokenIds array) for efficient multi-token lookup. Returns full depth of market with price levels, sizes, and spread information. Ideal for: market analysis, liquidity assessment, spread monitoring, trading strategy development.

![Polymarket Get Orderbook logo](https://cdn.b3.fun/b3os-icons/polymarket-icon.png)
Catalog action Utility

Get the order book for one or more Polymarket tokens showing all bids and asks. Supports single token (tokenId) or batch mode (tokenIds array) for efficient multi-token lookup. Returns full depth of market with price levels, sizes, and spread information. Ideal for: market analysis, liquidity assessment, spread monitoring, trading strategy development.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `polymarket-get-orderbook` |
| Category | Utility |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `polymarket`, `orderbook`, `market-data`, `read` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tokenId` | `string` | No | The token ID \(condition token asset ID\) to get the order book for. Use for single-token lookup. |
| `tokenIds` | `array` | No | Array of token IDs to fetch order books for in a single batch call. More efficient than multiple single calls. Provide either tokenId or tokenIds, not both. |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market` | `string` | No | Market condition ID |
| `assetId` | `string` | No | Token/asset ID |
| `timestamp` | `string` | No | Order book timestamp |
| `bids` | `array` | No | Bid orders sorted ascending by price |
| `asks` | `array` | No | Ask orders sorted descending by price |
| `bestBid` | `number \| null` | No | Best \(highest\) bid price, null if no bids |
| `bestAsk` | `number \| null` | No | Best \(lowest\) ask price, null if no asks |
| `spread` | `number \| null` | No | Spread between best bid and ask, null if either side is empty |
| `bidCount` | `number` | No | Number of bid levels |
| `askCount` | `number` | No | Number of ask levels |
| `minOrderSize` | `number` | No | Minimum order size |
| `tickSize` | `number` | No | Tick size for the market |
| `negRisk` | `boolean` | No | Whether this is a neg-risk market |
| `lastTradePrice` | `number` | No | Last trade price |
| `orderbooks` | `array` | No | Array of order book results when using batch mode \(tokenIds input\) |

## Examples

**Workflow node**

```json
{
  "type": "polymarket-get-orderbook",
  "payload": {
    "tokenId": "1",
    "tokenIds": [
      "1"
    ]
  },
  "children": []
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/polymarket-get-orderbook/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "tokenId": "1",
    "tokenIds": [
      "1"
    ]
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.