How to Track Insider Trades with ChatGPT and Claude

Corporate insiders report their holdings and their trades on three SEC forms: Form 3, the initial statement of beneficial ownership, Form 4, the statement of changes in beneficial ownership, and Form 5, the annual statement covering transactions exempt from Form 4 or missed when due. Form 4 is due before the end of the second business day following the execution date of the transaction under Rule 16a-3(g), which makes it the fastest ownership disclosure filed on EDGAR. Connecting ChatGPT or Claude to the SEC-API.io MCP server gives the assistant direct query access to those filings, so a screen returns a table of transactions rather than a list of documents to open. This post covers what the data contains, how to connect the assistant, four prompts that produce a usable screen, and how to read the result.

What insider trading data covers

Forms 3, 4 and 5

Form 3 is filed within 10 days of becoming an insider, or by the effective date of the registration statement when a company first registers a class of equity securities. It is a position statement and reports no transaction. Form 4 reports a change in beneficial ownership and carries the transaction detail: the transaction date, the transaction code, the number of shares, the price, the number of shares beneficially owned following the reported transaction, and whether the holding is direct or indirect. Form 5 is filed within 45 days after the issuer's fiscal year end and reports transactions that were exempt from Form 4 reporting or that should have been reported earlier.

Every Form 4 has two tables. Table I covers non derivative securities, which is ordinary common stock. Table II covers derivative securities: options, restricted stock units, warrants and convertible instruments, each with its exercise price, exercisable date and expiration date. A single option exercise followed by a same day sale appears in both tables.

Who counts as an insider under Section 16

Section 16 of the Securities Exchange Act of 1934 applies to three groups at a company with a class of equity securities registered under Section 12: officers, directors, and any beneficial owner of more than 10 percent of that registered class. The relationship is declared by checkbox on the face of every Form 3, 4 and 5, and one reporting person can tick more than one box. Employees below officer level, consultants and ordinary shareholders file nothing under Section 16.

Transaction codes that matter

The transaction code is the field that separates a decision from an administrative event. Six codes account for most of the volume.

CodeMeaningReflects a decision to buy or sell
POpen market or private purchaseYes
SOpen market or private saleYes, subject to whether it ran under a Rule 10b5-1 plan
AGrant, award or other acquisition from the issuerNo
MExercise or conversion of a derivative securityNo
FSecurities withheld by the issuer to pay the exercise price or tax liabilityNo
GBona fide giftNo

Codes P and S are the discretionary categories, because the insider chose the timing and the size. Codes A, M and F follow from compensation arrangements: an award vests on a schedule set at grant, an option is exercised before it expires, and shares are withheld at a rate set by the tax withholding obligation. Code G moves shares without a sale price. A screen that counts all six codes as buying and selling produces a signal dominated by payroll mechanics.

Section 16 filings, Schedules 13D and 13G, and Form 144

Schedules 13D and 13G are filed by any person who acquires beneficial ownership of more than 5 percent of a class of registered voting equity securities. Those filers are frequently institutions with no board seat and no officer role, so a 13G filer is not an insider under Section 16, and a Section 16 insider holding 2 percent of the stock files no Schedule 13D or 13G. The two datasets answer different questions: Section 16 reports what the people running the company did with their own shares, Schedules 13D and 13G report who has accumulated a stake large enough to matter to control.

Form 144 is a third dataset again. It is the notice of a proposed sale of restricted or control securities under Rule 144, filed by an affiliate at or before the time the sell order is placed with the broker. It states an intention to sell up to a stated number of shares. The Form 4 filed afterwards reports what actually executed, at what price and on what date. A Form 144 with no matching Form 4 means the proposed sale was reduced or not carried out.

Field by field detail on each of the three insider forms is in Where to find insider trades in Forms 3, 4 and 5, and the 5 percent stake disclosures are covered in Guide to corporate ownership structures.

Connecting the assistant

Claude

The SEC-API.io MCP server is a remote HTTP server at https://api.sec-api.io/mcp?apiKey=YOUR_API_KEY, so there is nothing to install. In Claude, open Settings, then Connectors, then Add custom connector, paste the URL, leave the OAuth fields empty, and click Add then Connect. Turn the connector on for a conversation with the plus button below the message field. Full instructions, including the Claude Code command, are in How to access SEC financial data in Claude.

ChatGPT plugin and Codex

