# SEC Insider Trading Scraper — Form 4 Buys & Sells (`parkero/sec-insider-trading`) Actor

Track SEC Form 4 insider transactions — the public disclosures corporate officers, directors, and 10% owners must file when they buy or sell their own company stock. Get insider name, role, buy/sell, shares, price, and date for any US public company by ticker. From official SEC filings. No API key.

- **URL**: https://apify.com/parkero/sec-insider-trading.md
- **Developed by:** [parker odam](https://apify.com/parkero) (community)
- **Categories:** Business, Developer tools
- **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 Insider Trading Scraper — Form 4 Buys & Sells

Scrape **public SEC Form 4 insider transaction disclosures** for any U.S. stock by ticker or CIK number. Get insider buys, sells, grants, and options exercises as structured data — no API key required.

### What is Form 4?

SEC Form 4 is a mandatory public disclosure that corporate insiders (officers, directors, and shareholders owning 10%+ of a company's stock) must file within **2 business days** of any transaction in their company's securities. This actor scrapes that legally-required, publicly available data from the official SEC EDGAR system.

### Use cases

- **Insider trading data** — monitor when corporate executives buy or sell their company's stock
- **SEC Form 4 scraper** — bulk-download insider transactions for quantitative research
- **Insider buys sells by ticker** — filter to purchases (code P) or sales (code S) for any stock
- **Insider transactions API** — programmatic access to the same data available on sec.gov
- **Corporate governance research** — track director and officer equity activity
- **Sentiment signals** — insider buying is widely used as a bullish sentiment indicator

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `tickersOrCiks` | `string[]` | Yes | Ticker symbols (e.g. `AAPL`) or raw SEC CIK numbers (e.g. `320193`). Mixed lists are supported. |
| `sinceDate` | `string` | No | Only return filings on or after this ISO date (`YYYY-MM-DD`). |
| `transactionCodes` | `string[]` | No | Filter to specific transaction codes: `P` (buy), `S` (sell), `A` (grant), `M` (exercise), `F` (withholding). Omit for all. |
| `maxFilings` | `integer` | No | Maximum Form 4 filings to process per company (after `sinceDate` filter). Each filing may produce multiple transaction rows. |
| `userAgent` | `string` | No | User-Agent header for SEC requests. **SEC policy requires a descriptive UA with your contact email.** |

#### Example input

```json
{
  "tickersOrCiks": ["AAPL", "NVDA", "MSFT"],
  "sinceDate": "2024-01-01",
  "transactionCodes": ["P", "S"],
  "maxFilings": 20,
  "userAgent": "MyResearchTool/1.0 research@mycompany.com"
}
```

### Output

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

| Field | Type | Description |
|-------|------|-------------|
| `issuer` | string | Company name (e.g. "Apple Inc.") |
| `issuerTicker` | string? | Ticker symbol (e.g. "AAPL") |
| `insiderName` | string | Reporting insider's name |
| `insiderRelationship` | string | "Officer", "Director", "10% Owner", or combinations |
| `insiderTitle` | string? | Officer title if applicable (e.g. "CEO", "CFO") |
| `transactionDate` | string | ISO date of the transaction (YYYY-MM-DD) |
| `transactionCode` | string | SEC transaction code (P, S, A, M, F, G, …) |
| `transactionType` | string | Human label: "Buy", "Sell", "Grant", "Exercise", "Withholding", "Gift", "Other" |
| `securityTitle` | string | Security name (e.g. "Common Stock", "Restricted Stock Unit") |
| `shares` | number | Number of shares in the transaction |
| `pricePerShare` | number? | Price per share (absent for grants/RSU vestings) |
| `sharesOwnedAfter` | number? | Total shares held after the transaction |
| `isDerivative` | boolean | `true` for options/RSUs, `false` for common stock |
| `accessionNumber` | string | SEC accession number (unique filing ID) |
| `filedDate` | string | Date filed with the SEC (YYYY-MM-DD) |
| `filingUrl` | string | Direct link to the raw Form 4 XML on sec.gov |

#### Transaction codes

| Code | Meaning |
|------|---------|
| `P` | Open-market purchase (insider buys) |
| `S` | Open-market sale (insider sells) |
| `A` | Grant or award (stock options, RSU grants) |
| `M` | Exercise or conversion of derivative (RSU vesting, option exercise) |
| `F` | Tax withholding (shares withheld/sold to cover taxes on vesting) |
| `G` | Bona fide gift |
| `D` | Sale back to issuer |
| `J` | Other acquisition or disposition |

### Data source

All data is fetched from the official SEC EDGAR system:

- `https://www.sec.gov/files/company_tickers.json` — ticker-to-CIK resolution
- `https://data.sec.gov/submissions/CIK##########.json` — filing index
- `https://www.sec.gov/Archives/edgar/data/…` — raw Form 4 XML documents

**No API key is required.** The SEC requires a descriptive `User-Agent` header identifying your application and a contact email — set this via the `userAgent` input field. See [SEC webmaster FAQ](https://www.sec.gov/os/webmaster-faq#developers).

### Rate limiting

The actor automatically respects SEC's rate limit (max ~10 requests/second) with a built-in 120ms per-host minimum interval.

### Legal notice

This actor collects **publicly available information** that corporate insiders are legally required to disclose under Section 16(b) of the Securities Exchange Act of 1934. Use of this data for trading decisions is subject to applicable securities laws. This tool does not facilitate or encourage illegal insider trading — it only surfaces legal public disclosures.

# Actor input Schema

## `tickersOrCiks` (type: `array`):

One or more ticker symbols (e.g. AAPL, NVDA) or raw SEC CIK numbers (e.g. 320193). Mixed lists are allowed — the actor resolves tickers to CIKs automatically via the official SEC ticker map.

## `sinceDate` (type: `string`):

Only return Form 4 filings submitted on or after this date (ISO format: YYYY-MM-DD). Leave blank for no lower bound.

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

Only return transactions with these SEC transaction codes. Common values: P (open market purchase), S (open market sale), A (grant/award), M (option exercise), F (tax withholding). Leave empty to return all transaction types.

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

Maximum number of Form 4 filings to process per company, applied after the sinceDate filter. The EDGAR submissions API returns filings in reverse chronological order, so this effectively caps the most-recent N filings. Each filing may produce multiple transaction rows. Leave blank for no cap.

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

User-Agent string sent with every request to SEC EDGAR. The SEC's fair-access policy REQUIRES a descriptive User-Agent that identifies your tool and includes a contact email address. Requests without a proper User-Agent are rejected with HTTP 403. Format: 'YourToolName/1.0 contact@yourdomain.com'. See https://www.sec.gov/os/webmaster-faq#developers

## Actor input object example

```json
{
  "tickersOrCiks": [
    "AAPL",
    "NVDA"
  ],
  "sinceDate": "2024-01-01",
  "transactionCodes": [
    "P",
    "S"
  ],
  "maxFilings": 20,
  "userAgent": "my-insider-trading-app/1.0 your-email@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 = {
    "tickersOrCiks": [
        "AAPL",
        "NVDA"
    ],
    "transactionCodes": [
        "P",
        "S"
    ],
    "maxFilings": 20,
    "userAgent": "my-insider-trading-app/1.0 your-email@example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parkero/sec-insider-trading").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 = {
    "tickersOrCiks": [
        "AAPL",
        "NVDA",
    ],
    "transactionCodes": [
        "P",
        "S",
    ],
    "maxFilings": 20,
    "userAgent": "my-insider-trading-app/1.0 your-email@example.com",
}

# Run the Actor and wait for it to finish
run = client.actor("parkero/sec-insider-trading").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 '{
  "tickersOrCiks": [
    "AAPL",
    "NVDA"
  ],
  "transactionCodes": [
    "P",
    "S"
  ],
  "maxFilings": 20,
  "userAgent": "my-insider-trading-app/1.0 your-email@example.com"
}' |
apify call parkero/sec-insider-trading --silent --output-dataset

```

## MCP server setup

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

```

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/ESk2WuWsxbogZGF9W/builds/GXsTGsumqFhFEjJro/openapi.json
