{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC Insider Trading Tracker — Form 4 API",
    "description": "Real-time SEC Form 4 API for behavioural insider-trading signal classification. Detects officer cluster buys, executive disposals, regime shifts. Suppresses compensation noise. Deterministic JSON output for hedge funds, compliance, and AI-agent workflows. No API key needed.",
    "version": "2.1",
    "x-build-id": "vBfGQEIv40AvmPla6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~sec-insider-trading/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-sec-insider-trading",
        "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/ryanclinton~sec-insider-trading/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-sec-insider-trading",
        "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/ryanclinton~sec-insider-trading/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-sec-insider-trading",
        "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": [
          "query"
        ],
        "properties": {
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "Company name, ticker symbol, or CIK number. Single-issuer mode. Use 'queries' for multi-issuer portfolios.",
            "default": "AAPL"
          },
          "queries": {
            "title": "Search Queries (multi-issuer portfolio)",
            "type": "array",
            "description": "List of tickers, company names, or CIKs to process in one run. When set, takes precedence over 'query'. Enables portfolio-state, priority queue, and watchlist analytics across the cohort.",
            "items": {
              "type": "string"
            }
          },
          "transactionType": {
            "title": "Transaction Type",
            "enum": [
              "all",
              "purchase",
              "sale",
              "grant",
              "exercise"
            ],
            "type": "string",
            "description": "Filter by transaction type. 'sale' includes tax-withholding dispositions.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Date From",
            "type": "string",
            "description": "Start date (YYYY-MM-DD). Defaults to 30 days ago."
          },
          "dateTo": {
            "title": "Date To",
            "type": "string",
            "description": "End date (YYYY-MM-DD). Defaults to today."
          },
          "transactionDateFrom": {
            "title": "Transaction Date From (post-parse filter)",
            "type": "string",
            "description": "Optional: filter by the underlying transaction date inside the Form 4, not the SEC filing date. A 2024 amendment for a 2022 transaction is filtered OUT when transactionDateFrom is 2024-01-01. Use when the audit semantics is 'what insider activity happened in this period' rather than 'which Form 4s were filed in this period'. Format: YYYY-MM-DD."
          },
          "transactionDateTo": {
            "title": "Transaction Date To (post-parse filter)",
            "type": "string",
            "description": "Optional companion to transactionDateFrom. Format: YYYY-MM-DD."
          },
          "queryMatchMode": {
            "title": "Query Match Mode",
            "enum": [
              "fuzzy",
              "exact"
            ],
            "type": "string",
            "description": "fuzzy (default) — passes the query string to EDGAR's full-text search, matching company-name substrings (e.g. 'KKR' returns KKR Real Estate Select Trust + KKR FS Income Trust + KKR Inc all together). exact — resolves each query against SEC's ticker→CIK index (company_tickers.json) and filters returned filings to the resolved CIK set, eliminating cross-issuer matches. Use exact for cohort-scale audits where issuer identity must be precise.",
            "default": "fuzzy"
          },
          "minTransactionValue": {
            "title": "Minimum Transaction Value ($)",
            "type": "number",
            "description": "Only include transactions with a total value above this dollar amount."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of transactions to emit. Cluster, issuer-summary, and batch-summary records are NOT counted against this cap. For cohort-scale audits, raise this — defaults work for single-issuer monitoring but cap at 200 caused silent truncation on rare-event searches across S&P 500 cohorts.",
            "default": 25
          },
          "mode": {
            "title": "Execution Mode",
            "enum": [
              "alpha-hunter",
              "governance-risk",
              "compliance-surveillance",
              "executive-sentiment",
              "distress-radar",
              "monitoring",
              "cluster-detection",
              "compliance",
              "sentiment",
              "officer-tracking",
              "raw",
              "auto"
            ],
            "type": "string",
            "description": "Bundles output flags + trigger packs + decision layer activation. Pick based on the JOB you're doing — alpha-hunter for rare officer buys, governance-risk for executive unloading + clustered exits, compliance-surveillance for full audit trail, executive-sentiment for C-suite directional behavior, distress-radar for liquidity-pattern signals. The original mechanical names (monitoring / cluster-detection / compliance / sentiment / officer-tracking / raw / auto) are kept for back-compat.",
            "default": "monitoring"
          },
          "persona": {
            "title": "Persona",
            "enum": [
              "quant",
              "fundamental-analyst",
              "compliance",
              "hedge-fund-research",
              "retail-monitoring",
              "corporate-ir",
              "generic"
            ],
            "type": "string",
            "description": "Shapes escalation + suppression + materiality weighting. Different personas suppress different signals (e.g. retail-monitoring suppresses tax-withholding; quant suppresses small grants).",
            "default": "generic"
          },
          "routingProfile": {
            "title": "Routing Profile",
            "enum": [
              "quant-monitor",
              "compliance-officer",
              "hedge-fund",
              "pe-operating",
              "corporate-ir",
              "retail-investor",
              "generic"
            ],
            "type": "string",
            "description": "Bundles persona + trigger packs + SLA tightening + alert format. Pick the profile that matches your downstream consumer.",
            "default": "generic"
          },
          "systemMode": {
            "title": "System Mode",
            "type": "boolean",
            "description": "One-flag stateful service. When true, auto-enables clusters, issuer summary, batch insights, and (with watchlistName) deltaMode. Recurring scheduled-run friendly.",
            "default": false
          },
          "watchlistName": {
            "title": "Watchlist Name",
            "type": "string",
            "description": "Names a per-watchlist named KV store for cross-run state — temporal signals, state transitions, regime shift detection, narrative delta. Two pipelines on different watchlists don't interfere."
          },
          "deltaMode": {
            "title": "Delta Mode",
            "type": "boolean",
            "description": "When true (and watchlistName set), every transaction carries a delta block: new / changed / unchanged / recovered / degraded.",
            "default": false
          },
          "includeClusters": {
            "title": "Include Cluster Detection",
            "type": "boolean",
            "description": "Detect ≥2 distinct insiders moving same direction within a 30d window. On by default for most modes."
          },
          "includeIssuerSummary": {
            "title": "Include Issuer Summary Records",
            "type": "boolean",
            "description": "Emit one issuer-summary record per ticker — sentiment, insiderPressureIndex, watchStatus, triggers fired, escalation routing."
          },
          "includeBatchInsights": {
            "title": "Include Batch Summary Record",
            "type": "boolean",
            "description": "Emit a single batch-summary record at the end with portfolio state + priority queue + run manifest + watchlist analytics."
          },
          "triggerPacks": {
            "title": "Trigger Packs",
            "type": "array",
            "description": "Pre-built rule bundles that fire alerts on matching transactions / clusters. Mode + routing-profile pre-select packs; this input adds more. Valid values: cluster-buy, cluster-sale, executive-disposal, large-purchase, amendment-burst, distress-watch.",
            "items": {
              "type": "string"
            }
          },
          "triggers": {
            "title": "Custom Triggers",
            "type": "array",
            "description": "User-defined alert rules. Schema: { name, when: { direction?, minTotalValue?, minClusterSize?, insiderRoleIn?, materialityLevelIn?, unusualnessAtLeast? }, severity? }."
          },
          "outputProfile": {
            "title": "Output Profile",
            "enum": [
              "minimal",
              "standard",
              "full",
              "llm"
            ],
            "type": "string",
            "description": "Field-set shrinkage. minimal = core fields only. standard = decision layer included. full = every block. llm = LLM-friendly subset for agent consumers.",
            "default": "standard"
          },
          "includeAlertPayloads": {
            "title": "Include Alert Payloads",
            "type": "boolean",
            "description": "Write the immediate-review queue + cluster alerts + issuer alerts to the ALERTS key in the run's KV store."
          },
          "referenceRunId": {
            "title": "Reference Run ID",
            "type": "string",
            "description": "(Reserved) — diff this run against a specific prior run instead of the most recent watchlist snapshot. Currently informational only."
          },
          "concurrency": {
            "title": "Parallel Ticker Concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many tickers (and per-ticker filings) to process in parallel. Higher = faster cohort scans, throttled globally by SEC's 10 req/sec rate limit. Default 8.",
            "default": 8
          },
          "preFilterByTransactionType": {
            "title": "Pre-filter by Transaction Type (EXPERIMENTAL — may produce false negatives)",
            "type": "boolean",
            "description": "EXPERIMENTAL. When true (and transactionType is purchase/sale/grant/exercise), does a cheap EDGAR probe per ticker to skip tickers with zero matching filings. Default FALSE. Known limitation: EDGAR's full-text indexer does not reliably preserve XML tags, so the probe can produce false negatives — verified against year-scale + low-frequency-event inputs (e.g. XOM 2024 purchases). Use with caution; off by default for correctness.",
            "default": false
          },
          "runtimeBudgetSeconds": {
            "title": "Runtime Budget (seconds)",
            "minimum": 60,
            "maximum": 21600,
            "type": "integer",
            "description": "Soft runtime cap on the FETCH phase. When elapsed time exceeds this, the actor stops fetching new data and emits partial results. AUTO-CLAMPING: the actor reads Apify's deadline (APIFY_TIMEOUT_AT) and automatically clamps this value to (deadline - emit-reserve), where emit-reserve scales with maxResults (5-15min). This prevents Apify hard-killing during the EMIT phase (filter/enrich/cluster/issuer-build/KV/dataset-push). If you set this ≥ Apify's timeoutSecs, it WILL be auto-clamped down — the clamp is logged at startup. Default 3000 (50 minutes).",
            "default": 3000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}