{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Prediction Market Scraper — Odds & Whale Tracker",
    "description": "Prediction market intelligence from Polymarket without maintaining a Gamma + Data + CLOB pipeline: market odds, deep dives, whale wallet profiles and scheduled large-trade checks. Built for researchers, analysts, quant teams and AI agents. Research use only.",
    "version": "1.0",
    "x-build-id": "fYu3WrdBTjtIpUtac"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jy-labs~polymarket-whale-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jy-labs-polymarket-whale-tracker",
        "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/jy-labs~polymarket-whale-tracker/runs": {
      "post": {
        "operationId": "runs-sync-jy-labs-polymarket-whale-tracker",
        "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/jy-labs~polymarket-whale-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-jy-labs-polymarket-whale-tracker",
        "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": "Workflow / Actor mode",
            "enum": [
              "bulk_scan",
              "market_analysis",
              "alert_check",
              "whale_profile",
              "whale_discovery"
            ],
            "type": "string",
            "description": "Pick the workflow for this run.\n\n- **1) Discovery** — use `bulk_scan` to scan active/high-volume markets for whale-heavy research signals ($1.50/scan).\n- **2) Deep dive** — use `market_analysis` when you already know an event slug and need holder, orderbook, trade-flow, and whale metrics ($0.15/market).\n- **3) Scheduled monitoring** — use `alert_check` with Apify schedules for scheduled/polled large-trade checks on known condition IDs ($0.05/check).\n- **Wallet Profile** — use `whale_profile` to research provided wallet addresses, positions, P&L, ROI, win rate, and recent public activity ($0.25/wallet).\n- **Advanced Whale Discovery** — use `whale_discovery` to discover candidate whale wallets across active markets and summarize cross-market exposure ($1.50/scan via the bulk_scan PPE event).",
            "default": "bulk_scan"
          },
          "eventSlugs": {
            "title": "Event Slugs",
            "type": "array",
            "description": "market_analysis only. This field must be present for that mode. Values are trimmed, must match ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$, and are de-duplicated in first-seen order. One event can resolve to multiple selected markets. An explicit empty array produces zero Dataset items and no mode-specific PPE charge.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\\s*$"
            },
            "default": []
          },
          "marketConditionIds": {
            "title": "Market Condition IDs",
            "type": "array",
            "description": "alert_check only. This field must be present for that mode. Each trimmed value starts with lowercase 0x followed by exactly 64 hexadecimal characters. Hex letters may be upper- or lowercase; duplicates are removed case-insensitively. A successful check emits one Dataset item per selected unique condition ID, including zero-trade summaries. An explicit empty array produces zero Dataset items and no mode-specific PPE charge.",
            "items": {
              "type": "string",
              "pattern": "^\\s*0x[0-9a-fA-F]{64}\\s*$"
            },
            "default": []
          },
          "walletAddresses": {
            "title": "Wallet Addresses",
            "type": "array",
            "description": "whale_profile only. This field must be present for that mode. Each trimmed value starts with lowercase 0x followed by exactly 40 hexadecimal characters. Hex letters may be upper- or lowercase; duplicates are removed case-insensitively. The Actor emits one Dataset item and plans one charge per successfully processed and persisted wallet profile. An explicit empty array produces zero Dataset items and no mode-specific PPE charge.",
            "items": {
              "type": "string",
              "pattern": "^\\s*0x[0-9a-fA-F]{40}\\s*$"
            },
            "default": []
          },
          "category": {
            "title": "Category Filter",
            "enum": [
              "all",
              "politics",
              "crypto",
              "sports",
              "pop-culture",
              "business",
              "science"
            ],
            "type": "string",
            "description": "bulk_scan and whale_discovery only. Matches current Gamma event tags after case, whitespace, and hyphen normalization. Values: all, politics, crypto, sports, pop-culture, business, science. No aliases are promised, and current tag taxonomy can legitimately produce zero matches.",
            "default": "all"
          },
          "whaleThreshold": {
            "title": "Whale Threshold (USD)",
            "minimum": 1000,
            "maximum": 10000000,
            "type": "integer",
            "description": "bulk_scan and whale_discovery only. Minimum estimated current USD holder position in the scanned market/outcome (shares × current outcome price), not total wallet portfolio value. Default: $50,000. Lower values include more wallets/signals.",
            "default": 50000
          },
          "tradeAlertThreshold": {
            "title": "Large Trade Threshold (USD)",
            "minimum": 1000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Minimum individual trade size in USD for alert_check and supported market_analysis/bulk_scan trade-flow paths. Use alert_check with Apify schedules for polling, not streaming or push notifications. Default: $10,000.",
            "default": 10000
          },
          "timeWindow": {
            "title": "Analysis Time Window",
            "enum": [
              "1h",
              "6h",
              "24h",
              "7d",
              "30d"
            ],
            "type": "string",
            "description": "Filters recent trades/activity only: market_analysis trade lookback; optional bulk_scan trade flow; alert_check polling; and whale_profile recentActivity. whale_discovery does not use this field. It does not limit active positions or all-time closed-history summaries. Future or invalid timestamps are skipped.",
            "default": "24h"
          },
          "includeOrderbook": {
            "title": "Include Orderbook Analysis",
            "type": "boolean",
            "description": "Include CLOB orderbook depth analysis in market_analysis only. Other modes ignore this setting.",
            "default": true
          },
          "includeTradeFlow": {
            "title": "Include Trade Flow Analysis",
            "type": "boolean",
            "description": "Consumed by market_analysis and bulk_scan only. Includes directional trade-flow analysis where valid recent trades exist. It does not add CLOB orderbooks and is ignored by alert_check, whale_profile, and whale_discovery.",
            "default": true
          },
          "topHoldersCount": {
            "title": "Top Holders Count",
            "minimum": 5,
            "maximum": 20,
            "type": "integer",
            "description": "Number of top holders requested and analyzed per market in market_analysis, bulk_scan, and whale_discovery (5-20). Runtime requests and analyzes at most 20 holders per market.",
            "default": 20
          },
          "maxMarkets": {
            "title": "Max Markets (Discovery / Advanced Whale Discovery)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of markets to scan in bulk_scan or whale_discovery (1-50). For a first Discovery workflow run, start with 5 and increase after confirming output quality.",
            "default": 5
          },
          "minWinRate": {
            "title": "Minimum Win Rate (Advanced Whale Discovery)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Optional for whale_discovery. Minimum historical win-rate filter for wallets with resolved trade history. Wallets without resolved history are evaluated by public position size instead.",
            "default": 0.5
          },
          "minPnl": {
            "title": "Minimum P&L (Advanced Whale Discovery)",
            "minimum": 0,
            "maximum": 10000000,
            "type": "number",
            "description": "whale_discovery only. Minimum historical P&L filter in USD for wallets with resolved history. Candidates without resolved history are exempt and assessed by active position size.",
            "default": 0
          },
          "maxWhales": {
            "title": "Max Wallets (Advanced Whale Discovery)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Optional for whale_discovery. Maximum number of candidate wallets to include in the cross-market exposure summary.",
            "default": 10
          },
          "enableMlAnalysis": {
            "title": "Enable ML Analysis",
            "type": "boolean",
            "description": "Enable best-effort local ML work supported by the selected mode. No external AI API key or AI-provider fee is required. Normal PPE charges and Apify platform usage still apply, and local CPU work may affect platform usage. Enrichment can be absent when data or feature prerequisites are insufficient; see mlFeatures for exact mode support.",
            "default": false
          },
          "mlFeatures": {
            "title": "ML Feature Toggles",
            "type": "object",
            "description": "Mode-specific support: market_analysis can use all toggles; bulk_scan uses statisticalEnhancement; alert_check uses anomalyDetection and reportGeneration; whale_profile uses reportGeneration; whale_discovery currently has no ML post-processing path. Used only when Enable ML Analysis is on. Enrichment is best-effort, optional, and data/time dependent; unsupported or ineligible combinations leave base output unchanged. All toggles default to enabled.",
            "properties": {
              "anomalyDetection": {
                "title": "Anomaly Detection",
                "type": "boolean",
                "description": "market_analysis and alert_check only. Isolation Forest-based anomaly detection across available market/trade dimensions.",
                "default": true
              },
              "whaleClustering": {
                "title": "Whale Clustering",
                "type": "boolean",
                "description": "market_analysis only. K-means behavioral clustering groups qualifying whale-holder data when enough samples exist.",
                "default": true
              },
              "statisticalEnhancement": {
                "title": "Statistical Enhancement",
                "type": "boolean",
                "description": "market_analysis and bulk_scan only. Adds supported statistics; bulk_scan uses this toggle for aggregate sector/correlation output.",
                "default": true
              },
              "reportGeneration": {
                "title": "Report Generation",
                "type": "boolean",
                "description": "market_analysis, alert_check, and whale_profile only. Adds supported template-based informational summaries; not financial advice or a trading recommendation.",
                "default": true
              }
            },
            "default": {
              "anomalyDetection": true,
              "whaleClustering": true,
              "statisticalEnhancement": true,
              "reportGeneration": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}