Insider Trading Data API: Form 4/5 Filings for Traders
An insider trading data API provides programmatic access to SEC Form 4 and Form 5 filings, which disclose when corporate insiders buy, sell, or receive shares of their own companies. Traders use this data to research insider sentiment, identify unusual buying activity, and build signals based on who is trading, how much, and when the information became public.
What Is Insider Trading Data?
Insider trading data refers to the legal disclosures that corporate officers, directors, and large shareholders must file with the SEC when they trade their own company's stock. These are not illegal trades. They are routine, required disclosures that become public record.
The two main forms are Form 4 and Form 5. Form 4 must be filed within two business days of a trade. Form 5 is an annual catch-all for certain exempt transactions. Together, they cover open-market purchases and sales, stock awards, option exercises, tax withholding disposals, and gifts.
For traders, this data answers a simple question: are the people who know the company best putting their own money in, or taking it out?
What Form 4 and Form 5 Filings Contain
Each filing tells you who traded, their role at the company, what they did, and what happened to their position. The key fields are: the filing date, the ticker, the insider's name, their relationship to the company (officer, director, or 10% owner), their title, the transaction date, a transaction code, the number of shares, the price per share, the total value, and how many shares they held afterward.
The transaction code matters. Code P is an open-market purchase, which is the strongest signal because the insider chose to spend their own money. Code S is a sale. Code A is a stock award, which is compensation, not a market bet. Code M is an option exercise. Code F is shares withheld for taxes. Code G is a gift.
Filings also indicate whether a trade was made under a 10b5-1 plan. These are pre-scheduled trading plans set up in advance, so a sale under a 10b5-1 plan carries less informational weight than a discretionary one.
Pulling Insider Data by Ticker or by Insider
There are two natural ways to query insider data. The first is by ticker: show me every insider transaction for a given stock over some period. This is useful when you are researching a specific company and want to see the full picture of insider activity.
The second is by insider: show me every trade a specific person has made across all companies. This is useful when you notice a well-known executive or director trading and want to check their track record or see if they are active elsewhere.
With FinzData, both queries are one line of Python. For example, yf.Ticker("NVDA").insider_transactions returns all insider transactions for NVDA, and yf.Client().insider_transactions("NVDA", code="P") filters to open-market buys only. The same data is available through the API and the MCP server for AI agents.
Why Filing Dates Matter More Than Trade Dates
This is the most common mistake in insider trading research, and it quietly invalidates backtests. The trade date is when the insider executed the trade. The filing date is when the rest of the world found out about it. Form 4 gives insiders up to two business days to file.
If you build a backtest that acts on the trade date, you are assuming you knew about the trade before it was public. That is look-ahead bias. Your backtest will show returns you could never have captured in real trading.
The fix is simple: always use the filing date as your signal date. If an insider bought on Monday and filed on Wednesday, your strategy can act on Wednesday at the earliest. Any data source you use should give you both dates so you can make this distinction. FinzData includes the filed date alongside the transaction date for exactly this reason.
Cluster Buying as a Research Signal
A single insider purchase can mean many things. But when multiple insiders at the same company buy within a short window, that is harder to explain away. This pattern is called cluster buying, and it is one of the most studied signals in insider trading research.
The logic is straightforward. Insiders sell for many reasons: taxes, diversification, buying a house. But they buy for essentially one reason: they believe the stock is undervalued. When three or four insiders independently reach that conclusion at the same time, it suggests shared conviction about something the market has not priced in.
To screen for cluster buying, filter for transaction code P (open-market purchases), group by ticker, and look for two or more distinct insiders buying within a rolling window of a few weeks. Weight the signal by the size of the purchases relative to each insider's existing holdings. A director doubling their position means more than one adding 1% to an already large stake.
Filtering Out Noise: Awards, Exercises, and 10b5-1 Plans
Most insider transactions are not informative. Stock awards (code A) are compensation. Option exercises (code M) are mechanical. Tax withholding disposals (code F) are automatic. Gifts (code G) are personal. None of these tell you much about what the insider thinks of the stock.
Sales (code S) are trickier. A sale might signal bearishness, or it might just be a scheduled 10b5-1 plan sale that was set up months ago. Checking the 10b5-1 flag helps you separate discretionary sales from planned ones.
The cleanest signal is open-market purchases (code P) that are not part of a 10b5-1 plan. These are voluntary, discretionary bets with real money. Starting your research there saves you from drowning in noise.
Getting Started with Insider Data
You need three things to start working with insider data: a source that covers all Form 4 and Form 5 filings, the ability to filter by ticker, insider, and transaction code, and both trade dates and filing dates so you can avoid look-ahead bias.
FinzData covers every Form 4 and Form 5 filing since 2006, updated weekly, with all the fields described above. The last 12 months are free; full history is available on look-back plans. You can pull data with the Python client, the REST API, or the MCP server if you are building with AI agents.
Start simple. Pick a stock you follow, pull its insider transactions, filter for code P, and look at what insiders have been doing over the past year. That alone will tell you something most investors never bother to check.
Frequently asked questions
What is the difference between Form 4 and Form 5?
Form 4 must be filed within two business days of an insider trade and covers most transactions. Form 5 is an annual filing that catches certain exempt or deferred transactions that did not require a Form 4. Together they cover all reported insider activity.
Why should I use filing dates instead of trade dates in backtests?
The trade date is when the insider traded, but the filing date is when the public learned about it. If your backtest acts on the trade date, you are using information that was not yet available, which is look-ahead bias. Always use the filing date as your signal date.
What is cluster buying and why does it matter?
Cluster buying is when multiple insiders at the same company make open-market purchases within a short period. Because insiders buy primarily when they believe the stock is undervalued, several insiders buying at once suggests shared conviction and is a stronger signal than a single purchase.
Which insider transaction codes should I focus on?
Code P (open-market purchase) is the most informative because it represents a voluntary bet with the insider's own money. Code S (sale) can be informative but is often noise due to 10b5-1 plans. Codes A, M, F, and G are compensation, mechanical, or personal transactions that carry little signal.
How far back does FinzData's insider trading data go?
FinzData covers all Form 4 and Form 5 filings from 2006 onward, updated weekly. The last 12 months are free. Full historical data is available on look-back plans.