# SEC Form 4 Insider Buys & Cluster Buying Detector (`edgar-tools/sec-form4-insider-buys`) Actor

Track insider purchases from official SEC Form 4 filings. Filters to real open-market buys and flags cluster buying — several insiders buying at once.

- **URL**: https://apify.com/edgar-tools/sec-form4-insider-buys.md
- **Developed by:** [mridula maddipatla](https://apify.com/edgar-tools) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 insider transactions

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Buys & Cluster Buying Detector

Track **real insider buying** from official SEC Form 4 filings. The tool filters out the noise (stock grants, option exercises, tax withholding) and flags **cluster buys**, where several insiders buy the same stock within a short window.

### What you get, per transaction

ticker · insider (+ SEC CIK) · role (CEO/CFO/director/10% owner) · date · transaction code + meaning · shares · price · $ value · shares owned after · `cluster_buy` flag + number of insiders in the window · filing link

### Example

```json
{ "tickers": ["AAPL", "JPM", "XOM"], "daysBack": 60, "onlyPurchases": true, "minValueUsd": 50000 }
```

### Notes

- "Open-market purchase" means transaction code P.
- A cluster means at least N distinct insiders bought within ±X days. Both values can be configured. Insiders are counted by SEC CIK, so a joint filing (e.g. an executive and their family trust) is not double-counted.
- When a filing reports the price only in a footnote (weighted-average ranges, in-kind transfers), `price` and `value_usd` are `null`; such rows are excluded by any `minValueUsd` > 0.
- Tickers with share classes work as `BRK.B` or `BRK-B`.
- Covers non-derivative transactions (common stock). Options and derivatives are not included in v1.
- Uses public SEC EDGAR data. Not investment advice.

***

*Data is sourced from public SEC EDGAR filings. This tool is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Not investment advice.*

# Actor input Schema

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

Stock tickers (e.g. AAPL, BRK.B) or SEC CIK numbers of the issuer.

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

How many days back to search (used when no start date is given).

## `onlyPurchases` (type: `boolean`):

Return only open-market purchases (code P). Turn off to include sales, grants, option exercises, etc.

## `minValueUsd` (type: `integer`):

Skip positions/transactions smaller than this (USD).

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

Insiders buying within ± this many days of each other count as a cluster.

## `minClusterInsiders` (type: `integer`):

Number of distinct insiders needed to flag a cluster buy.

## `maxFilingsPerTicker` (type: `integer`):

Maximum Form 4 filings to read per ticker (newest first).

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "JPM"
  ],
  "daysBack": 30,
  "onlyPurchases": true,
  "minValueUsd": 0,
  "clusterWindowDays": 14,
  "minClusterInsiders": 2,
  "maxFilingsPerTicker": 100
}
```

# Actor output Schema

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

Insider transactions from SEC Form 4 filings, with role, value and cluster-buy flag.

# 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 = {
    "tickers": [
        "AAPL",
        "JPM"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("edgar-tools/sec-form4-insider-buys").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 = { "tickers": [
        "AAPL",
        "JPM",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("edgar-tools/sec-form4-insider-buys").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 '{
  "tickers": [
    "AAPL",
    "JPM"
  ]
}' |
apify call edgar-tools/sec-form4-insider-buys --silent --output-dataset

```

## MCP server setup

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

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/IoPBmpvQv88s9m1a0/builds/InK2NxA1sgKskFJ9K/openapi.json
