{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper: Prediction Market Odds & Prices",
    "description": "Live Polymarket odds by keyword, tag or URL: outcome prices and probabilities, 24h/total volume, liquidity, end date, resolution and winner, optional price history and a free order book. Searches keep only markets matching every word. No key. $1.20 per 1,000 markets.",
    "version": "0.1",
    "x-build-id": "uo1ogcxlfBVWK4rwK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidyharvest~polymarket-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidyharvest-polymarket-scraper",
        "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/tidyharvest~polymarket-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tidyharvest-polymarket-scraper",
        "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/tidyharvest~polymarket-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tidyharvest-polymarket-scraper",
        "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": {
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Find markets by keyword, the same search as on polymarket.com (e.g. `fed rates`, `bitcoin`, `election`). One search per line. Empty = browse all markets (optionally by tag).",
            "items": {
              "type": "string"
            }
          },
          "matchAllWords": {
            "title": "Every search word must match",
            "type": "boolean",
            "description": "Keep only markets whose question, event title or outcome contains every word of your search (any case; `rates` also matches `rate`). Polymarket's own search also returns loose matches: `taylor swift` brings NFL players named Swift or Taylor. Turn off to get the site's full result list.",
            "default": true
          },
          "tag": {
            "title": "Tag / category",
            "type": "string",
            "description": "Only markets with this Polymarket tag, by slug or name: `politics`, `crypto`, `sports`, `economy`, `elections`, `tech`, `geopolitics`, `ai`... Works for browsing and narrows keyword searches."
          },
          "urls": {
            "title": "Polymarket URLs or slugs",
            "type": "array",
            "description": "Specific events or markets: `https://polymarket.com/event/<event-slug>` (all its markets), `.../event/<event>/<market-slug>` (one market), or a bare slug. Open and resolved markets are both returned (Status `closed` keeps only resolved ones).",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "enum": [
              "open",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "Open markets, closed (resolved) markets, or both.",
            "default": "open"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24hr",
              "volume",
              "liquidity",
              "endingSoon",
              "newest"
            ],
            "type": "string",
            "description": "Order of results. For keyword searches the best matches are fetched first, then sorted.",
            "default": "volume24hr"
          },
          "minVolume": {
            "title": "Min total volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with less lifetime trading volume."
          },
          "minVolume24h": {
            "title": "Min 24h volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with less trading volume in the last 24 hours."
          },
          "minLiquidity": {
            "title": "Min liquidity (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip thin markets with less liquidity on the order book."
          },
          "endDateFrom": {
            "title": "Ends on or after",
            "type": "string",
            "description": "Only markets whose end (resolution) date is on or after this date (YYYY-MM-DD)."
          },
          "endDateTo": {
            "title": "Ends on or before",
            "type": "string",
            "description": "Only markets whose end (resolution) date is on or before this date (YYYY-MM-DD)."
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop markets whose question, event or description mentions any of these (applied before billing). E.g. `up or down` to skip 15-minute crypto markets.",
            "items": {
              "type": "string"
            }
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Add a price (probability) time series to each outcome from Polymarket's CLOB. Billed per price point (see Pricing).",
            "default": false
          },
          "historyInterval": {
            "title": "History window",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "How far back the price history goes.",
            "default": "1w"
          },
          "historyFidelityMinutes": {
            "title": "History resolution (minutes)",
            "minimum": 1,
            "type": "integer",
            "description": "Spacing between price points in minutes (60 = hourly, 1440 = daily).",
            "default": 60
          },
          "maxHistoryPointsPerOutcome": {
            "title": "Max history points per outcome",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Keep only the most recent N points per outcome. Caps the price-point cost.",
            "default": 200
          },
          "includeOrderBook": {
            "title": "Include order book (free)",
            "type": "boolean",
            "description": "Add a live order-book snapshot (best bid/ask, top levels, total depth) to each outcome of open markets. No extra charge.",
            "default": false
          },
          "orderBookDepth": {
            "title": "Order book levels",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many bid and ask levels to keep per outcome.",
            "default": 10
          },
          "maxItems": {
            "title": "Max markets",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on markets per run (shared across searches/URLs). Also caps your cost.",
            "default": 50
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}