Get a Polymarket order-book snapshot
Read live bids and asks for a Polymarket market.
GET /markets/{id}/book
Inspect available depth before estimating execution prices. Books change between requests, and resolved or inactive tokens may have no book. Subscribe to a market when you need ongoing recordings.
Authentication
Send your key in the X-API-Key header. Keep the key out of URLs and shared logs.
Parameters
| Name | Location | Type | Required | Details |
|---|---|---|---|---|
id | path | string | Yes | minLength: 1. maxLength: 160. pattern: ^[A-Za-z0-9_.-]+$. |
Example request
curl --fail-with-body -X GET \
"https://polymarket.omray.dev/markets/YOUR_WALLET_OR_MARKET_ID/book" \
-H "X-API-Key: $PM_API_KEY"Responses
| Status | Meaning |
|---|---|
200 | Successful Response |
422 | Validation Error |
Authenticated requests can return 401 for an invalid key or 429 when a plan limit is reached. Upstream failures may return a server error; do not treat an error as an empty dataset.
OpenAPI operation schema
{
"tags": [
"Markets"
],
"summary": "Polymarket order book snapshots",
"description": "Fetch current bid and ask levels. Subscribe to a market to keep recording snapshots.",
"operationId": "market_book",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[A-Za-z0-9_.-]+$",
"title": "Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MarketBook"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}