In ChatGPT the SEC-API.io connection is a plugin. ChatGPT on the web adds it at account or workspace level under Settings, then Security and login, then Developer mode, and the plugin itself is created from the Plugins page with Authentication set to No Auth. The ChatGPT desktop app, the Codex CLI and the IDE extension read ~/.codex/config.toml instead, where the entry is a [mcp_servers.sec-api] table with a url key. The steps with screenshots are in How to access SEC financial data in ChatGPT. A free API key is issued at https://sec-api.io/signup, and setup takes 2 to 5 minutes in either client.

Worked prompts

The four prompts below run in ChatGPT or Claude once the connector is on. Each prompt is followed by the output of a run against the filings, with the dates of the run stated.

Screen a date range for open market purchases

Screen every Form 4 filed between 24 August 2026 and 31 August 2026 for a transaction with code P. Group the results by issuer CIK, count the distinct reporting persons per issuer, and rank issuers by that count. Drop any issuer with only one purchasing insider. Return issuer name, CIK, ticker, number of distinct insiders, number of Form 4 filings, total shares purchased and the first and last purchase date in the window.

What comes back:

  • One row per issuer, ranked by the count of distinct reporting persons rather than by dollar value
  • The count of Form 4 filings alongside the insider count, so an issuer where three insiders filed nine times is distinguishable from one where nine insiders filed once
  • Ticker and CIK on each row, with the CIK carrying the grouping, because one issuer can appear under two ticker symbols across a quarter
  • An illustrative top row of the shape "7 distinct insiders, 11 filings, 214,000 shares, 12 June to 28 August"
  • A tail of single insider issuers removed by the filter, which is usually the majority of the raw result set

The answer is built from Form 4 Table I transactions carrying code P in the stated window. Adding "and where the reporting person ticked officer or director" removes purchases by more than 10 percent holders, which are often institutional accumulations rather than management buying.

Run over the Form 4 filings received between 24 and 31 August 2026, the screen returned 579 code P transactions at 222 issuers, of which 47 issuers had more than one purchasing insider. The top of that ranking:

IssuerTickerCIKInsidersForm 4 filingsSharesValueFirst purchaseLast purchase
BiomericaBMRA732905598,750$158,00020 Aug 202626 Aug 2026
Dick's Sporting GoodsDKS10890634428,650$3,722,30326 Aug 202627 Aug 2026
AmerescoAMRC14881394531,325$672,02121 Aug 202627 Aug 2026
AmrizeAMRZ2035989449,155$407,70425 Aug 202627 Aug 2026
BioVieBIVI15801494423,280$49,11827 Aug 202628 Aug 2026
Odysight.aiODYS1577445331,203,125$3,850,00020 Aug 202620 Aug 2026
ComscoreSCOR11581723347,000$246,83020 Aug 202628 Aug 2026
CarParts.comPRTS13789503334,326$236,35820 Aug 202628 Aug 2026

The first row shows what the transaction code alone does not tell you. All five Biomerica purchases were made at exactly $1.60, and the footnote on each filing states that the shares were bought in a private placement under a securities purchase agreement dated 20 August 2026. Code P covers private purchases as well as open market purchases, so the top rank of this screen is a financing round that directors and officers took part in. Adding "and exclude any transaction whose footnote describes a private placement or a securities purchase agreement" to the prompt removes it.

The Dick's Sporting Goods rows are purchases by four directors within two days:

InsiderRoleDateSharesPrice
Mark J. BarrenecheaDirector27 Aug 202617,000$130.72
William J. ColomboDirector26 Aug 20265,000$128.72
William J. ColomboDirector27 Aug 20261,100$129.00
Robert W. EddyDirector26 Aug 20264,000$128.695
Sandeep MathraniDirector26 Aug 20261,550$128.892

Purchase dates also fall outside the filing window. The Comscore and CarParts.com rows include transactions dated 20 August that reached EDGAR a week later, which is the gap between transaction date and filing date described below.

Follow one company's insiders over twelve months

Pull every Form 4 filed for Costco Wholesale over the last 12 months. Split the transactions into two groups: open market transactions with code P or S, and plan or award driven transactions with codes A, M and F. For each group give the transaction count, the number of distinct insiders, the total shares and the date of the most recent transaction. List every code P purchase individually with the insider name, role, date, shares and price.

