INSIDER TRADES · FORM 4

The Form 4 API, normalized.

Every time a corporate insider buys or sells their own company’s stock, the SEC requires a Form 4. Filingrail’s insider-trades endpoint turns those filings into one clean JSON row per transaction — insider name and title, the transaction code, shares, price, and USD value — with a link back to the source filing on every record.

Free tier: 50 requests/day, no credit card. Endpoint: GET /v1/companies/{ticker}/insider-trades

The fields

One row per insider transaction.

A Form 4 packs a lot into terse XML: who traded, what relationship they have to the issuer, what kind of transaction it was, and at what price. Filingrail parses each transaction into a flat, currency-tagged JSON object. These are the fields you get on every record:

Form 4 insider-trade fields returned by Filingrail
Field What it is
insider_name Reporting person — the officer, director, or 10% owner named on the Form 4.
insider_title Their relationship to the issuer (Director, CEO, CFO, 10% Owner, etc.).
transaction_code The SEC transaction code (P, S, A, M, F, G, D, X …) describing what happened.
transaction_date The date the transaction was executed, per the filing.
shares Number of shares in the transaction.
price_per_share Reported per-share price, in USD. Null for grants and gifts with no stated price.
usd_value Shares × price, computed and currency-tagged for convenience.
shares_owned_after Beneficial ownership after the transaction, as reported.
ownership_type Direct (D) or indirect (I) ownership, per the filing.
form_type The originating SEC form — Form 4 transactions today.

SAMPLE

A real-shaped response.

One GET against the insider-trades endpoint returns the transactions array plus a meta block. The values below are an illustrative example of the response shape.

The field that matters most for trust: meta.source_filing_url. It points at the exact Form 4 on sec.gov, so any value you surface can be traced back to its filing.

GET /v1/companies/AAPL/insider-trades · 200 OK
{
  "data": [
    {
      "ticker": "AAPL",
      "insider_name": "Levinson Arthur D",
      "insider_title": "Director",
      "transaction_date": "2026-05-19",
      "transaction_code": "S",
      "transaction_type": "Sale",
      "shares": 4000,
      "price_per_share": 196.42,
      "usd_value": 785680.00,
      "shares_owned_after": 113500,
      "ownership_type": "D",
      "form_type": "4"
    }
  ],
  "meta": {
    "ticker": "AAPL",
    "count": 1,
    "as_of": "2026-06-04T06:31:00Z",
    "source_filing_url": "https://www.sec.gov/Archives/edgar/data/320193/000032019326000061/xslF345X05/form4.xml",
    "source_filing_date": "2026-05-20",
    "accession_number": "0000320193-26-000061"
  }
}

Illustrative example. Every record links to its source filing.

Transaction codes

Read the codes the SEC uses.

Every Form 4 transaction carries a one-letter SEC code. Filingrail passes the raw transaction_code through unchanged so your logic can filter on it. The two that matter most: P (an open-market purchase — an insider buying with their own money) and S (a sale).

P

Open-market or private purchase

Most-watched signal — an insider buying with their own money.

S

Open-market or private sale

Routine for compensated executives; context matters.

A

Grant, award, or other acquisition

Equity compensation; not a market transaction.

M

Exercise / conversion of derivative

Options exercised into common shares.

F

Payment of exercise price / tax by withholding shares

Shares surrendered to cover taxes.

G

Bona fide gift

Transfer with no purchase price.

D

Disposition to the issuer

Shares returned to the company.

X

Exercise of in-the-money / at-the-money derivative

Derivative exercise variant.

HOW-TO

Build an insider-trade watcher.

Four steps from a free key to a script that surfaces open-market insider buys across a watchlist. No scraper, no XML parser, no rate-limit governor to babysit.

  1. 1

    Subscribe on RapidAPI

    Subscribe to the free Basic tier on the Filingrail listing and copy your X-RapidAPI-Key from your dashboard.

  2. 2

    Call the endpoint

    Send a GET to /v1/companies/{ticker}/insider-trades with two headers.

  3. 3

    Filter for purchases

    Keep records where transaction_code === "P" to surface open-market buys, then read insider_name, shares, and price_per_share.

  4. 4

    Verify against the filing

    Open meta.source_filing_url to check any transaction against the original Form 4 on sec.gov.

curl · insider-trades
curl --request GET \
  --url 'https://filingrail.p.rapidapi.com/v1/companies/AAPL/insider-trades?limit=25' \
  --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  --header 'X-RapidAPI-Host: filingrail.p.rapidapi.com'
Python · watcher.py
import os
import requests

