{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Whale Tracker & Smart Money Alerts",
    "description": "Built for researchers, analysts, quant teams, operators, and AI agents that need structured public Polymarket market intelligence without maintaining a Gamma + Data + CLOB pipeline. Use discovery, market deep dives, wallet profiles, and scheduled large-trade checks for research only.",
    "version": "1.1",
    "x-build-id": "KEFgo26aYltyPJ74h"
  },
  "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": "Required for market_analysis only. Paste event slugs from Polymarket URLs, for example 'presidential-election-winner-2028' from polymarket.com/event/presidential-election-winner-2028.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "marketConditionIds": {
            "title": "Market Condition IDs",
            "type": "array",
            "description": "Required for alert_check. Paste condition IDs for markets you want to check on an Apify schedule. Find condition IDs from market_analysis output, bulk_scan output, or Polymarket API responses.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "walletAddresses": {
            "title": "Wallet Addresses",
            "type": "array",
            "description": "Required for whale_profile. Paste one or more trader wallet addresses from a Polymarket profile URL or prior Actor output to research active positions, P&L, ROI, win rate, and recent public activity.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "category": {
            "title": "Category Filter",
            "enum": [
              "all",
              "politics",
              "crypto",
              "sports",
              "pop-culture",
              "business",
              "science"
            ],
            "type": "string",
            "description": "Optional for bulk_scan and whale_discovery. Choose a Polymarket category such as politics, crypto, sports, or 'all' to scan across categories.",
            "default": "all"
          },
          "whaleThreshold": {
            "title": "Whale Threshold (USD)",
            "minimum": 1000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Minimum total position value in USD used to flag whale-heavy markets and whale participation. 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 to flag in alert_check and trade-flow analysis. Use with Apify schedules for scheduled/polled monitoring. Default: $10,000.",
            "default": 10000
          },
          "timeWindow": {
            "title": "Analysis Time Window",
            "enum": [
              "1h",
              "6h",
              "24h",
              "7d",
              "30d"
            ],
            "type": "string",
            "description": "Lookback period for market_analysis, whale_profile, and alert_check. Shorter windows capture recent public activity; 30d gives broader wallet/profile context.",
            "default": "24h"
          },
          "includeOrderbook": {
            "title": "Include Orderbook Analysis",
            "type": "boolean",
            "description": "Include CLOB orderbook depth analysis with bid/ask levels, spread analysis, and impact simulation. Useful for market_analysis and broader bulk_scan research.",
            "default": true
          },
          "includeTradeFlow": {
            "title": "Include Trade Flow Analysis",
            "type": "boolean",
            "description": "Include directional trade-flow analysis, whale participation ratio, and hourly distribution where supported by the selected mode.",
            "default": true
          },
          "topHoldersCount": {
            "title": "Top Holders Count",
            "minimum": 5,
            "maximum": 100,
            "type": "integer",
            "description": "Number of top holders to analyze per market in market_analysis, bulk_scan, and whale_discovery (5-100). Higher values can improve wallet/holder coverage but may increase API calls.",
            "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": "Optional for whale_discovery. Minimum historical P&L filter in USD for wallets with resolved trade history.",
            "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 local AI/ML enhancement layer. Adds anomaly detection (Isolation Forest), whale behavioral clustering (K-means), statistical enhancement (trend detection, confidence intervals), and template-based NLG reports. All ML runs locally on CPU — no external API calls, no extra cost, no data leaves Apify infrastructure.",
            "default": false
          },
          "mlFeatures": {
            "title": "ML Feature Toggles",
            "type": "object",
            "description": "Toggle individual ML features. Only used when 'Enable ML Analysis' is turned on. All features default to enabled.",
            "properties": {
              "anomalyDetection": {
                "title": "Anomaly Detection",
                "type": "boolean",
                "description": "Isolation Forest-based anomaly detection across 5 dimensions (volume, trade count, whale ratio, price change, spread change). Scores markets 0-1, flags anomalies above 0.7.",
                "default": true
              },
              "whaleClustering": {
                "title": "Whale Clustering",
                "type": "boolean",
                "description": "K-means behavioral clustering groups whales by trading strategy: patient_value, active_momentum, high_conviction, contrarian_risk.",
                "default": true
              },
              "statisticalEnhancement": {
                "title": "Statistical Enhancement",
                "type": "boolean",
                "description": "Advanced statistics: volume trend detection (linear regression), sentiment confidence intervals, and cross-market correlation matrix.",
                "default": true
              },
              "reportGeneration": {
                "title": "Report Generation",
                "type": "boolean",
                "description": "Template-based natural language summary with research context, risk flags, and neutral signal/risk labels. Informational output only; 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}