What comes back:

  • Two blocks with matching columns, so the discretionary activity is readable separately from the compensation activity
  • A code P list that is frequently empty at a large company over a twelve month window, which is a result rather than a failed query
  • Code S rows with the reporting person's role attached, separating officer sales from director sales
  • Code M and code F rows appearing as pairs on the same date, which is the standard option exercise followed by tax withholding
  • Shares owned following each transaction, which shows whether a seller reduced a position or trimmed a fraction of it

The answer is built from Forms 4 and 5 filed with Costco Wholesale as the issuer, using Table I for the share transactions and Table II for the option and unit legs.

Run on 17 September 2026 over the preceding 12 months, Costco insiders filed 45 Forms 4 and 5 Forms 3, with 89 transactions and no Form 5:

GroupTransactionsDistinct insidersSharesMost recent transaction
Open market, codes P and S141020,490.68823 Jun 2026
Plan or award driven, codes A, M and F662287,654.87610 Sep 2026

The code P list is empty. No Costco insider bought a share on the open market in those 12 months, so the open market group consists of code S sales alone. The plan and award group splits into 21 code A grants of 63,345 shares and 45 code F withholdings of 24,309.876 shares, with no code M option exercises. Eight bona fide gifts under code G and one discretionary transaction under code I sit outside both groups.

The five largest sales:

InsiderRoleDateSharesPriceShares owned after
Russell D. MillerSr. Executive Vice President29 Sep 20253,381$915.009,740
Claudine AdamoExecutive Vice President22 Oct 20252,700$935.686,851.197
William Richard WilcoxExecutive Vice President7 Nov 20252,400$930.132,000
Javier PolitExecutive Vice President29 Dec 20252,049$867.205410,747.897
Caton FratesExecutive Vice President29 Sep 20251,540$910.029,283.694

None of the 89 transactions carries the Rule 10b5-1 checkbox, which is the absence of an assertion on the form rather than evidence that no plan existed.

Check whether a sale ran under a Rule 10b5-1 plan

For the 10 most recent Form 4 filings reporting a code S sale by an officer of Marriott International, report for each one whether the transaction was marked as made under a Rule 10b5-1 trading plan, the plan adoption date if it is disclosed, the transaction date, the filing date, the shares sold, the reported price and the shares held afterwards. Quote any footnote that describes the plan.

What comes back:

  • A yes or no per filing taken from the checkbox on the face of the form, not inferred from the price or the size
  • The plan adoption date where the filer discloses it, which the SEC's amendments to Rule 10b5-1 require to be given by footnote
  • The footnote text itself, which often names the plan date and states that the sale was made to satisfy tax obligations or to diversify
  • Filings with no checkbox and no footnote, which are sales the filer did not attribute to a plan
  • The gap in days between transaction date and filing date on every row

The answer is built from the Form 4 header, the Table I code S rows and the footnote block. Filings made before the checkbox was added to the form disclose plan participation in a footnote if at all, so an absent checkbox on an older filing is not evidence that no plan existed.

The 10 most recent officer sales, run on 17 September 2026:

InsiderTitleTransactionFiledDaysSharesPriceOwned after10b5-1 box
Peggy RoeEVP and Chief Customer Officer18 May 202619 May 202613,000$361.5619,827No
Yibing MaoPresident, Greater China13 May 202614 May 202614,816$347.7227,398No
Rajeev MenonPresident, APEC19 Feb 202620 Feb 202613,492$354.006,000No
Drew PintoEVP, Chief Revenue and Technology Officer17 Feb 202619 Feb 202624,000$359.8148,221No
Anthony CapuanoPresident and CEO17 Feb 202619 Feb 202624,788, 16,610 and 41,602$360.0052, $358.4686 and $359.4338113,617No
William P. BrownGroup President, US and Canada18 Feb 202619 Feb 202619,456$358.251111,000No
Benjamin T. BrelandCHRO and EVP, Global Operations Services18 Feb 202619 Feb 202612,000$358.030126,398.6153No
Rajeev MenonPresident, APEC18 Feb 202619 Feb 202616,333$356.61019,492No
Rena Hozore ReissEVP and General Counsel13 Feb 202617 Feb 202642,512$357.0033,487No
Felitia LeeController and Chief Accounting Officer15 Dec 202516 Dec 20251528 and 1,089$308.00 and $305.004,892.834No

