# SEC Form 4 Insider Trades & Cluster Buying (`m8forever/sec-form4-insider-cluster-tracker`) Actor

Parse SEC EDGAR Form 4 insider trades into clean tables and detect multi-insider cluster buying. Optional 13F changes. Public-domain data, SEC fair-access compliant.

- **URL**: https://apify.com/m8forever/sec-form4-insider-cluster-tracker.md
- **Developed by:** [Hanxiao Yang](https://apify.com/m8forever) (community)
- **Categories:** Business, News, AI
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 form 4 transactions

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## SEC Form 4 Insider Trades & Cluster Buying Tracker

**Keywords:** SEC Form 4 scraper, EDGAR insider trading, cluster buying alert, Form 4 API, insider purchases, 13F holdings change, stock insider transactions.

Turn official **SEC EDGAR Form 4** filings into clean tables and flag **multi-insider cluster buying** (several officers/directors buying the same ticker within a few days). Optional **13F** manager quarter-over-quarter changes.

### Why this Actor

- One row per transaction: issuer, ticker, insider, role, code (P/S/A/M/F/G…), shares, price, value, ownership after, 10b5-1 flag, filing URL
- Automatic **cluster_buy** alerts with insider count, date window, total $ value
- Modes: near-real-time latest filings **or** daily index backfill
- Follows SEC fair-access rules (declared User-Agent, polite rate limit)

### Example input

```json
{
  "userAgent": "YourCompany research bot contact@yourcompany.com",
  "mode": "latest",
  "maxFilings": 50,
  "transactionCodes": ["P"],
  "minValue": 10000,
  "detectClusters": true,
  "clusterMinInsiders": 2,
  "clusterWindowDays": 10,
  "clusterMinTradeValue": 10000
}
```

`userAgent` is **required** (name/company + contact email) — SEC policy for automated access.

### Use cases

- Daily insider-buying screen (schedule hourly/daily)
- Feed signals into AI agents, spreadsheets, Slack/Discord
- Research backfills for the last N business days

### Sample output

```json
{
  "type": "transaction",
  "ticker": "JEF",
  "issuerName": "Jefferies Financial Group Inc.",
  "insiderName": "FRIEDMAN BRIAN P",
  "insiderRole": "Director, Officer (President)",
  "transactionDate": "2026-10-07",
  "transactionCode": "G",
  "transactionType": "Gift",
  "shares": 100,
  "filingUrl": "https://www.sec.gov/Archives/edgar/data/..."
}
```

### Pricing (pay per event)

- **Form 4 transaction** — $0.0001 per row (primary)
- **Cluster buy alert** — $0.01
- **13F change row** — $0.001
- Actor start ~$0.00005

### Compliance

SEC EDGAR public data; declared User-Agent; under 10 req/s. No street addresses in output. **Not investment advice** — verify against the original filing.

### Use cases & scheduling

- **Daily insider buying alert** — schedule every weekday morning with `transactionCodes: ["P"]` and `minValue: 100000` to get only meaningful open-market purchases.
- **Cluster buying screen** — keep `detectClusters: true`; you get a `cluster_buy` row when 2+ insiders buy the same ticker within `clusterWindowDays`.
- **Ticker watchlist monitoring** — set `tickers` to your portfolio and run daily with `mode: dailyIndex`.
- **13F changes** — `mode: 13fDiff` with `managerCiks` (e.g. Berkshire `1067983`) after each quarter's filing deadline.
- **Pipe into Slack / Sheets / AI agents** via Apify integrations or webhooks on run success.

Tip: create an [Apify Schedule](https://docs.apify.com/platform/schedules) for the Actor or one of the tasks below to turn it into a recurring monitor, and add a webhook/integration to get results in Slack, email or Google Sheets.

### Ready-made example tasks

One-click, pre-filled inputs you can run or copy:

- [form4-cluster-buying-demo](https://apify.com/m8forever/sec-form4-insider-cluster-tracker/tasks/form4-cluster-buying-demo)
- [insider-buying-large-purchases-daily](https://apify.com/m8forever/sec-form4-insider-cluster-tracker/tasks/insider-buying-large-purchases-daily)
- [insider-trades-by-ticker-watchlist](https://apify.com/m8forever/sec-form4-insider-cluster-tracker/tasks/insider-trades-by-ticker-watchlist)

### FAQ

**How fresh is the data?**\
`latest` mode reads SEC's current-filings feed, so new Form 4s show up minutes after EDGAR publishes them. Schedule hourly or daily.

**Why is `userAgent` required?**\
SEC fair-access policy requires automated clients to declare a name and contact email. Use your own.

**What do transaction codes mean?**\
`P` = open-market purchase, `S` = sale, `A` = grant/award, `M` = option exercise, `F` = tax withholding, `G` = gift. Most buy signals use `P` only.

**Is this investment advice?**\
No. It is a data tool; always check the linked original filing.

# Actor input Schema

## `userAgent` (type: `string`):

Required by SEC fair-access policy, e.g. 'Acme Research admin@acme.com'.

## `mode` (type: `string`):

Source

## `daysBack` (type: `integer`):

Business days back (dailyIndex mode)

## `maxFilings` (type: `integer`):

Max filings to process

## `tickers` (type: `array`):

Leave empty for all issuers.

## `transactionCodes` (type: `array`):

e.g. P (purchase), S (sale), A, M, F, G. Empty = all.

## `minValue` (type: `integer`):

Min transaction value (USD)

## `dateFrom` (type: `string`):

Transaction date from (YYYY-MM-DD)

## `dateTo` (type: `string`):

Transaction date to (YYYY-MM-DD)

## `includeDerivative` (type: `boolean`):

Include derivative transactions

## `detectClusters` (type: `boolean`):

Detect cluster buying

## `clusterMinInsiders` (type: `integer`):

Cluster: min distinct insiders

## `clusterWindowDays` (type: `integer`):

Cluster: window (days)

## `clusterMinTotalValue` (type: `integer`):

Cluster: min total value (USD)

## `clusterMinTradeValue` (type: `integer`):

Ignores tiny employee-plan purchases.

## `managerCiks` (type: `array`):

e.g. 1067983 (Berkshire Hathaway)

## `min13fValueChange` (type: `integer`):

13F: min |value change| USD for increased/decreased rows

## `maxRequestsPerSecond` (type: `integer`):

Max requests/second to SEC

## Actor input object example

```json
{
  "userAgent": "Your Company your-email@example.com",
  "mode": "latest",
  "daysBack": 3,
  "maxFilings": 200,
  "transactionCodes": [
    "P"
  ],
  "minValue": 0,
  "includeDerivative": false,
  "detectClusters": true,
  "clusterMinInsiders": 2,
  "clusterWindowDays": 10,
  "clusterMinTotalValue": 0,
  "clusterMinTradeValue": 10000,
  "managerCiks": [
    "1067983"
  ],
  "min13fValueChange": 0,
  "maxRequestsPerSecond": 8
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "userAgent": "Your Company your-email@example.com",
    "transactionCodes": [
        "P"
    ],
    "managerCiks": [
        "1067983"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("m8forever/sec-form4-insider-cluster-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "userAgent": "Your Company your-email@example.com",
    "transactionCodes": ["P"],
    "managerCiks": ["1067983"],
}

# Run the Actor and wait for it to finish
run = client.actor("m8forever/sec-form4-insider-cluster-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "userAgent": "Your Company your-email@example.com",
  "transactionCodes": [
    "P"
  ],
  "managerCiks": [
    "1067983"
  ]
}' |
apify call m8forever/sec-form4-insider-cluster-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,m8forever/sec-form4-insider-cluster-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/all9HWdFJnnGJZU94/builds/McS6cBgLETPud4Lth/openapi.json
