{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC Form 4 Insider Trading Tracker & Scraper API",
    "description": "Insider buys and sells from official SEC EDGAR Form 4 filings: one row per trade with ticker, insider role, code, shares, price, value, 10b5-1 flag, late-filing flag and cluster-buy alerts. Incremental: pay only for new trades.",
    "version": "0.1",
    "x-build-id": "4E7pioChdxKt5uNAI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clearfeedlabs~form4-insider-trades/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clearfeedlabs-form4-insider-trades",
        "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/clearfeedlabs~form4-insider-trades/runs": {
      "post": {
        "operationId": "runs-sync-clearfeedlabs-form4-insider-trades",
        "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/clearfeedlabs~form4-insider-trades/run-sync": {
      "post": {
        "operationId": "run-sync-clearfeedlabs-form4-insider-trades",
        "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": "Mode",
            "enum": [
              "dateRange",
              "sinceLastRun"
            ],
            "type": "string",
            "description": "Since last run returns only filings not seen before (per stateKey), so schedules pay only for new trades.",
            "default": "dateRange"
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Used when dateFrom is empty (and on the first sinceLastRun run).",
            "default": 2
          },
          "dateFrom": {
            "title": "Filed from (YYYY-MM-DD)",
            "type": "string",
            "description": "Filing date range start. Max 31 days per run."
          },
          "dateTo": {
            "title": "Filed to (YYYY-MM-DD)",
            "type": "string",
            "description": "Defaults to today."
          },
          "tickers": {
            "title": "Tickers",
            "type": "array",
            "description": "Issuer tickers, e.g. NVDA. Resolved with SEC's company_tickers.json.",
            "items": {
              "type": "string"
            }
          },
          "ciks": {
            "title": "Issuer CIKs",
            "type": "array",
            "description": "Issuer CIK numbers.",
            "items": {
              "type": "string"
            }
          },
          "roles": {
            "title": "Insider roles",
            "type": "array",
            "description": "Keep trades by any of these roles. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "director",
                "officer",
                "ten_percent_owner",
                "other"
              ]
            }
          },
          "officerTitleContains": {
            "title": "Officer title contains",
            "type": "array",
            "description": "e.g. CEO, Chief Financial. Case-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "transactionCodes": {
            "title": "Transaction codes",
            "type": "array",
            "description": "SEC codes to keep. Default P (open-market buy) and S (open-market sale).",
            "default": [
              "P",
              "S"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeAllCodes": {
            "title": "Include all transaction codes",
            "type": "boolean",
            "description": "Ignore the code list and return grants, exercises, tax withholding, gifts, etc.",
            "default": false
          },
          "excludeRoutine": {
            "title": "Exclude routine codes",
            "type": "boolean",
            "description": "Drop A, F, M, G, W unless listed explicitly in Transaction codes.",
            "default": true
          },
          "side": {
            "title": "Buys or sells",
            "enum": [
              "all",
              "buys",
              "sells"
            ],
            "type": "string",
            "description": "Filter by acquired (A) or disposed (D).",
            "default": "all"
          },
          "minValueUsd": {
            "title": "Min trade value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "shares × price. Trades without a price are dropped when set."
          },
          "exclude10b5_1": {
            "title": "Exclude 10b5-1 plan trades",
            "type": "boolean",
            "description": "Keep only discretionary trades.",
            "default": false
          },
          "only10b5_1": {
            "title": "Only 10b5-1 plan trades",
            "type": "boolean",
            "description": "Keep only trades flagged as under a Rule 10b5-1 plan.",
            "default": false
          },
          "onlyLateFilings": {
            "title": "Only late filings",
            "type": "boolean",
            "description": "Filed more than 2 business days after the trade.",
            "default": false
          },
          "includeDerivative": {
            "title": "Include derivative table",
            "type": "boolean",
            "description": "Options, RSUs, warrants rows.",
            "default": true
          },
          "filingType": {
            "title": "Filing type",
            "enum": [
              "all",
              "original",
              "amendment"
            ],
            "type": "string",
            "description": "Form 4, 4/A or both.",
            "default": "all"
          },
          "dedupeAmendments": {
            "title": "Prefer amendments",
            "type": "boolean",
            "description": "When a 4 and its 4/A are both in this run, keep only the 4/A rows.",
            "default": false
          },
          "detectClusters": {
            "title": "Detect cluster buys",
            "type": "boolean",
            "description": "Emit a cluster alert row when several distinct insiders buy the same issuer on the open market in a short window. Billed as cluster-alert.",
            "default": false
          },
          "clusterMinInsiders": {
            "title": "Cluster: min insiders",
            "minimum": 2,
            "type": "integer",
            "description": "Distinct insiders required.",
            "default": 3
          },
          "clusterWindowDays": {
            "title": "Cluster: window days",
            "minimum": 1,
            "maximum": 45,
            "type": "integer",
            "description": "Window for the buys (by transaction date).",
            "default": 14
          },
          "outputTrades": {
            "title": "Output trade rows",
            "type": "boolean",
            "description": "Turn off to get only cluster alerts.",
            "default": true
          },
          "maxFilings": {
            "title": "Max filings to scan",
            "minimum": 1,
            "type": "integer",
            "description": "Newest first. Each filing is one SEC request at 2 req/s.",
            "default": 1500
          },
          "maxTrades": {
            "title": "Max trades to output",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on billed trade rows.",
            "default": 1000
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Separate sinceLastRun memory per watchlist.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}