None of the 10 filings ticks the Rule 10b5-1 box, and no footnote names a plan or a plan adoption date. The footnotes that are present disclose weighted average sale prices, tax withholding on vesting units, and the terms of stock appreciation rights. Seven of the 10 sales fall in the week of 13 to 19 February 2026, the period that follows the annual vesting date and the fourth quarter results.

Pull one insider's history across every issuer

Pull the full Form 3, 4 and 5 history for Alex Gorsky, reporting owner CIK 1453149, across every issuer they file for. Group by issuer, state the declared relationship to each one, and list each transaction with its date, code, shares, price and shares held afterwards. Flag any issuer where a Form 3 was filed but no subsequent Form 4.

What comes back:

  • One group per issuer, keyed on the reporting person CIK rather than on the name, so a name spelled differently across filings still resolves to one person
  • The relationship checkboxes per issuer, which differ when the same person is a director at one company and an officer at another
  • Form 3 rows showing the opening position at the date the reporting obligation began
  • Transaction rows in date order within each issuer, with derivative legs separated from share legs
  • Issuers with a Form 3 and no Form 4, meaning the position has not changed since the obligation started

The answer is built from Forms 3, 4 and 5 filed by one reporting person CIK across all issuers, rather than from the filings of any single company.

Run on 17 September 2026, the history for Alex Gorsky covers 106 filings at four issuers between January 2009 and July 2026:

IssuerTickerDeclared relationshipFilingsFirst filingLast filing
Johnson & JohnsonJNJOfficer, then Director and Officer as Chairman and CEO, then Director319 Jan 200918 Jan 2023
IBMIBMDirector505 Sep 20142 Jul 2026
AppleAAPLDirector1212 Nov 202126 Feb 2026
JPMorgan ChaseJPMDirector1322 Jul 202222 Jan 2026

The relationship changes over time at Johnson & Johnson on the same reporting person CIK: member of the executive committee, then Chairman and CEO, then director. Every issuer has a Form 3 followed by Form 4 activity, so the flag for a Form 3 with no later Form 4 returns nothing.

One code P purchase appears in the whole history:

IssuerDateCodeSharesPriceShares owned after
IBM9 Nov 2020P4,232$117.8554,232

The remaining rows are compensation mechanics. At Johnson & Johnson on 17 January 2023 he exercised options over 547,692 shares at $72.54 under code M and returned 366,610 shares under code F at $173.43 to cover the exercise price and the tax, leaving 766,583.671 shares. The IBM rows are quarterly code A deferrals of director fees into promised fee shares, the Apple rows are annual restricted stock units vesting under code M against grants under code A, and the JPMorgan rows are quarterly code A grants. A screen that counted codes A and M as buying would report this person as a steady buyer of four stocks.

How to read insider trading data

Plan sales are scheduled in advance

A sale made under a Rule 10b5-1 trading plan was set up before the trade date, under a contract, instruction or written plan adopted when the insider was not aware of material nonpublic information. The execution date reflects the schedule in the plan rather than a view formed that week. Treat a plan sale as a weak signal about the insider's current opinion, and check the checkbox and the footnote before reading anything into the timing.

Award, exercise and withholding transactions

Code M is the exercise of a derivative security that was granted years earlier and often expires shortly after the exercise date. Code F is shares handed back to the issuer to cover the exercise price or the tax liability triggered by a vesting event, at a rate the insider does not choose. Code A is the grant itself. All three change the share count in the filing without expressing an opinion about the price.

Joint filings double count one economic actor

Co filers on a single Form 4, for example a fund and its general partner, each report the same underlying shares. Counting reporting persons naively then records two insiders for one economic decision. Collapse co filers on a shared filing before counting distinct insiders, and check whether an entity and an individual on the same filing describe the same holding.

Screen on transaction code and insider count

Aggregate dollar volume is dominated by a small number of large sales, most of them plan driven, and by option exercises that pass through the totals twice. The count of distinct insiders buying on code P within a window is the field that separates a single executive topping up a holding from several officers and directors buying in the same period.

Transaction date and filing date are different fields

Form 4 carries both. The transaction date is the execution date of the trade, the filing date is when the form reached EDGAR, and Rule 16a-3(g) allows up to the end of the second business day between them. A screen run on filing date over a window includes trades executed before that window opened, and a screen run on transaction date misses trades executed inside the window that have not been filed yet. State which date the screen uses in the prompt.

