Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Build an Insider-Buying Screener with Python and SEC Form 4 Data

Use SEC filing metadata and ownership records to screen reported Form 4 purchases while keeping transaction details, provenance and amendments intact.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build a reproducible insider-purchase screener by finding Form 4 filings through SEC company-submission data, parsing the ownership transactions, and screening their reported transaction codes and acquisition/disposition details. Treat the output as reported activity—not a prediction of returns—and keep each result tied to its original filing so you can review footnotes and amendments.

What Form 4 tells you—and when it appears

Forms 3, 4 and 5 disclose beneficial ownership information for covered insiders. Form 4 reports changes in beneficial ownership; it is not a live trade feed. The transaction date is when the reported event occurred, while the filing date is when the form was submitted.

As an Amazon Associate I earn from qualifying purchases.

The U.S. Securities and Exchange Commission’s Form 4 instructions state: “This Form must be filed before the end of the second business day following the day on which a transaction resulting in a change in beneficial ownership has been executed.” This is a business-day deadline, not a promise that every record will appear instantly. Filings can also be amended.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose an SEC data route

Route Useful for Trade-off
Company submissions API plus original ownership filings A focused screener following a company or a limited set of issuers. Submission history helps identify filing metadata; retrieve the ownership filing to inspect transaction-level details. Requires locating and parsing ownership-specific filing data. The SEC distinguishes submissions history from extracted XBRL company facts; do not assume general company-facts endpoints contain Form 4 transaction rows. See the SEC API documentation.
SEC Insider Transactions Data Sets Batch or historical analysis. The SEC provides quarterly structured ownership data extracted from Forms 3, 4 and 5. The data is flattened, so inspect the schema and readme, preserve relationships among rows, and retain links to the underlying filing. See the dataset catalog and readme.

Company-submission JSON updates as filings are disseminated. For larger retrievals, SEC bulk archives may be more practical than repeated individual requests. The API documentation describes these routes separately from extracted XBRL data.

Build a filing-centered record model

Use the accession number as the identity of a filing and keep the filing’s rows linked rather than flattening everything into one assumed one-to-one record. A filing can include multiple reporting owners, transactions, holdings, derivatives and footnotes. The SEC readme describes distinct submission, owner, non-derivative, derivative, footnote and signature data.

A useful normalized model retains these fields where present:

  • Filing: accession number, issuer CIK and symbol, form type, filing date, period of report, filing URL, and whether it is an amendment.
  • Reporting owner: owner CIK and name, plus the reported relationship to the issuer, such as director, officer or other status.
  • Transaction: transaction date, security title, transaction code, acquired/disposed indicator, shares, price per share, and direct or indirect ownership.
  • After-event context: holdings after the transaction, derivative terms and related derivative transactions or holdings, and any footnotes or remarks.
  • Lineage: references to original submissions and amendments, so a corrected filing does not silently erase the earlier record.

The SEC’s dataset readme is the reference for how its structured tables and codes are organized. Preserve explicit links between filing, owner and transaction rows; a join that multiplies rows can otherwise make a single reported event look like several purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Define what counts as a purchase

Do not screen on a headline label alone. The SEC readme maps transaction code P to an open-market or private purchase and code S to an open-market or private sale. Check the acquisition/disposition indicator alongside the code, then inspect the shares, price, resulting holdings, owner relationship and footnotes.

  1. Start with non-derivative transactions, unless your screen is explicitly designed to handle derivative activity separately.
  2. Retain records whose reported transaction code is P and whose acquisition/disposition field is consistent with an acquisition.
  3. Keep the SEC code, transaction date, shares, price, post-transaction holdings, ownership form and footnotes with every flagged row.
  4. Separate grants, awards, option exercises, gifts, tax withholding and other non-purchase events from a simple open-market-purchase screen. Do not recast them as open-market buys; show them in separate categories only if that is useful to your readers.
  5. Group or display results by issuer, reporting person, transaction date and filing date. If you add a minimum reported value or restrict results by owner relationship, label it as your chosen screen setting, not an SEC-endorsed threshold.

Preserve provenance and check data quality

The SEC says its ownership dataset is derived from information supplied by filers and that it cannot guarantee the information’s accuracy. A flagged row is a lead for inspection, not a verified conclusion. Keep the accession number and filing URL, and review the original form when details matter. The SEC dataset catalog describes the data’s source and caveat.

  • Keep amendments visible: mark Form 4/A filings and link them to the earlier submission instead of silently overwriting it.
  • Retain footnotes: they can clarify indirect ownership or transaction circumstances that a compact table cannot show.
  • Deduplicate cautiously: related owners may report the same event; do not count owner-level rows as distinct economic purchases without checking the filings.
  • Reconcile joins: confirm that adding owner, transaction or holding rows has not multiplied counts or reported value.
  • Expose missing fields: leave unknown values as unknown rather than interpreting absent price, shares or relationship data as zero.

Use SEC endpoints responsibly

The SEC’s developer resources say total requests should not exceed 10 per second per user. Keep requests well below that ceiling with caching and modest polling; fetch only the filings you need, use a descriptive user agent, and retry transient failures with backoff. The API documentation notes that submissions update as filings are disseminated and that processing delays can be longer during peak filing times. Check the live SEC developer guidance when implementing because operational details may change.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Interpret alerts as filings, not forecasts

A screener can identify transactions reported as purchases under the criteria you choose. Because filing follows execution, an alert arrives after the reported trade; later amendments may change the record. The SEC sources describe reporting requirements and data fields, not validated investment performance. They do not establish that following Form 4 purchase alerts predicts a stock’s direction or produces excess returns.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.