{
  "openapi": "3.0.1",
  "info": {
    "title": "Prediction Market Scanner: Polymarket + Kalshi Odds & Arbitrage",
    "description": "Polymarket and Kalshi in one Actor: live odds, cross-platform arbitrage, whale trades, wallet PnL and positions, top traders, new and resolved markets, and price history. Official public APIs, no login.",
    "version": "0.2",
    "x-build-id": "hlNMQ2DNTdVZ1zyvO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/varnmill~prediction-market-scanner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-varnmill-prediction-market-scanner",
        "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/varnmill~prediction-market-scanner/runs": {
      "post": {
        "operationId": "runs-sync-varnmill-prediction-market-scanner",
        "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/varnmill~prediction-market-scanner/run-sync": {
      "post": {
        "operationId": "run-sync-varnmill-prediction-market-scanner",
        "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 fetch",
            "enum": [
              "markets",
              "arbitrage",
              "whaleTrades",
              "traderAnalytics",
              "topTraders",
              "newMarkets",
              "resolvedMarkets",
              "priceHistory"
            ],
            "type": "string",
            "description": "markets: live odds from Polymarket and Kalshi in one table. arbitrage: the same question matched across both platforms with price gaps and arbitrage edges. whaleTrades: large Polymarket trades. traderAnalytics: positions, PnL and trade history for Polymarket wallets or usernames. topTraders: the public Polymarket leaderboard. newMarkets: markets created since a date or since the last run. resolvedMarkets: recently resolved markets with the winning outcome. priceHistory: price time series for given markets.",
            "default": "markets"
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which venues to include in markets, newMarkets and resolvedMarkets modes. Arbitrage always uses both.",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "polymarket",
              "kalshi"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Only keep markets whose title, event or category contains any of these words, e.g. bitcoin, election, fed, nfl. Used by markets, arbitrage, whaleTrades, newMarkets and resolvedMarkets. Leave empty for everything.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop markets whose title, event or category contains any of these words, e.g. 'up or down', 'sports', 'esports'. newMarkets and resolvedMarkets modes.",
            "items": {
              "type": "string"
            }
          },
          "maxMarketsPerPlatform": {
            "title": "Max markets per platform",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Markets mode: fetched highest 24h volume first. newMarkets and resolvedMarkets: most rows per venue per run (newest first).",
            "default": 500
          },
          "minVolume24hUsd": {
            "title": "Minimum 24h volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Markets mode: skip thin markets. Kalshi volume is converted from contracts at the last price.",
            "default": 0
          },
          "closesWithinDays": {
            "title": "Closes within (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Only markets that close within this many days. Leave empty for all."
          },
          "minMatchScore": {
            "title": "Minimum match score (arbitrage)",
            "minimum": 0.3,
            "maximum": 1,
            "type": "number",
            "description": "0 to 1. How similar two market titles must be to count as the same question. 0.55 is a good default; raise it for fewer, safer matches.",
            "default": 0.55
          },
          "minPriceGap": {
            "title": "Minimum price gap",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Only output matched pairs whose implied probabilities differ by at least this much (0.03 = 3 points).",
            "default": 0
          },
          "onlyArbitrage": {
            "title": "Only pairs with a positive edge",
            "type": "boolean",
            "description": "Keep only pairs where buying YES on one venue and NO on the other costs less than $1.00 before fees.",
            "default": false
          },
          "minTradeUsd": {
            "title": "Minimum trade size (USD)",
            "minimum": 1,
            "type": "integer",
            "description": "Whale trades mode: smallest trade to include.",
            "default": 5000
          },
          "maxTrades": {
            "title": "Max trades",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Whale trades mode: most recent trades first.",
            "default": 200
          },
          "traders": {
            "title": "Wallets or usernames",
            "type": "array",
            "description": "traderAnalytics mode: Polymarket public proxy wallet addresses (0x..., the address shown in a profile URL; never a private key or seed phrase), exact usernames, or profile URLs such as https://polymarket.com/@name or https://polymarket.com/profile/0x.... All data returned is public on-chain activity.",
            "items": {
              "type": "string"
            }
          },
          "traderData": {
            "title": "Sections",
            "type": "array",
            "description": "Which rows to output per trader. summary: one row with portfolio value, total, realized and unrealized PnL, volume and rank. positions: open positions with mark-to-market PnL. closedPositions: closed positions with realized PnL. activity: trade history (trades, redemptions, merges and splits).",
            "items": {
              "type": "string",
              "enum": [
                "summary",
                "positions",
                "closedPositions",
                "activity"
              ],
              "enumTitles": [
                "Summary",
                "Open positions",
                "Closed positions",
                "Activity / trade history"
              ]
            },
            "default": [
              "summary",
              "positions",
              "closedPositions",
              "activity"
            ]
          },
          "maxRecordsPerTrader": {
            "title": "Max rows per section per trader",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap for positions, closed positions and activity rows per trader (newest or largest first).",
            "default": 100
          },
          "activityTypes": {
            "title": "Activity types",
            "type": "array",
            "description": "Which activity to include in the activity section. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "TRADE",
                "REDEEM",
                "MERGE",
                "SPLIT",
                "REWARD",
                "CONVERSION"
              ],
              "enumTitles": [
                "Trades",
                "Redemptions",
                "Merges",
                "Splits",
                "Rewards",
                "Conversions"
              ]
            },
            "default": [
              "TRADE",
              "REDEEM"
            ]
          },
          "leaderboardPeriod": {
            "title": "Leaderboard period",
            "enum": [
              "DAY",
              "WEEK",
              "MONTH",
              "ALL"
            ],
            "type": "string",
            "description": "topTraders mode: ranking window.",
            "default": "MONTH"
          },
          "leaderboardCategory": {
            "title": "Leaderboard category",
            "enum": [
              "OVERALL",
              "POLITICS",
              "SPORTS",
              "CRYPTO",
              "CULTURE",
              "MENTIONS",
              "WEATHER",
              "ECONOMICS",
              "TECH",
              "FINANCE"
            ],
            "type": "string",
            "description": "topTraders mode: overall or one market category.",
            "default": "OVERALL"
          },
          "leaderboardOrderBy": {
            "title": "Rank by",
            "enum": [
              "PNL",
              "VOL"
            ],
            "type": "string",
            "description": "topTraders mode: profit or volume.",
            "default": "PNL"
          },
          "maxTraders": {
            "title": "Max traders",
            "minimum": 1,
            "maximum": 2050,
            "type": "integer",
            "description": "topTraders mode: how many leaderboard rows (the public leaderboard goes about 2,000 deep).",
            "default": 100
          },
          "since": {
            "title": "Since (date or time)",
            "type": "string",
            "description": "newMarkets and resolvedMarkets: only markets created (or resolved) after this time, e.g. 2026-10-01 or 2026-10-12T08:00:00Z. Overrides 'since last run' and 'lookback'."
          },
          "lookbackHours": {
            "title": "Lookback (hours)",
            "minimum": 1,
            "maximum": 2160,
            "type": "integer",
            "description": "newMarkets and resolvedMarkets: window used when 'since' is empty and there is no saved state yet. Polymarket alone creates about 14,000 and resolves about 20,000 markets a day, mostly short crypto and sports markets, so use keywords or a volume floor for long windows.",
            "default": 24
          },
          "sinceLastRun": {
            "title": "Only markets since the last run",
            "type": "boolean",
            "description": "Remember where this feed stopped (in the named key-value store 'prediction-market-scanner-state') and output only markets that are new since the previous run. Ideal for schedules. The state is kept per mode, platforms, keywords and volume floor, or per 'state key'.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Optional name for the 'since last run' state, to run several independent feeds."
          },
          "minTotalVolume": {
            "title": "Minimum total volume",
            "minimum": 0,
            "type": "integer",
            "description": "newMarkets and resolvedMarkets: skip markets with less lifetime volume. USD on Polymarket, contracts on Kalshi (one contract pays $1). Useful to drop the thousands of tiny 5-minute markets.",
            "default": 0
          },
          "marketIds": {
            "title": "Markets",
            "type": "array",
            "description": "priceHistory mode: Polymarket market or event URLs, slugs, market IDs, condition IDs or token IDs, and Kalshi market, event or series tickers or URLs. Prefix with 'kalshi:' or 'polymarket:' if a value is ambiguous. Event links expand to their markets.",
            "items": {
              "type": "string"
            }
          },
          "historyInterval": {
            "title": "Interval",
            "enum": [
              "minute",
              "hour",
              "day"
            ],
            "type": "string",
            "description": "priceHistory mode: spacing of points. Polymarket returns the last traded price; Kalshi returns OHLC candles with bid, ask, volume and open interest.",
            "default": "hour"
          },
          "historyDays": {
            "title": "Days of history",
            "minimum": 1,
            "maximum": 1825,
            "type": "integer",
            "description": "priceHistory mode: how far back to go. Minute data is best kept to a few days.",
            "default": 7
          },
          "maxMarketsPerInput": {
            "title": "Max markets per event or series",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "priceHistory mode: when an input is an event or series, include up to this many of its markets (highest volume first).",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}