Filing deadlines and data freshness

Filing deadlines by form

FormDeadlineRule
Form 4End of the second business day following the execution dateRule 16a-3(g)
Form 144At or before the time the sell order is placed with the brokerRule 144
Schedule 13DFive business days after crossing 5 percentRule 13d-1
Schedule 13GFive business days for passive filers, 45 days after quarter end for qualified institutional filersRule 13d-1
Form 13F45 days after quarter endRule 13f-1

What the lag means for a screen

Form 4 is the only one of these filed within days of the transaction, which is why insider screens run on a rolling window of days or weeks. Form 13F reports positions as of a quarter end date up to 45 days before the filing, so a holding disclosed on the deadline may already be sold and a 13F comparison describes the past quarter rather than the current one. Mixing the two datasets in one screen without stating the as of date for each produces a table where the rows are not contemporaneous.

Downloading the screen as Excel, CSV or a chart

State the format in the prompt

The assistant returns prose unless the prompt names something else. Append the format to any of the prompts above: an Excel file, a CSV, a PDF, a Markdown table, or a chart as an image. For an insider screen the useful default is one row per transaction with issuer, CIK, reporting person, role, date, code, shares, price and shares held afterwards, which keeps the file sortable and filterable after it is delivered.

Specify the chart

A chart specification needs the chart type, the series and the axis. For a twelve month insider history, a workable instruction is a stacked column chart of shares by month, with code P and code S in one colour pair and codes A, M and F in another, on a zero anchored axis, labelled with the transaction count per month. More worked examples with their output and underlying data are in the Financial Analysis Prompt Library.

FAQ

Can AI track insider trading in real time?

It tracks the disclosure, not the trade. The earliest public record of an insider transaction is the Form 4, due before the end of the second business day after execution under Rule 16a-3(g). Connected to the SEC-API.io MCP server, the assistant queries filings that are available within 300 milliseconds of publication on EDGAR, so the limit on timeliness is the filing deadline rather than the data pipeline.

Which transaction code shows that an insider actually bought shares?

Code P, an open market or private purchase. Code A is a grant from the issuer and code M is the exercise of a previously granted derivative security, and neither involves buying stock at a price the insider chose. A screen that treats A and M as purchases reports compensation events as buying.

What is the difference between Form 4 and Form 144?

Form 144 is a notice of a proposed sale of restricted or control securities, filed at or before the sell order is placed, and it states a maximum number of shares the affiliate may sell. Form 4 reports the transaction that executed, with the date, the code, the share count and the price. A Form 144 can be filed and never followed by a matching sale.

Does a Rule 10b5-1 plan sale mean the insider is bearish?

The plan was adopted before the sale date, so the execution timing was set in advance. Form 4 carries a checkbox indicating that a reported transaction was made under a contract, instruction or written plan intended to satisfy Rule 10b5-1(c), and the plan adoption date is disclosed by footnote. Read plan sales separately from unplanned code S sales.

Do I need a CIK to run an insider screen?

No. A ticker or a company name is enough, and the assistant resolves it to the issuer CIK. Give a CIK when several registrants share a name, and note that the screen itself should group on CIK, because one issuer can file under more than one ticker symbol over a period.

Why do two insiders appear to report the same shares?

Co filers on a joint Form 4, such as an investment entity and the individual who controls it, each report the same underlying holding. That is one economic actor across two reporting persons. Collapse joint filings before counting distinct insiders.

How far back does the insider data go?

The SEC-API.io database covers EDGAR filings from 1993 to today. Electronic filing of Section 16 reports became mandatory on 30 June 2003, so machine readable coverage of Forms 3, 4 and 5 is dense from mid 2003 onward and sparse before that date.

Can the screen come back as an Excel file?

Yes, if the prompt asks for it. The same applies to CSV, PDF and charts. Naming the columns in the prompt controls the layout of the file rather than leaving it to the assistant.

Which assistants can query this data?

Any assistant that supports the Model Context Protocol, including Claude, Claude Code, ChatGPT, the Codex CLI and Gemini. The server is remote and read only against SEC data, so the same endpoint works across all of them.

The insider forms themselves

Setup and prompts

Data and API reference

Educational content about accessing and analysing SEC filing data. Not investment advice, legal advice, or a recommendation to buy or sell any security.

Last updated: 14 September 2026