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:
| 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.
{
"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).
Open-market or private purchase
Most-watched signal — an insider buying with their own money.
Open-market or private sale
Routine for compensated executives; context matters.
Grant, award, or other acquisition
Equity compensation; not a market transaction.
Exercise / conversion of derivative
Options exercised into common shares.
Payment of exercise price / tax by withholding shares
Shares surrendered to cover taxes.
Bona fide gift
Transfer with no purchase price.
Disposition to the issuer
Shares returned to the company.
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
Subscribe on RapidAPI
Subscribe to the free Basic tier on the Filingrail listing and copy your
X-RapidAPI-Keyfrom your dashboard. - 2
Call the endpoint
Send a
GETto/v1/companies/{ticker}/insider-tradeswith two headers. - 3
Filter for purchases
Keep records where
transaction_code === "P"to surface open-market buys, then readinsider_name,shares, andprice_per_share. - 4
Verify against the filing
Open
meta.source_filing_urlto check any transaction against the original Form 4 on sec.gov.
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'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?
What is the endpoint and what does it return?
How current is the insider-trades data?
How is this different from openinsider or edgartools?
What do the transaction codes mean?
Can I get Form 3 and Form 5 too?
Is there a free tier?
Why does every record include a source filing URL?
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.