# SEC Form 4 Insider Trading Scraper (`monriah-studio/sec-form4-insider-trades`) Actor

Insider trading data from official SEC EDGAR Form 4 filings. Enter tickers or CIKs and get one row per insider buy, sell, grant or exercise: insider, role, code, shares, price, value and holdings. Change detection for daily alerts. No login, no proxy.

- **URL**: https://apify.com/monriah-studio/sec-form4-insider-trades.md
- **Developed by:** [MonRiah Studio](https://apify.com/monriah-studio) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 insider trade results

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

A 15-result test run with the default input (AAPL, last 3 Form 4 filings) costs about $0.04 ($0.0025 per result, plus a $0.00005 start fee). Apify's free plan includes monthly platform credit.

**Insider trading data from official SEC Form 4 filings, as a simple API.** Enter US stock tickers (or SEC CIK numbers) and get **one structured row per insider transaction**: who traded (name, officer title, director or 10% owner), what they did (buy, sell, grant, option exercise, tax withholding), how many shares, at what price, the total value, holdings after the trade, and a direct link to the filing.

The data comes only from **official SEC EDGAR sources**: `company_tickers.json`, the `data.sec.gov` submissions API, and the Form 4 ownership XML on `sec.gov/Archives`. No login, no proxy, no third-party data vendor.

### What it does

- Resolves tickers to CIKs, finds each company's most recent **Form 4** filings, and parses the raw ownership XML (non-derivative and derivative tables).
- Outputs clean, typed fields: `shares`, `pricePerShare`, `totalValue` and `sharesOwnedAfter` are numbers, and dates are ISO.
- Flags **Rule 10b5-1** planned trades (`is10b51`) so you can tell scheduled sales from discretionary ones.
- **Filters**: keep only open-market purchases and sales (`onlyOpenMarket`) or any list of transaction codes.
- **Change detection** (`onlyNewSinceLastRun`): schedule it daily and get only filings you haven't seen yet. That's an insider-buying alert for your watchlist.

### Use cases

- **Insider buying alerts**: run daily on a watchlist with `onlyOpenMarket: true` and send new `P` (purchase) rows to Slack, email or Google Sheets.
- **Quant and research datasets**: build an insider trading dataset for backtests, signals or academic work.
- **Due diligence**: see what executives and directors did before earnings, deals or lockup expirations.
- **Fintech and newsletter content**: feed apps, dashboards and "insider moves this week" posts.
- **AI agents**: give an agent a reliable SEC Form 4 API through Apify's API or MCP server.

### Input example

```json
{
  "tickers": ["AAPL", "TSLA", "320193"],
  "maxFilingsPerTicker": 5,
  "maxResults": 50,
  "onlyOpenMarket": false,
  "transactionCodes": [],
  "onlyNewSinceLastRun": true
}
```

- `tickers`: tickers like `AAPL` or `$TSLA`, or numeric CIKs.
- `maxFilingsPerTicker` (1–50, default 3): how many recent Form 4 filings to open per company.
- `maxResults` (1–500, default 15): a hard cap on rows per run, to keep scheduled runs cheap.

### Output example

```json
{
  "ticker": "AAPL",
  "issuerName": "Apple Inc.",
  "issuerCik": "0000320193",
  "insiderName": "Newstead Jennifer",
  "insiderCik": "0001780525",
  "officerTitle": "SVP, GC and Government Affairs",
  "isDirector": false,
  "isOfficer": true,
  "isTenPercentOwner": false,
  "transactionCode": "S",
  "acquiredDisposed": "D",
  "shares": 2399,
  "pricePerShare": 345,
  "totalValue": 827655,
  "sharesOwnedAfter": 37194,
  "transactionDate": "2026-10-13",
  "securityTitle": "Common Stock",
  "isDerivative": false,
  "is10b51": true,
  "periodOfReport": "2026-10-13",
  "accessionNumber": "0001140361-26-039785",
  "filingDate": "2026-10-15",
  "filingUrl": "https://www.sec.gov/Archives/edgar/data/320193/000114036126039785/form4.xml",
  "isNew": null,
  "scrapedAt": "2026-10-19T17:06:59.610Z"
}
```

Export to JSON, CSV or Excel, or use webhooks and integrations (Google Sheets, Slack, Zapier, Make, n8n). The key-value store record `SUMMARY` lists filing and delivery counts for each ticker.

#### Common Form 4 transaction codes

| Code | Meaning |
|---|---|
| P | Open-market or private **purchase** |
| S | Open-market or private **sale** |
| A | Grant or award from the company |
| M | Exercise or conversion of a derivative (e.g. options) |
| F | Shares withheld to pay tax or an exercise price |
| G | Gift |
| D | Disposition back to the issuer |

### Pricing

Pay per result: **$2.50 per 1,000 transactions delivered** (`result` event, $0.0025 per row). Apify also charges a tiny Actor-start event ($0.00005 per run per GB of memory). Rows removed by filters and filings skipped by change detection are **not charged**.

Examples:

- A daily watchlist of 25 tickers with change detection and about 10 new transactions a day: about **$0.025 a day**.
- A one-off pull of 500 transactions: **$1.25**.

### FAQ

**Is this official SEC data?** Yes. Every row is parsed from the Form 4 XML that the insider filed with the SEC on EDGAR, and `filingUrl` links to the source. The Actor sends a descriptive User-Agent and paces requests (about 8 per second at most) to follow the SEC's fair-access guidelines.

**How fresh is it?** Insiders must file Form 4 within 2 business days of a trade. New filings show up in EDGAR within minutes, and the Actor reads EDGAR live on every run.

**Why are some filings missing rows?** Holdings-only lines with no transaction code are skipped. Filters (`onlyOpenMarket`, `transactionCodes`) and `maxResults` also reduce output.

**Does it cover Form 3 or Form 5, or 13F?** Not yet. It covers Form 4 only.

**Can I look up a company without a ticker?** Yes. Enter its numeric CIK.

**Is this investment advice?** No. It's public disclosure data, provided as-is.

*Not affiliated with the U.S. Securities and Exchange Commission.*

### Use from an AI agent

You can give this Actor to an AI agent as a tool through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) (`https://mcp.apify.com`), from Claude, Cursor, VS Code and other MCP clients. Add the server with only this Actor loaded:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=monriah-studio/sec-form4-insider-trades"
    }
  }
}
```

On first connection your browser opens to sign in to Apify (OAuth). Or add `"headers": { "Authorization": "Bearer <APIFY_TOKEN>" }` to use your API token instead. Then ask your agent something like "Show the latest insider sales at Apple and Nvidia".

You can also call it directly via the [Apify API](https://docs.apify.com/api/v2), for example to run it and get the results in one request:

```bash
curl -X POST "https://api.apify.com/v2/acts/monriah-studio~sec-form4-insider-trades/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "tickers": ["AAPL", "NVDA"],
  "maxResults": 15
}'
```

### More actors from MonRiah Studio

- [Greenhouse, Lever, Ashby & Workday Jobs Scraper](https://apify.com/monriah-studio/ats-hiring-signals): open roles and hiring signals from 6 ATS job boards, with change detection.
- [RSS Feed Scraper & Monitor](https://apify.com/monriah-studio/rss-feed-monitor): RSS to JSON for any RSS or Atom feed, with new-item change detection.
- [Journalist Requests Scraper](https://apify.com/monriah-studio/journalist-requests): live #journorequest and PR source requests from Bluesky and Mastodon, a HARO alternative.
- [Grants.gov Funding Opportunities Scraper](https://apify.com/monriah-studio/grants-gov-opportunities): federal grant opportunities from the official Grants.gov API, with award amounts, deadlines, eligibility and new-grant alerts.
- [Bluesky Mentions Monitor](https://apify.com/monriah-studio/bluesky-mentions): brand, keyword and hashtag mentions on Bluesky, with engagement, sentiment and only-new alerts.

# Actor input Schema

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

US stock tickers (AAPL, TSLA) or SEC CIK numbers (320193). One per line.

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

How many recent Form 4 filings to open and parse per company. Keep small for fast runs.

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

Hard cap on transaction rows written to the dataset for this run.

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

Optional SEC Form 4 codes to keep (P=purchase, S=sale, A=grant, M=exercise, F=tax withholding, etc.). Empty = all codes.

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

If true, keep only codes P (buy) and S (sell). Drops grants, exercises, tax withholding.

## `onlyNewSinceLastRun` (type: `boolean`):

Change detection: skip Form 4 accession numbers already seen (state in a named key-value store).

## `stateStoreName` (type: `string`):

Named key-value store used when onlyNewSinceLastRun is on.

## Actor input object example

```json
{
  "tickers": [
    "AAPL"
  ],
  "maxFilingsPerTicker": 3,
  "maxResults": 15,
  "transactionCodes": [],
  "onlyOpenMarket": false,
  "onlyNewSinceLastRun": false,
  "stateStoreName": "sec-form4-insider-trades-state"
}
```

# Actor output Schema

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

Parsed Form 4 transactions delivered by this run.

## `summary` (type: `string`):

JSON record SUMMARY: scrapedAt, totalDelivered, and per-ticker filing/transaction counts.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("monriah-studio/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 = { "tickers": ["AAPL"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,monriah-studio/sec-form4-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/oXPJuF36IQJLtlvbk/builds/5rqippe21CdND9lJW/openapi.json
