{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper: Markets, Odds & Price History",
    "description": "Scrape Polymarket prediction markets: questions, outcome odds (probability %), volume, liquidity, bid/ask, end dates, resolved outcomes and price history. Top by volume, trending, ending soon, keyword search, tags or event URLs. Monitor mode reports new markets and odds swings.",
    "version": "1.0",
    "x-build-id": "GAOpFtvlfYaAgoMlT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mersetti~polymarket-markets/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mersetti-polymarket-markets",
        "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/mersetti~polymarket-markets/runs": {
      "post": {
        "operationId": "runs-sync-mersetti-polymarket-markets",
        "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/mersetti~polymarket-markets/run-sync": {
      "post": {
        "operationId": "run-sync-mersetti-polymarket-markets",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "topByVolume",
              "trending",
              "endingSoon",
              "search",
              "byTagSlug",
              "byEventSlugs"
            ],
            "type": "string",
            "description": "Which markets to load. \"topByVolume\": highest total volume. \"trending\": highest 24h volume. \"endingSoon\": markets closing next. \"search\": keyword search (uses Keywords). \"byTagSlug\": markets in Polymarket tags/categories (uses Tags). \"byEventSlugs\": specific events or markets (uses Event URLs or slugs).",
            "default": "topByVolume"
          },
          "keywords": {
            "title": "Keywords (search mode)",
            "type": "array",
            "description": "Search terms for mode \"search\", e.g. \"bitcoin\", \"fed rates\", \"election\". Each keyword runs a Polymarket search; maxItems is split across keywords.",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Tags / categories",
            "type": "array",
            "description": "Polymarket tag slugs, e.g. \"politics\", \"crypto\", \"sports\", \"geopolitics\", \"economy\" (a URL like https://polymarket.com/predictions/crypto also works). Required for mode \"byTagSlug\". In topByVolume, trending, endingSoon and search modes they narrow results to these tags.",
            "items": {
              "type": "string"
            }
          },
          "eventSlugs": {
            "title": "Event URLs or slugs (byEventSlugs mode)",
            "type": "array",
            "description": "Polymarket event URLs (https://polymarket.com/event/<slug>), market URLs (https://polymarket.com/event/<event>/<market> or /market/<slug>) or bare slugs. All markets of an event are returned; a market URL returns just that market.",
            "items": {
              "type": "string"
            }
          },
          "onlyActive": {
            "title": "Only open markets",
            "type": "boolean",
            "description": "Only markets that are active and not closed. Turn off to include closed and resolved markets (with resolvedOutcome).",
            "default": true
          },
          "minVolume": {
            "title": "Minimum total volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with lower total traded volume. 0 = no limit.",
            "default": 0
          },
          "minLiquidity": {
            "title": "Minimum liquidity (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with lower order book liquidity. 0 = no limit.",
            "default": 0
          },
          "maxItems": {
            "title": "Max markets",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of markets to load. In monitor mode this is the size of the watched list (e.g. top 200 trending markets); you are charged only for reported changes.",
            "default": 100
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Adds priceHistory (time series of the first outcome's probability in %, e.g. \"Yes\") from Polymarket's CLOB API. One extra request per market.",
            "default": false
          },
          "priceHistoryInterval": {
            "title": "Price history period",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "Time span of the price history.",
            "default": "1w"
          },
          "priceHistoryFidelity": {
            "title": "Price history resolution (minutes)",
            "minimum": 0,
            "maximum": 10080,
            "type": "integer",
            "description": "Minutes between data points. 0 = automatic (1h: 1 min, 6h: 5 min, 1d and 1w: 60 min, 1m: 6 h, all time: 1 day).",
            "default": 0
          },
          "monitorMode": {
            "title": "Monitor mode (only changes)",
            "type": "boolean",
            "description": "Remembers markets and odds between runs and outputs only changes: new markets, odds changes of at least the threshold, and markets that closed/resolved. Schedule the Actor (e.g. hourly) for an alert feed. You pay only for changes.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name of the saved state. Use different IDs for different watchlists.",
            "default": "default"
          },
          "oddsChangeThreshold": {
            "title": "Odds change threshold (percentage points)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Report a market when any outcome's probability moved by at least this many percentage points (e.g. 5 = from 40% to 45%).",
            "default": 5
          },
          "compareTo": {
            "title": "Compare odds with",
            "enum": [
              "lastRun",
              "lastAlert"
            ],
            "type": "string",
            "description": "\"lastRun\": odds from the previous run (detects fast swings). \"lastAlert\": odds when the market was last reported or first seen (also catches slow drifts).",
            "default": "lastRun"
          },
          "baselineOnFirstRun": {
            "title": "Silent first run",
            "type": "boolean",
            "description": "The first run of a watchlist only saves the current markets and odds (no output, no cost), so later runs report real changes.",
            "default": true
          },
          "reportNewMarkets": {
            "title": "Report new markets",
            "type": "boolean",
            "description": "Output markets this monitor has not seen before (changeType = new).",
            "default": true
          },
          "reportOddsChanges": {
            "title": "Report odds changes",
            "type": "boolean",
            "description": "Output markets whose odds moved by at least the threshold (changeType = oddsChange).",
            "default": true
          },
          "reportResolved": {
            "title": "Report closed / resolved markets",
            "type": "boolean",
            "description": "Output watched markets that closed since the previous run, with the winning outcome (changeType = resolved).",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}