# SEC Form 4 Insider Trading Scraper (`pohjastudio/sec-form4-insider-trading-scraper`) Actor

Scrape SEC Form 4 insider transactions with the signal separated from the noise: open-market buys and sells classified apart from grants, vesting and option exercises.

- **URL**: https://apify.com/pohjastudio/sec-form4-insider-trading-scraper.md
- **Developed by:** [Pohja Studio](https://apify.com/pohjastudio) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## SEC Form 4 Insider Trading Scraper

Scrape insider transactions from **SEC Form 4** filings — the disclosures US officers, directors and 10% owners must file when they trade their own company's stock.

The difference from a raw filings dump: this Actor **classifies the signal apart from the noise**. Around nine in ten Form 4 rows are compensation mechanics — option grants, vesting, exercises, shares withheld for tax. Only a minority are an insider deciding to buy or sell on the open market with their own money. One switch, `onlyBuys`, gives you just those.

No API key, no account.

### What you get

One row **per transaction**, not per filing:

| Field | Description |
|---|---|
| `insiderName`, `insiderCik`, `insiderState` | Who traded |
| `isOfficer`, `isDirector`, `isTenPercentOwner`, `officerTitle` | Their role and job title |
| `issuerName`, `ticker`, `issuerCik` | The company |
| `transactionDate`, `transactionCode`, `transactionLabel` | When, and what kind of transaction |
| `isOpenMarket`, `direction` | Whether it was a real market decision, and which way |
| `shares`, `pricePerShare`, `transactionValueUsd` | Size, price and computed value |
| `sharesOwnedAfter`, `ownership` | Holdings after the trade, direct or indirect |
| `securityType`, `securityTitle` | Common stock, options, warrants |
| `accession`, `sourceUrl` | The filing this came from |

### Use cases

- **Insider-buying signals** — `onlyBuys: true` plus `minTransactionValueUsd` surfaces conviction purchases by executives, the subset most studied as a predictive signal.
- **Cluster detection** — several officers of the same company buying in the same window, visible once grants are filtered out.
- **Executive sale monitoring** — track disposals ahead of events, filtered to code S so vesting does not pollute the series.
- **Fintech and research products** — a clean transaction table to load into a database or model, instead of raw XML.
- **Compliance and IR teams** — monitor what your own insiders and your peers are filing.

### Input

| Option | Description |
|---|---|
| `startDate` / `endDate` | Filing-date window. Defaults to the last seven days. |
| `tickers` | Limit to specific symbols. |
| `onlyBuys` | Code P only — open-market purchases. |
| `onlyOpenMarket` | Codes P and S, dropping compensation activity. |
| `transactionCodes` | Exact codes: P, S, A, M, F, G, D. |
| `insiderRoles` | Officer, director, 10% owner. |
| `minTransactionValueUsd`, `minShares` | Size thresholds. |
| `includeDerivatives` | Options and warrants, off by default. |
| `maxItems`, `maxFilings` | Run size and how many filings to open. |

#### Example: significant insider buys in the last week

```json
{
  "onlyBuys": true,
  "minTransactionValueUsd": 100000,
  "insiderRoles": ["officer", "director"],
  "maxFilings": 2000
}
```

#### Example: everything two companies filed this quarter

```json
{
  "tickers": ["AAPL", "NVDA"],
  "startDate": "2026-07-01",
  "endDate": "2026-09-30",
  "includeDerivatives": true
}
```

### Transaction codes

| Code | Meaning | Open market |
|---|---|---|
| **P** | Purchase | yes |
| **S** | Sale | yes |
| A | Grant or award | no |
| M | Option exercise | no |
| F | Shares withheld for tax | no |
| D | Disposition to issuer | no |
| G | Gift | no |

Grants and exercises usually report no price, so `transactionValueUsd` is left null rather than filled with a misleading zero — and a value filter therefore excludes them.

### How the run works

Filings are enumerated through EDGAR full-text search, then each filing's XML is fetched and parsed. Every request carries a descriptive User-Agent and the run is throttled to stay inside the SEC's published rate limit, so a wide date range with a narrow filter needs a higher `maxFilings` and takes longer. Around 500 Form 4 filings arrive on a typical business day.

### Privacy note

Form 4 discloses the filer's home address. This Actor keeps only the **state** and never emits the street address, so the output stays useful for analysis without becoming a directory of private addresses.

### Pricing

Billed per transaction delivered. Filings that are read but produce no matching transaction, and duplicates, are not charged.

# Actor input Schema

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

Earliest filing date to scan. Defaults to seven days ago.

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

Latest filing date to scan. Defaults to today.

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

Keep only filings for these ticker symbols. Leave empty to take every company that filed in the window.

## `onlyBuys` (type: `boolean`):

Keep only transaction code P — an insider buying shares with their own money. This is the filter most people actually want, and it removes roughly nine tenths of Form 4 volume.

## `onlyOpenMarket` (type: `boolean`):

Keep codes P and S, dropping grants, vesting, option exercises and tax withholding.

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

Exact SEC codes to keep: P purchase, S sale, A grant, M option exercise, F tax withholding, G gift, D disposition to issuer.

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

Keep filings by insiders holding at least one of these roles.

## `minTransactionValueUsd` (type: `integer`):

Shares multiplied by price. Transactions that report no price — grants and most exercises — are excluded by this filter.

## `minShares` (type: `integer`):

Drop transactions below this share count.

## `includeDerivatives` (type: `boolean`):

Options, warrants and convertibles. Off by default because they are dominated by compensation activity.

## `maxItems` (type: `integer`):

Stop after this many transactions. You are charged per transaction delivered.

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

Safety limit on how many filings to open. Each filing is one request, and EDGAR is rate-limited, so a wide date range with a narrow filter needs a higher limit and takes longer.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "NVDA"
  ],
  "onlyBuys": false,
  "onlyOpenMarket": false,
  "transactionCodes": [
    "P",
    "S"
  ],
  "includeDerivatives": false,
  "maxItems": 1000,
  "maxFilings": 500
}
```

# Actor output Schema

## `transactions` (type: `string`):

Insider, role, issuer, ticker, transaction code and label, shares, price, computed USD value and holdings after the trade.

## `transactionsInConsole` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("pohjastudio/sec-form4-insider-trading-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("pohjastudio/sec-form4-insider-trading-scraper").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 '{}' |
apify call pohjastudio/sec-form4-insider-trading-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/2BlkAFuZO48MQDaZd/builds/wr9wEmAqB4jFhtNtP/openapi.json
