{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Order Book Scraper API - CLOB Bids & Asks",
    "description": "The full live Polymarket order book per market: every bid and ask level with size, best bid, best ask, spread, and the total USD depth standing on each side, plus tick size and minimum order size. Books are fetched in batches. Failures are free, no run-start fee.",
    "version": "1.0",
    "x-build-id": "gXGPAjm77FeS4h4br"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vonsensey~polymarket-orderbook-clob-prices-scraper-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vonsensey-polymarket-orderbook-clob-prices-scraper-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/vonsensey~polymarket-orderbook-clob-prices-scraper-api/runs": {
      "post": {
        "operationId": "runs-sync-vonsensey-polymarket-orderbook-clob-prices-scraper-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/vonsensey~polymarket-orderbook-clob-prices-scraper-api/run-sync": {
      "post": {
        "operationId": "run-sync-vonsensey-polymarket-orderbook-clob-prices-scraper-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "platforms": {
            "title": "Venues",
            "type": "array",
            "description": "Which prediction markets to read. Leave both on to get one normalised schema across the two, which is what makes the rows directly comparable.",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "polymarket"
            ]
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "markets",
              "arbitrage"
            ],
            "type": "string",
            "description": "Markets returns one row per market. Arbitrage returns one row per cross-venue price gap — the same question priced differently on the two venues, with the edge worked out. Arbitrage always reads both venues.",
            "default": "markets"
          },
          "search": {
            "title": "Search",
            "type": "string",
            "description": "Optional. Narrow to markets whose slug matches this text, e.g. `election`, `bitcoin`, `fed-rate`."
          },
          "eventSlugs": {
            "title": "Polymarket event slugs",
            "type": "array",
            "description": "Optional. Restrict Polymarket to specific events, e.g. `kraken-ipo-in-2025`. Take the slug from the event URL.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "seriesTicker": {
            "title": "Kalshi series",
            "type": "string",
            "description": "Optional. Restrict Kalshi to one or more series — comma separated. e.g. `KXHIGHNY` for New York daily highs, or `KXHIGHNY,KXHIGHCHI,KXHIGHMIA` for several cities at once. Leave empty for everything."
          },
          "tickers": {
            "title": "Kalshi market tickers",
            "type": "array",
            "description": "Optional. Restrict to specific Kalshi markets by full ticker, e.g. `KXOAIANTH-40-ANTH`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "closed",
              "settled"
            ],
            "type": "string",
            "description": "Open returns markets currently trading. Closed and settled return resolved markets with their outcome.",
            "default": "open"
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard ceiling on billable rows. The default of 100 keeps a first run well under a cent.",
            "default": 50
          },
          "includeOrderBook": {
            "title": "Include the live order book",
            "type": "boolean",
            "description": "Adds every bid and ask level with size, best bid, best ask, spread and total USD depth per side. Billed as its own event, and never billed when the book could not be fetched.",
            "default": true
          },
          "includeHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Adds OHLC candles with volume and open interest. Billed as its own event, and never billed when no history could be fetched.",
            "default": false
          },
          "historyDays": {
            "title": "History window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How far back price history goes, up to a year.",
            "default": 7
          },
          "historyIntervalMinutes": {
            "title": "Candle size",
            "enum": [
              "1",
              "60",
              "1440"
            ],
            "type": "string",
            "description": "Minutes per candle.",
            "default": "60"
          },
          "monitorChangesOnly": {
            "title": "Only bill markets that moved",
            "type": "boolean",
            "description": "For schedules. The run remembers what it saw last time and bills only markets whose watched fields have changed since; unchanged markets come back as free rows. This is what makes a 5-minute cron affordable.",
            "default": false
          },
          "watchFields": {
            "title": "Fields that count as a change",
            "type": "array",
            "description": "Which fields make a market billable again on a re-run. Price and status by default. Adding volume makes any trade at all count as a change.",
            "items": {
              "type": "string",
              "enum": [
                "price",
                "status",
                "volume",
                "liquidity",
                "openInterest"
              ],
              "enumTitles": [
                "Price",
                "Status",
                "Volume",
                "Liquidity",
                "Open interest"
              ]
            },
            "default": [
              "price",
              "status"
            ]
          },
          "minEdge": {
            "title": "Minimum edge",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Arbitrage only. Smallest price gap worth reporting, in probability points × 100 — 2 means a 0.02 gap.",
            "default": 2
          },
          "minSimilarity": {
            "title": "Match strictness",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Arbitrage only. How closely two questions must match to be treated as the same market, 0–100. Higher is stricter. Pairs whose numbers disagree are always refused, whatever this is set to.",
            "default": 50
          },
          "minLiquidity": {
            "title": "Minimum liquidity per side",
            "minimum": 0,
            "type": "integer",
            "description": "Arbitrage only. Drop pairs where either venue has less than this much liquidity. Leave empty to keep all pairs."
          },
          "maxCostUsd": {
            "title": "Stop after spending (USD)",
            "minimum": 0.01,
            "type": "number",
            "description": "A hard ceiling on what one run may spend, in USD. The run stops cleanly at the limit and says so in the free summary row. Accepts cents (0.25 is valid). Leave empty for no ceiling."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}