# SEC Form 4 Insider Trading Scraper: Insider Buys & Sells (`cprussin/sec-form-4-insider-trades`) Actor

Every SEC Form 4 insider trade from EDGAR, as a daily feed or per ticker: insider, role and title, transaction code (purchase, sale, grant, exercise), shares, price, value, holdings after, 10b5-1 flag. Filter by code, role and size. $5 per 1,000 filings.

- **URL**: https://apify.com/cprussin/sec-form-4-insider-trades.md
- **Developed by:** [Connor Prussin](https://apify.com/cprussin) (community)
- **Categories:** Business, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 form 4 filings

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 Trading Scraper: insider buys and sells from EDGAR

**SEC Form 4 Insider Trades** returns **Form 4** filings from SEC EDGAR. Directors, officers and 10% owners must file a Form 4 within two business days of buying or selling their company's stock, so this is the official, near-real-time record of **insider trading**: open-market purchases and sales, option exercises, grants, tax withholding and gifts. Each filing comes back as one clean JSON record with the company and ticker, the insider and their role, every transaction (code, shares, price, value, holdings after) and the footnotes.

- ✅ **Official SEC data**, read straight from EDGAR. No login, CAPTCHA, proxy or API key needed.
- ✅ **Every transaction parsed** from each filing's XML, both stock and derivatives (options, RSUs, warrants), with dollar values and per-filing buy/sell totals.
- ✅ **Daily feed of all insider trades**, or **per ticker** (AAPL, TSLA, …) for any date range.
- ✅ Filter by **transaction code** (P = purchase, S = sale…), **insider role** (director, officer, 10% owner) and **minimum dollar value**.
- ✅ **Delta mode** returns only filings you haven't received yet, which suits a daily insider-buying alert.
- ✅ You pay per filing returned. Filtered-out filings are free.

### Start in one minute

Click **Start** with the prefilled input:

```json
{
  "lastNDays": 3,
  "transactionCodes": ["P"],
  "maxResults": 20
}
```

You get: up to 20 Form 4 filings from the last 3 days with an open-market **insider purchase**, with `issuerTicker`, `insiderName`, `officerTitle`, `sharesPurchased`, `purchaseValue`, `transactions` and `filingUrl`.

**Cost:** up to $0.10: 20 filings × $0.005, plus the $0.00005 actor-start fee.

### Use with an AI assistant

Connect the [Apify MCP server](https://mcp.apify.com) to Claude, ChatGPT, Cursor or any MCP client (`https://mcp.apify.com?tools=cprussin/sec-form-4-insider-trades` loads only this actor), then paste:

```text
Use the Apify actor cprussin/sec-form-4-insider-trades to list open-market insider purchases of at least $100,000 by directors or officers in the last 7 days, with ticker, insider, title, shares, price and total value.
```

### Recipes

#### Big insider buys this week

Open-market purchases worth $100k or more by directors and officers.

```json
{
  "lastNDays": 7,
  "transactionCodes": ["P"],
  "insiderRoles": ["director", "officer"],
  "minTransactionValue": 100000,
  "maxResults": 50
}
```

#### All insider trades for a few tickers

Every Form 4 for these companies in the last 90 days.

```json
{
  "tickers": ["AAPL", "NVDA", "TSLA"],
  "lastNDays": 90,
  "maxResults": 200
}
```

#### Insider selling by executives

Open-market sales by officers in the last 3 days.

```json
{
  "lastNDays": 3,
  "transactionCodes": ["S"],
  "insiderRoles": ["officer"],
  "maxResults": 100
}
```

#### Daily insider-buying alert

Schedule it daily: after the first run you get (and pay for) only filings not returned before.

```json
{
  "lastNDays": 2,
  "transactionCodes": ["P"],
  "maxResults": 200,
  "onlyNew": true
}
```

### Who uses Form 4 insider-trading data?

- **Traders and investors** follow insider buying as a signal: executives buy their own stock with their own money for one reason.
- **Quant and data teams** build insider-sentiment features and backtests from clean, structured transactions.
- **Financial journalists and newsletters** spot large or unusual insider sales and buys the day they happen.
- **Compliance, IR and governance teams** monitor insider activity at their own company or peers.
- **Wealth managers and brokers** find executives with fresh liquidity after large sales.

### How does the Form 4 scraper work?

1. Pick a filing-date window (default: the last 3 days), optional tickers and filters.
2. **Daily feed:** the actor lists Form 4 and 4/A filings from EDGAR full-text search one day at a time, newest first. If full-text search is down it falls back to the EDGAR daily form index.
3. **Tickers:** each ticker is resolved to its SEC CIK and the company's filing history is read from `data.sec.gov` submissions.
4. For each filing it downloads the official Form 4 XML and parses every transaction, holding and footnote into one record.
5. Code, role and value filters are applied, and matching filings are saved to the dataset. With `onlyNew`, filings delivered by earlier runs with the same filters are skipped (and not charged).

The actor follows the [SEC's fair-access policy](https://www.sec.gov/os/accessing-edgar-data): it sends a declared User-Agent, stays under 10 requests per second and backs off on HTTP 429/503. Unfiltered it processes about 6 filings per second.

### How do I filter insider trades?

| Field                   | Description                                                                         | Example                   |
| ----------------------- | ----------------------------------------------------------------------------------- | ------------------------- |
| `tickers`               | Company tickers or numeric CIKs (empty = every company)                             | `["AAPL", "MSFT"]`        |
| `lastNDays`             | Filed in the last N calendar days, including today (UTC)                            | `3`                       |
| `startDate` / `endDate` | Exact filing-date range (YYYY-MM-DD); `startDate` overrides `lastNDays`             | `"2026-09-01"`            |
| `transactionCodes`      | Keep filings with at least one transaction of these codes (empty = all)             | `["P"]`                   |
| `insiderRoles`          | `director`, `officer`, `tenPercentOwner`, `other` (empty = all)                     | `["director", "officer"]` |
| `minTransactionValue`   | Minimum total dollar value (shares × price) of the transactions with selected codes | `100000`                  |
| `includeAmendments`     | Also return Form 4/A amendments                                                     | `true`                    |
| `maxResults`            | Maximum filings to return                                                           | `100`                     |
| `onlyNew`               | Delta mode: skip filings returned by earlier runs with the same filters             | `true`                    |

**Transaction codes:** `P` open-market or private purchase, `S` open-market or private sale, `A` grant or award, `M` option or RSU exercise/conversion, `F` shares withheld for tax or exercise price, `G` gift, `D` disposition to the issuer, `C` conversion, `X`/`O` option exercise, `J` other. `P` and `S` are the discretionary trades most people want.

### What data do you get for each Form 4 filing?

One dataset item per filing:

```json
{
  "accessionNumber": "0001140361-26-040127",
  "formType": "4",
  "isAmendment": false,
  "filingDate": "2026-10-19",
  "periodOfReport": "2026-10-15",
  "dateOfOriginalSubmission": null,
  "issuerCik": "320193",
  "issuerName": "Apple Inc.",
  "issuerTicker": "AAPL",
  "insiderName": "Borders Ben",
  "insiderCik": "2100523",
  "insiderRoles": ["officer"],
  "officerTitle": "Principal Accounting Officer",
  "reportingOwners": [
    {
      "cik": "2100523",
      "name": "Borders Ben",
      "roles": ["officer"],
      "officerTitle": "Principal Accounting Officer",
      "otherRelationship": null,
      "address": {
        "street": "ONE APPLE PARK WAY",
        "street2": null,
        "city": "CUPERTINO",
        "state": "CA",
        "zip": "95014"
      }
    }
  ],
  "rule10b51": true,
  "primaryCode": "S",
  "sharesPurchased": 0,
  "purchaseValue": 0,
  "sharesSold": 1280,
  "saleValue": 442107.54,
  "netShares": -449,
  "transactionCount": 11,
  "transactions": [
    {
      "table": "nonDerivative",
      "securityTitle": "Common Stock",
      "transactionDate": "2026-10-16",
      "deemedExecutionDate": null,
      "transactionCode": "S",
      "transactionDescription": "Open market or private sale",
      "equitySwapInvolved": false,
      "shares": 969,
      "pricePerShare": 345.74,
      "value": 335022.06,
      "acquiredDisposed": "D",
      "sharesOwnedAfter": 38368,
      "directOrIndirect": "D",
      "natureOfOwnership": null,
      "conversionOrExercisePrice": null,
      "exerciseDate": null,
      "expirationDate": null,
      "underlyingSecurityTitle": null,
      "underlyingShares": null,
      "footnoteIds": ["F4", "F7"]
    }
  ],
  "holdings": [],
  "footnotes": {
    "F4": "This transaction was made pursuant to a Rule 10b5-1 trading plan adopted by the reporting person on February 6, 2026."
  },
  "remarks": null,
  "signatureName": "/s/ Sam Whittington, Attorney-in-Fact for Ben Borders",
  "signatureDate": "2026-10-19",
  "filingUrl": "https://www.sec.gov/Archives/edgar/data/320193/000114036126040127/0001140361-26-040127-index.htm",
  "xmlUrl": "https://www.sec.gov/Archives/edgar/data/320193/000114036126040127/form4.xml"
}
```

(Shortened: the real record lists all 11 transactions and 11 footnotes.)

**Field notes**

- `transactions[].table` is `nonDerivative` for stock and `derivative` for options, RSUs and warrants (with exercise price, dates and underlying shares).
- `value` = `shares` × `pricePerShare`; it is `null` when no price is reported (grants, RSU vesting). Prices are often weighted averages; the footnote gives the range.
- `sharesPurchased`/`purchaseValue` sum code-`P` stock transactions, `sharesSold`/`saleValue` code-`S`. `netShares` nets all stock acquired (`A`) minus disposed (`D`).
- `sharesOwnedAfter` is the insider's holding after each transaction; `directOrIndirect` is `I` for shares held through a trust, spouse or fund (`natureOfOwnership` says which).
- `rule10b51` is the checkbox for trades under a pre-arranged Rule 10b5-1 plan (on filings since April 2023), which are less informative as signals.
- Joint filings (for example a fund and its manager) list every filer in `reportingOwners`; `insiderName` is the first.

### How much does Form 4 data cost?

This actor is priced **per result** (pay-per-event):

| Event                                   | Price      |
| --------------------------------------- | ---------- |
| Form 4 filing (one item in the dataset) | **$0.005** |

For example, 1,000 filings cost $5.00. A daily delta-mode feed of insider purchases (typically 20–80 filings per business day) costs a few cents to $0.40 per day. Filings skipped by filters or delta mode are free. If you set a **maximum cost per run**, the actor stops cleanly when it reaches that limit.

### Tips for tracking insider trading

- **Cluster buys:** run the purchase recipe weekly and group by `issuerTicker`; several insiders buying the same stock is a stronger signal than one.
- **Skip noise:** most Form 4 rows are grants (`A`), vesting (`M`) and tax withholding (`F`). Filter on `P` and `S` for discretionary trades, and check `rule10b51` for planned sales.
- **Backfills:** use `startDate`/`endDate` for any period since mid-2003, when Form 4 moved to XML. Per-ticker queries are fastest for long ranges.
- Send results to Google Sheets, Slack, email or a webhook through Apify integrations.
- To identify your own organization to the SEC, set a `SEC_USER_AGENT` environment variable, such as `"Your Company admin@yourcompany.com"`.

### SEC Form 4 scraper FAQ

**Is this data official?** Yes. Every record is parsed from the Form 4 XML filed on SEC EDGAR, and `filingUrl` links to the original filing.

**How fresh is it?** Filings appear on EDGAR within minutes of acceptance, and the actor searches through today. EDGAR accepts filings on business days only.

**Does it cover Forms 3 and 5?** No, only Form 4 and 4/A, which report changes in ownership.

**Can I use it through the API or with AI agents?** Yes. Call it through the Apify API, the MCP server or any Apify integration.

**Disclaimer:** This actor is not affiliated with the U.S. Securities and Exchange Commission, and its output is not investment advice.

### Related actors

- [SEC Form D Funding](https://apify.com/cprussin/sec-form-d-funding?fpr=to54nm): New SEC Form D filings: startup funding rounds and private placements from EDGAR.
- [Federal Recompete Radar](https://apify.com/cprussin/federal-recompete-radar?fpr=to54nm): US federal contracts nearing expiry, with incumbent and value, for recompete pipelines.

# Actor input Schema

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

Only insider trades in these companies (stock tickers such as AAPL or numeric SEC CIKs). Leave empty for the daily feed of every Form 4 filed.

## `lastNDays` (type: `integer`):

Filings from the last N calendar days, including today (UTC). Ignored when a start date is set.

## `startDate` (type: `string`):

Filed on or after this date (YYYY-MM-DD). Overrides 'last N days'.

## `endDate` (type: `string`):

Filed on or before this date (YYYY-MM-DD). Defaults to today.

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

Only filings with at least one transaction of these types. P = open-market purchase, S = open-market sale, A = grant or award, M = option exercise, F = tax withholding, G = gift. Empty = all.

## `insiderRoles` (type: `array`):

Only filings by insiders with one of these relationships to the company. Empty = all.

## `minTransactionValue` (type: `integer`):

Only filings whose transactions (of the selected codes, if any) add up to at least this many dollars (shares × price).

## `includeAmendments` (type: `boolean`):

Also return Form 4/A amendments that correct earlier filings.

## `maxResults` (type: `integer`):

Maximum number of filings to return. Each filing is billed as one event.

## `onlyNew` (type: `boolean`):

Skip filings already returned by earlier runs with the same filters (dates excluded). Ideal for scheduled daily runs.

## Actor input object example

```json
{
  "lastNDays": 3,
  "transactionCodes": [
    "P"
  ],
  "includeAmendments": true,
  "maxResults": 20,
  "onlyNew": false
}
```

# 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 = {
    "lastNDays": 3,
    "transactionCodes": [
        "P"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("cprussin/sec-form-4-insider-trades").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 = {
    "lastNDays": 3,
    "transactionCodes": ["P"],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("cprussin/sec-form-4-insider-trades").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 '{
  "lastNDays": 3,
  "transactionCodes": [
    "P"
  ],
  "maxResults": 20
}' |
apify call cprussin/sec-form-4-insider-trades --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cprussin/sec-form-4-insider-trades"
        }
    }
}
```

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/9nfxm4Firx6M6vxtc/builds/Tye856x1c6090CAM3/openapi.json
