Blog / Insider trading
Insider trading

Insider Trading API: What to Look For and How SecFeed Works

What an insider trading API should return, including the fields most skip, with a real request against SEC Forms 3, 4 and 5 data.

By the SecFeed teamOctober 25, 20266 min read
Key takeaways

An insider trading API takes SEC Forms 3, 4 and 5, the filings that officers, directors and 10% owners submit when their ownership changes, and returns them as structured data: ticker, transaction code, shares, price, and the details that are easy to miss if you only look at the trade. This guide covers what those forms actually contain, what changed in 2023, and how to query them.

What counts as an insider trading filing

Section 16(a) of the Securities Exchange Act of 1934 requires three forms from anyone who is an officer, director, or beneficial owner of more than 10% of a registered class of equity securities:

FormWhat it reportsDeadline
Form 3Initial statement of beneficial ownership, filed on becoming an insiderWithin 10 days of becoming an officer, director or 10% owner (by the effective date of the registration statement for a new issuer)
Form 4Changes in ownership: purchases, sales, grants, exercises, giftsBefore the end of the 2nd business day after the transaction is executed
Form 5Annual catch-all for exempt transactions and anything not timely reported on Form 4Within 45 days after the issuer's fiscal year end

See SEC Form 4 explained for a walkthrough of the transaction codes (P for purchase, S for sale, A for grant or award, M for option exercise, and the rest), and insider trading definition for how this reporting regime relates to the separate, broader concept of illegal insider trading.

Legal insider trading, reported on these forms, is routine: it just means an insider traded their own company's stock and disclosed it. Illegal insider trading is a different legal concept entirely, trading on material nonpublic information, and it is not what Forms 3, 4 and 5 report or imply.

What changed in 2023

Two changes from the SEC's 2022 Rule 10b5-1 release (Release No. 33-11138) affect what a current insider trading dataset needs to carry, with compliance required for forms filed on or after April 1, 2023:

  1. Gifts moved to Form 4. Before the change, a bona fide gift of securities could be reported immediately on Form 4 or deferred to the next Form 5. Since April 1, 2023, gifts must be reported on Form 4 within 2 business days, the same as a sale or purchase.
  2. A mandatory Rule 10b5-1 checkbox. Every Form 4 and Form 5 now includes a checkbox disclosing whether the reported transaction was made under a Rule 10b5-1 trading plan, the pre-arranged trading plan insiders use as an affirmative defense against insider trading liability. A feed that does not carry this flag cannot tell you whether a sale was scheduled months in advance or decided that week.
If you are trying to separate "insider decided to sell this week" from "insider's pre-set plan executed on schedule," the 10b5-1 flag is the field to filter on, not the transaction code alone.

Get this data as clean JSON

SecFeed turns SEC filings into structured data with one API call: GET /v1/insider-trading. 125 free calls to start.

Get a free API key →

Fields a complete API response needs

A transaction code and a share count tell you less than it looks like. A usable insider trading API should also return:

Querying insider trading data

SecFeed's insider trading API parses every Form 3, 4 and 5 into rows with these fields. For example, to find open-market purchases (code P) over $100,000:

curl "https://secfeedapi.com/v1/insider-trading?code=P&minValue=100000&size=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

A row looks like this:

{
  "ticker": "EXMPL",
  "cik": "0000320193",
  "owner": "EXAMPLE INSIDER",
  "role": "officer",
  "code": "P",
  "shares": 5000,
  "pricePerShare": 42.10,
  "sharesOwnedFollowing": 125000,
  "ownershipType": "D",
  "is10b5_1": false,
  "filedAt": "2026-09-15"
}

In Python, with the SecFeed SDK:

from secfeed import Client

sf = Client("YOUR_API_KEY")
trades = sf.insider_trading(ticker="EXMPL", code="S")
plan_trades = [t for t in trades if t.get("is10b5_1")]
print(f"{len(plan_trades)} of {len(trades)} sales followed a 10b5-1 plan")

To follow every transaction, filing and footnote for one company over time, see the insider trading analysis tutorial. Companies also disclose their internal insider trading policy as Exhibit 19 to their 10-K, which is a useful cross-check on what trading windows and pre-clearance rules apply to the insiders you are tracking. Form 144, the notice a seller files before an unregistered sale under Rule 144, often precedes a large insider sale by a few days; see Form 144 explained for how the two forms relate. For the SEC's own free API and where it stops short of returning structured rows, see the SEC EDGAR API guide.

Timing: why real time matters

Because Form 4 is due within 2 business days of execution, not at month end, an insider trading feed that updates on a weekly or monthly batch is already stale by the time most of its filings would have been useful for monitoring. A feed that ingests filings as EDGAR publishes them (SecFeed's ingestion runs within about a second of EDGAR's own publication) is closer to what a real-time use case, such as alerting on a cluster of buys, actually needs.

Frequently asked questions

What is an insider trading API?

It is an API that returns SEC Forms 3, 4 and 5 (the filings officers, directors and 10% owners submit when their ownership of a company's stock changes) as structured JSON rows, instead of requiring you to download and parse each form's XML individually.

Is insider trading data free?

The underlying filings are free public records on SEC EDGAR. A paid API like SecFeed charges for parsing them into consistent fields, serving them with query filters (by ticker, transaction code, date range, value), and keeping history searchable, not for data the SEC withholds.

How current is insider trading API data?

Because Form 4 must be filed within 2 business days of a transaction under Section 16(a), a current dataset should reflect new filings within a similar window, ideally faster. SecFeed ingests new filings close to real time rather than on a scheduled batch.

Does a Form 4 filing mean something illegal happened?

No. Forms 3, 4 and 5 are routine ownership disclosures required of insiders, not evidence of wrongdoing. Illegal insider trading is a separate legal concept involving trades made on material nonpublic information, and it is not what these forms report.

What is the Rule 10b5-1 checkbox on Form 4?

Since April 1, 2023, every Form 4 and Form 5 includes a checkbox the filer marks if the reported transaction was executed under a Rule 10b5-1 trading plan, a pre-arranged schedule set up in advance. It lets you distinguish a scheduled, plan-driven trade from a discretionary one.

Get this data as clean JSON

SecFeed turns SEC filings into structured data with one API call: GET /v1/insider-trading. 125 free calls to start.

Get a free API key →

For information only, not investment advice. Data from public SEC filings; verify important figures on SEC.gov. See our AI Disclosure.