# SEC EDGAR Form 4 Insider Trades Scraper (`dimerin/sec-form4-insider-trades`) Actor

Scrapes SEC EDGAR Form 4 filings to extract insider trading data (purchases, sales, awards) for any US-listed company. Returns structured JSON with insider name, title, transaction type, shares, price, and total value.

- **URL**: https://apify.com/dimerin/sec-form4-insider-trades.md
- **Developed by:** [Jakub Smal](https://apify.com/dimerin) (community)
- **Categories:** Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 EDGAR Form 4 Insider Trades Scraper

Scrapes SEC EDGAR Form 4 filings to extract structured insider trading data for any US-listed company. No API key required — uses only public SEC EDGAR endpoints.

### What You Get

Each row in the output dataset represents one transaction from a Form 4 filing:

| Field | Description |
|---|---|
| `filing_date` | Date the Form 4 was filed with the SEC |
| `transaction_date` | Actual date of the transaction |
| `issuer_ticker` | Stock ticker symbol |
| `issuer_name` | Company name |
| `insider_name` | Full name of the insider |
| `insider_title` | Role (CEO, CFO, Director, 10% Owner, etc.) |
| `transaction_type` | Human-readable type (Purchase, Sale, Award/Grant, Option Exercise, etc.) |
| `direction` | `buy`, `sell`, or `other` |
| `transaction_code` | SEC transaction code (P=Purchase, S=Sale, A=Award, M=Option Exercise...) |
| `security_type` | Security name (e.g. "Common Stock", "Restricted Stock Unit") |
| `transaction_category` | `non-derivative` (direct shares) or `derivative` (options, warrants) |
| `shares_transacted` | Number of shares in the transaction |
| `price_per_share` | Price per share in USD |
| `total_value` | Total transaction value (shares × price) |
| `shares_owned_after` | Total shares held after the transaction |
| `ownership_type` | Direct or Indirect |
| `exercise_price` | Option exercise price (derivatives only) |
| `expiration_date` | Option expiration date (derivatives only) |
| `underlying_shares` | Underlying shares for derivative (derivatives only) |
| `accession_number` | SEC EDGAR accession number |
| `filing_url` | Direct link to the filing on SEC.gov |

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `ticker` | string | — | Stock ticker (e.g. `AAPL`). Provide this or `cik`. |
| `cik` | string | — | SEC CIK number. Alternative to ticker. |
| `daysBack` | integer | 90 | How far back to search (days). Max 3650. |
| `maxFilings` | integer | 40 | Max Form 4 filings to process. Max 200. |
| `includeDerivatives` | boolean | true | Include options/warrants transactions. |
| `userAgent` | string | — | Custom User-Agent for SEC requests (include your email). |

### Example Input

```json
{
  "ticker": "AAPL",
  "daysBack": 180,
  "maxFilings": 50,
  "includeDerivatives": false
}
````

### Example Output

```json
{
  "filing_date": "2024-11-05",
  "transaction_date": "2024-11-04",
  "issuer_ticker": "AAPL",
  "issuer_name": "Apple Inc.",
  "insider_name": "COOK TIMOTHY D",
  "insider_title": "Chief Executive Officer",
  "transaction_type": "Sale",
  "direction": "sell",
  "transaction_code": "S",
  "security_type": "Common Stock",
  "transaction_category": "non-derivative",
  "shares_transacted": 230000,
  "price_per_share": 222.91,
  "total_value": 51269300.0,
  "shares_owned_after": 3280345,
  "ownership_type": "Direct",
  "exercise_price": null,
  "expiration_date": null,
  "underlying_shares": null,
  "accession_number": "0000320193-24-000123",
  "filing_url": "https://www.sec.gov/Archives/edgar/data/320193/000032019324000123/0000320193-24-000123-index.htm"
}
```

### How It Works

1. Resolves the ticker to a SEC CIK number using the EDGAR company tickers registry
2. Fetches Form 4 filing metadata from `data.sec.gov/submissions/CIK{cik}.json`
3. Downloads each Form 4 XML document from the EDGAR archives
4. Parses the XML to extract all transaction records
5. Pushes structured records to the Apify dataset

### SEC EDGAR Rate Limits

SEC allows a maximum of **10 requests per second**. This actor throttles to ~8 req/s. If you run many actors in parallel against the same IP, consider adding delay. SEC may block IPs that exceed their limits.

The `userAgent` parameter should include your contact email so SEC can reach you if needed — this is their stated policy.

### Data Source

All data comes directly from the SEC EDGAR public database:

- `https://data.sec.gov/submissions/` — filing metadata
- `https://www.sec.gov/Archives/edgar/data/` — filing documents

No third-party data providers. Data is as accurate as what insiders report to the SEC.

### Use Cases

- Monitor insider buying/selling for investment research
- Build insider trading alerts and signals
- Aggregate insider activity for screening
- Track specific executives across companies
- Academic research on insider trading patterns

# Actor input Schema

## `ticker` (type: `string`):

Stock ticker symbol (e.g. AAPL, TSLA, MSFT). Provide either this or a CIK number.

## `cik` (type: `string`):

SEC EDGAR CIK number (numeric). Alternative to ticker symbol. Find it at https://www.sec.gov/cgi-bin/browse-edgar

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

How many days back to search for filings.

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

Maximum number of Form 4 filings to process. Each filing may contain multiple transactions.

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

Include derivative transactions (options, warrants, convertible securities). Disable to get only direct stock purchases and sales.

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

Custom User-Agent string for SEC EDGAR requests. SEC requires a real contact email. Format: 'AppName/version contact@email.com'. Leave blank to use default.

## Actor input object example

```json
{
  "ticker": "AAPL",
  "cik": "320193",
  "daysBack": 90,
  "maxFilings": 40,
  "includeDerivatives": true,
  "userAgent": "MyApp/1.0 myemail@example.com"
}
```

# 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("dimerin/sec-form4-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 = {}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 dimerin/sec-form4-insider-trades --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dimerin/sec-form4-insider-trades",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SEC EDGAR Form 4 Insider Trades Scraper",
        "description": "Scrapes SEC EDGAR Form 4 filings to extract insider trading data (purchases, sales, awards) for any US-listed company. Returns structured JSON with insider name, title, transaction type, shares, price, and total value.",
        "version": "1.0",
        "x-build-id": "5cYJamTykcif2fT62"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dimerin~sec-form4-insider-trades/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dimerin-sec-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/dimerin~sec-form4-insider-trades/runs": {
            "post": {
                "operationId": "runs-sync-dimerin-sec-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/dimerin~sec-form4-insider-trades/run-sync": {
            "post": {
                "operationId": "run-sync-dimerin-sec-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": {
                    "ticker": {
                        "title": "Stock Ticker",
                        "type": "string",
                        "description": "Stock ticker symbol (e.g. AAPL, TSLA, MSFT). Provide either this or a CIK number."
                    },
                    "cik": {
                        "title": "CIK Number",
                        "type": "string",
                        "description": "SEC EDGAR CIK number (numeric). Alternative to ticker symbol. Find it at https://www.sec.gov/cgi-bin/browse-edgar"
                    },
                    "daysBack": {
                        "title": "Days Back",
                        "minimum": 1,
                        "maximum": 3650,
                        "type": "integer",
                        "description": "How many days back to search for filings.",
                        "default": 90
                    },
                    "maxFilings": {
                        "title": "Max Filings",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of Form 4 filings to process. Each filing may contain multiple transactions.",
                        "default": 40
                    },
                    "includeDerivatives": {
                        "title": "Include Derivative Transactions",
                        "type": "boolean",
                        "description": "Include derivative transactions (options, warrants, convertible securities). Disable to get only direct stock purchases and sales.",
                        "default": true
                    },
                    "userAgent": {
                        "title": "User-Agent (optional)",
                        "type": "string",
                        "description": "Custom User-Agent string for SEC EDGAR requests. SEC requires a real contact email. Format: 'AppName/version contact@email.com'. Leave blank to use 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
                                    }
                                }
                            },
                            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
