{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket & Kalshi Scraper - Odds, Markets & Arbitrage",
    "description": "Scrape Polymarket & Kalshi prediction markets: live odds & implied probability, 24h/weekly volume, liquidity, order flow (trades), top holders, wallet P&L, price history, and cross-platform arbitrage. Keyless, no browser. Monitor mode tracks odds moves and new markets. Export to JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "ZmWGoXFPiNujsqfvM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~prediction-markets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-prediction-markets-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/scrapesage~prediction-markets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-prediction-markets-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/scrapesage~prediction-markets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-prediction-markets-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",
              "events",
              "kalshi",
              "priceHistory",
              "trades",
              "holders",
              "wallet",
              "arbitrage"
            ],
            "type": "string",
            "description": "Choose the data to extract. `Markets` and `Events` come from Polymarket. `Kalshi markets` pulls Kalshi.com. `Price history`, `Trades`, `Holders` and `Wallet` are Polymarket deep-dives. `Arbitrage` matches the same question across Polymarket and Kalshi and flags price gaps.",
            "default": "markets"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword to search Polymarket markets/events (e.g. `election`, `bitcoin`, `fed rate`, `super bowl`). Leave empty to list the top markets/events by volume."
          },
          "tagSlugs": {
            "title": "Category / tag slugs (Polymarket)",
            "type": "array",
            "description": "Filter Polymarket markets/events by category tag slug, e.g. `politics`, `crypto`, `sports`, `economy`, `elections`, `geopolitics`, `tech`, `pop-culture`. Multiple = OR.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs / slugs / tickers",
            "type": "array",
            "description": "Auto-routed targets. Accepts Polymarket event/market URLs (`https://polymarket.com/event/<slug>`), bare Polymarket slugs, Kalshi market URLs, or Kalshi tickers. Each is fetched directly.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "active",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "Which markets to include: `Active` (open, accepting orders), `Closed` (resolved/ended), or `All`.",
            "default": "active"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24hr",
              "volume",
              "liquidity",
              "volume1wk",
              "competitive",
              "startDate",
              "endDate"
            ],
            "type": "string",
            "description": "Order Polymarket results (highest first).",
            "default": "volume24hr"
          },
          "marketSlugs": {
            "title": "Polymarket market slugs",
            "type": "array",
            "description": "Specific Polymarket market slugs to fetch directly (the last path segment of a market URL).",
            "items": {
              "type": "string"
            }
          },
          "eventSlugs": {
            "title": "Polymarket event slugs",
            "type": "array",
            "description": "Specific Polymarket event slugs to fetch directly.",
            "items": {
              "type": "string"
            }
          },
          "conditionIds": {
            "title": "Condition IDs (markets)",
            "type": "array",
            "description": "Polymarket market `conditionId` values. Used by Trades, Holders and Price-history modes to target exact markets.",
            "items": {
              "type": "string"
            }
          },
          "walletAddresses": {
            "title": "Wallet addresses",
            "type": "array",
            "description": "Polymarket proxy wallet addresses (0x…) for Wallet mode (P&L, positions, portfolio value) or Trades-by-wallet.",
            "items": {
              "type": "string"
            }
          },
          "kalshiTickers": {
            "title": "Kalshi market tickers",
            "type": "array",
            "description": "Specific Kalshi market tickers to fetch in Kalshi mode.",
            "items": {
              "type": "string"
            }
          },
          "kalshiSeriesTickers": {
            "title": "Kalshi series / event tickers",
            "type": "array",
            "description": "Kalshi series or event tickers (e.g. `KXPRES`, `KXBTCD`) to pull all their markets in Kalshi mode.",
            "items": {
              "type": "string"
            }
          },
          "includePriceHistory": {
            "title": "Enrich with price history",
            "type": "boolean",
            "description": "For Markets/Events: attach the time-series odds (price chart) for each outcome token. Adds one request per token.",
            "default": false
          },
          "priceHistoryInterval": {
            "title": "Price-history interval",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "Look-back window for price history.",
            "default": "1w"
          },
          "priceHistoryFidelity": {
            "title": "Price-history fidelity (minutes)",
            "minimum": 1,
            "type": "integer",
            "description": "Minutes between price points (lower = more granular, more data).",
            "default": 60
          },
          "includeTopHolders": {
            "title": "Enrich with top holders",
            "type": "boolean",
            "description": "For Markets: attach the largest position holders (smart money) per outcome. Adds one request per market.",
            "default": false
          },
          "topHoldersLimit": {
            "title": "Top holders per market",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many top holders to fetch when enriching markets.",
            "default": 10
          },
          "includeRecentTrades": {
            "title": "Enrich with recent trades",
            "type": "boolean",
            "description": "For Markets: attach the most recent trades (order flow) per market. Adds one request per market.",
            "default": false
          },
          "recentTradesLimit": {
            "title": "Recent trades per market",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many recent trades to fetch when enriching markets, or per target in Trades mode.",
            "default": 20
          },
          "arbMinSpread": {
            "title": "Arbitrage — min price spread",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Minimum YES-probability gap between Polymarket and Kalshi to report (e.g. 0.03 = 3 cents).",
            "default": 0.03
          },
          "arbMinSimilarity": {
            "title": "Arbitrage — min title similarity",
            "minimum": 0.1,
            "maximum": 1,
            "type": "number",
            "description": "How closely the two platforms' questions must match (0–1) before they are treated as the same market. Higher = stricter.",
            "default": 0.55
          },
          "monitorMode": {
            "title": "Monitor mode (only new & changed)",
            "type": "boolean",
            "description": "Remember results between runs and emit ONLY markets that are new, whose odds moved, whose volume spiked, or that changed status/resolved. Perfect with Apify Schedules for odds alerts. State is kept in a named key-value store and is independent of Apify's scheduler.",
            "default": false
          },
          "monitorMinOddsChange": {
            "title": "Monitor — min odds change",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Minimum absolute change in a market's YES probability (0–1) to count as an `odds_move` (e.g. 0.02 = 2 cents).",
            "default": 0.02
          },
          "minVolume24h": {
            "title": "Min 24h volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets/events with less than this 24-hour traded volume. 0 = no filter.",
            "default": 0
          },
          "minLiquidity": {
            "title": "Min liquidity (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets/events with less than this liquidity. 0 = no filter.",
            "default": 0
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum primary records to return per run (markets, events, kalshi markets, trades, etc.). 0 = no cap.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Maximum parallel API requests.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. The Polymarket and Kalshi APIs are public and lenient, so Apify datacenter proxy (the default) is plenty.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}