API = "https://filingrail.p.rapidapi.com"
HEADERS = {
    "X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"],
    "X-RapidAPI-Host": "filingrail.p.rapidapi.com",
}

def insider_trades(ticker, limit=50):
    resp = requests.get(
        f"{API}/v1/companies/{ticker}/insider-trades",
        params={"limit": limit},
        headers=HEADERS,
        timeout=10,
    )
    resp.raise_for_status()
    return resp.json()

def open_market_buys(ticker):
    payload = insider_trades(ticker)
    buys = [
        t for t in payload["data"]
        if t["transaction_code"] == "P"          # P = open-market purchase
    ]
    for t in buys:
        print(
            f'{t["transaction_date"]}  {t["insider_name"]} '
            f'({t["insider_title"]})  {t["shares"]:,} sh '
            f'@ ${t["price_per_share"]}  '
            f'src={payload["meta"]["source_filing_url"]}'
        )
    return buys

for symbol in ["AAPL", "MSFT", "NVDA"]:
    print(f"== {symbol} insider buys ==")
    open_market_buys(symbol)

The watcher loops a watchlist, filters for code P, and prints each buy with its source filing URL.

ALTERNATIVES

When to reach for Filingrail.

There are good free tools for insider data, and they’re worth knowing. Filingrail earns its place when you want a hosted JSON endpoint with billing and source-traceability handled for you.

openinsider

A free website for reading insider filings in a browser. Excellent for eyeballing recent activity. It isn’t built as a JSON API, so for programmatic access you’d be scraping HTML. Filingrail gives you the same underlying SEC data as a stable REST endpoint.

edgartools

A well-regarded open-source Python library that parses EDGAR yourself. If you want full control and don’t mind running and maintaining the parser, deduper, and SEC fair-access rate limiting, it’s a solid choice. Filingrail is the hosted alternative: no parser to maintain, billed through RapidAPI, with meta.source_filing_url on every record.

FAQ

Form 4 API, answered.

Still wondering something? Email support@hudsonenterprisesllc.com — same business day response.

What is a Form 4 API?
A Form 4 API returns the contents of SEC Form 4 filings — the disclosure that corporate insiders (officers, directors, and 10% owners) must file when they buy or sell their company’s stock — as structured JSON instead of raw XML. Filingrail’s insider-trades endpoint serves one row per transaction with the insider’s name and title, the SEC transaction code, share count, per-share price, and computed USD value.
What is the endpoint and what does it return?
GET /v1/companies/{ticker_or_cik}/insider-trades. It returns an array of insider transactions for the company you ask for, newest first, plus a meta block. Each record carries insider_name, insider_title, transaction_code, transaction_date, shares, price_per_share, usd_value, shares_owned_after, ownership_type, and form_type.
How current is the insider-trades data?
Filingrail ingests SEC EDGAR daily, so the insider-trades corpus is kept current with the latest accepted Form 4 filings. The exact ingest timestamp for any response is exposed in meta.as_of, so you never have to guess how fresh a result is.
How is this different from openinsider or edgartools?
openinsider.com is a free website you read in a browser — great for eyeballing, not built as a JSON API. edgartools is an excellent open-source Python library that parses EDGAR yourself, which means you also run and maintain the parser, the deduper, and the SEC fair-access rate limiting. Filingrail is a hosted REST API: no parser to maintain, billed through RapidAPI, and every record links back to its source filing via meta.source_filing_url.
What do the transaction codes mean?
They are the SEC’s standard Form 4 transaction codes. The two most-watched are P (an open-market purchase — an insider buying with their own money) and S (a sale). A is an equity-compensation grant, M is an option exercise into common shares, and F is shares withheld to pay taxes. Filingrail passes the raw code through and also adds a human-readable transaction_type.
Can I get Form 3 and Form 5 too?
The insider-trades endpoint serves Form 4 transactions today. Form 3 (initial ownership) and Form 5 (annual) are on the roadmap. If you need them sooner, email support@hudsonenterprisesllc.com and tell us your use case.
Is there a free tier?
Yes. The Basic plan on RapidAPI is $0 with a hard cap of 50 requests/day — enough to evaluate the endpoint and build a prototype with no credit card. Pro is $9/mo for 5,000 requests, Ultra is $49/mo for 50,000, and Mega is $199/mo for 500,000. RapidAPI handles billing, keys, and rate limiting.
Why does every record include a source filing URL?
So any number you surface can be traced back to the exact SEC Form 4 it came from. meta.source_filing_url opens the filing on sec.gov. That audit-grade traceability is the differentiator — most financial-data APIs abstract the source away.

Start on the free tier.

50 requests/day, no credit card. Query insider trades for any ticker and read the source filing behind every record.