{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper: Markets, Odds, Price History and Trades",
    "description": "Scrape Polymarket prediction markets: question, outcomes and live prices, volume, liquidity, dates, tags and status. Search, browse by tag or paste links. Also price history and recent trades, plus a monitor that returns only markets whose odds moved. No login.",
    "version": "0.1",
    "x-build-id": "KTfNIxrjXuAKpzhS5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themineworks~polymarket-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themineworks-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/themineworks~polymarket-scraper/runs": {
      "post": {
        "operationId": "runs-sync-themineworks-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/themineworks~polymarket-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-themineworks-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "markets",
              "priceHistory",
              "trades"
            ],
            "type": "string",
            "description": "Markets: one row per market with its outcomes, prices, volume, liquidity, dates, tags and status. Price history: one row per price point for each selected market. Trades: one row per recent trade on each selected market.",
            "default": "markets"
          },
          "searchQueries": {
            "title": "Search Polymarket",
            "type": "array",
            "description": "Words to search for, the same as the search box on polymarket.com, for example \"bitcoin\", \"fed rates\" or \"world cup\". Each search returns its best matching markets, up to Max markets per search, tag or browse. Leave Search, Tags and Links empty to browse all markets.",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Tags or categories",
            "type": "array",
            "description": "Polymarket tag slugs, for example politics, crypto, sports, economy, elections, tech or geopolitics: the last part of a category link such as polymarket.com/politics. Each tag returns its markets, up to Max markets per search, tag or browse.",
            "items": {
              "type": "string"
            }
          },
          "marketUrls": {
            "title": "Market or event links",
            "type": "array",
            "description": "Polymarket links (https://polymarket.com/event/... or .../event/<event>/<market>), market or event slugs, numeric market IDs or 0x condition IDs, up to 1,000. A market link returns that market. An event link returns the event's markets that pass the filters below.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "Open: markets still trading. Closed: finished markets (with the winning outcome when resolved). All: both. Applies to search, tags, browsing and event links, not to links of single markets.",
            "default": "open"
          },
          "minVolume": {
            "title": "Minimum total volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only markets that have traded at least this many dollars in total. 0 keeps every market.",
            "default": 0
          },
          "minLiquidity": {
            "title": "Minimum liquidity (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only markets with at least this many dollars of liquidity in the order book. 0 keeps every market.",
            "default": 0
          },
          "endDateFrom": {
            "title": "Ends on or after",
            "type": "string",
            "description": "Only markets whose end date is on or after this day (YYYY-MM-DD)."
          },
          "endDateTo": {
            "title": "Ends on or before",
            "type": "string",
            "description": "Only markets whose end date is on or before this day (YYYY-MM-DD)."
          },
          "sortBy": {
            "title": "Sort markets by",
            "enum": [
              "volume24h",
              "volume",
              "liquidity",
              "endingSoon",
              "newest"
            ],
            "type": "string",
            "description": "Order of the markets: most traded in the last 24 hours, most traded overall, most liquidity, ending soonest, or newest first. Searches keep their best matches and sort them this way.",
            "default": "volume24h"
          },
          "maxMarkets": {
            "title": "Max markets per search, tag or browse",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Most markets to take from each search, each tag, or from browsing all markets. Links are not counted. From 10 to 2,000.",
            "default": 100
          },
          "onlyPriceMoves": {
            "title": "Only markets whose odds moved (monitor)",
            "type": "boolean",
            "description": "Markets mode only. Return a market only when one of its outcome prices moved at least Minimum move since the price this actor last delivered to you for the same searches, tags and links. Prices are kept in a key value store in your own Apify account. Run it on a schedule.",
            "default": false
          },
          "minPriceMovePoints": {
            "title": "Minimum move (percentage points)",
            "minimum": 0.1,
            "maximum": 100,
            "type": "number",
            "description": "With the monitor on: how far an outcome price must move to be returned, in percentage points. 5 means a move from 40% to 45% or more. From 0.1 to 100.",
            "default": 5
          },
          "monitorIncludeNew": {
            "title": "Also return new markets",
            "type": "boolean",
            "description": "With the monitor on: also return markets the monitor has not seen before (on the first run that is every market). Turn off to get only moves.",
            "default": true
          },
          "historyInterval": {
            "title": "Price history window",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "Price history mode: how far back to go. A closed market with no points in the window gets its full daily history instead.",
            "default": "1w"
          },
          "historyFidelityMinutes": {
            "title": "Minutes between price points",
            "minimum": 1,
            "maximum": 10080,
            "type": "integer",
            "description": "Price history mode: the spacing of the points in minutes. 60 gives hourly points, 1440 daily points. From 1 to 10,080.",
            "default": 60
          },
          "maxPointsPerMarket": {
            "title": "Max price points per market",
            "minimum": 10,
            "maximum": 50000,
            "type": "integer",
            "description": "Price history mode: the most recent points kept per market. From 10 to 50,000.",
            "default": 500
          },
          "maxTradesPerMarket": {
            "title": "Max trades per market",
            "minimum": 10,
            "maximum": 10000,
            "type": "integer",
            "description": "Trades mode: the most recent trades returned per market, newest first. From 10 to 10,000.",
            "default": 100
          },
          "minTradeUsd": {
            "title": "Minimum trade size (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Trades mode: only trades worth at least this many dollars, for example 1000 to follow large trades. 0 keeps every trade.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}