Record a Polymarket market's order books
Subscribe to ongoing order-book recordings for a market.
PUT /subscriptions/{id}
A subscription enables background recording and opens your recording access window. It does not place an order or start trading. You can read only snapshots captured during your own recording windows, within retention.
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 PUT \
"https://polymarket.omray.dev/subscriptions/YOUR_WALLET_OR_MARKET_ID" \
-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": [
"Subscriptions"
],
"summary": "Record live order books for a market",
"operationId": "subscribe_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/Subscription"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}