SEC filing automation for analysts: the morning pipeline behind my insider-buying + earnings-beat screen
- SEC filing automation for analysts is not headline scraping. It is pulling the structured filings themselves - Form 4s, 8-Ks - and filtering them on the fields that carry meaning, like the Form 4 transaction code, before a human ever looks.
- The screen combines two independent signals: an insider buying on the open market (code P) and a same-quarter earnings beat. Either alone is noisy; the overlap is a much shorter and more interesting list.
- The pipeline is reproducible and inspectable. Every filing type filter, transaction-code filter, and size threshold sits on the canvas, and every surfaced name links back to the filing it came from, so the output is auditable rather than a black box.
- The result is a morning digest of a handful of names, each with the insider purchase, the beat, and the reason it cleared the filter - a shortlist to investigate, not a list to trade.
EDGAR does not keep market hours. Form 4s get filed within two business days of an insider trading, 8-Ks land whenever something material happens, and a good chunk of it posts after the close and overnight. If you follow a few hundred names, the raw feed is unreadable - hundreds of filings a day, most of them routine grants, automatic sales, and boilerplate. The signal is in there, but you are not going to find it by scrolling.
So I automated the filtering. Not the judgment - the filtering. This is a build log for the pipeline I run overnight to answer one specific question: which companies had an insider buy shares on the open market around the same quarter they beat earnings? That overlap is short and worth a look, and the pipeline finds it while I sleep. Here is every node, and the output it leaves me by morning.
What "SEC filing automation" means here
There is a weak version of this - scrape a headline feed, alert on the word "insider." That gives you noise with a timestamp. The version worth building pulls the structured filing itself and filters on the fields that actually carry meaning. For a Form 4 that means the transaction code: a code-P open-market purchase is a discretionary decision to buy, while codes A, M, and F are compensation and tax events that look like buying to a scraper and mean nothing. Automation that does not read the transaction code is counting payroll. The distinction is laid out in Form 4 transaction codes, explained.
The pipeline, node by node
Two branches that meet. One branch reads insider filings; the other confirms the earnings beat; a join node keeps only the names that appear in both.
| Node | What it does | What it emits |
|---|---|---|
| 1. Filing source | Pulls new Form 4 filings across my universe from EDGAR, overnight. | Raw Form 4s |
| 2. Code-P filter | Keeps only open-market purchases. Drops grants (A), exercises (M), tax withholding (F). | Real insider buys |
| 3. Size + roster filter | Keeps buys that are meaningful in dollar terms or come from multiple distinct insiders. | Buys worth noting |
| 4. Earnings branch | For the same universe, flags companies that beat consensus this quarter and by how much. | Beat, surprise % |
| 5. Join | Keeps only tickers present in both branches - insider buy and earnings beat. | The overlap |
| 6. Output | Ranks the overlap and writes it to a morning digest with a link to each filing. | Shortlist + sources |
The join in node five is the whole idea. Each branch on its own produces a long, noisy list. Insider buys alone run to dozens a week across a universe; earnings beats alone are most of the tape during the season. The intersection - a real open-market purchase and a beat, on the same name, in the same window - is usually a handful, and that handful is the point.
Why insider buying and an earnings beat together
Two independent signals pointing the same way is worth more than either at full volume. An earnings beat is public and priced quickly; on its own it tells you little that the market has not already seen. An insider purchase is a private read - someone who sees the internal numbers choosing to put their own money in - but a single buy is noisy, since insiders buy for optics, financing requirements, and reasons that have nothing to do with value. When both land on the same name, the idiosyncratic explanations for the insider buy get harder to lean on, and you have a company where the reported results and the behavior of the people who know it best agree. If the buying comes from several insiders rather than one, better still - the case for that is in cluster insider buying.
The output
Here is the shape of the morning digest. Each row is a name that cleared both branches, with enough to decide whether to open the filing.
Illustrative output - representative of the format, not a live run and not a recommendation. Tickers are used only to show the layout.
| Ticker | Insider buys (code P) | Buy size | Earnings beat | Why it surfaced |
|---|---|---|---|---|
| Example A | 3 insiders | ~$1.4M total | Rev +4.1% | Cluster buy into a beat and raise |
| Example B | 1 insider (CFO) | ~$820K | EPS +6.0% | Large single buy, clean beat |
| Example C | 2 insiders | ~$310K | Rev +1.2% | Two buyers, thin beat - worth reading |
| Example D | 1 insider (Dir.) | ~$95K | EPS +9.4% | Small buy, large beat |
As with any screen, the list is not ranked by conviction - it is ranked so the most complete cases sit at the top. Example A, a cluster of three buying into a beat and raise, is a very different situation from Example D, a small director purchase against a big beat, and the digest is not claiming otherwise. It is claiming these four names, out of a universe of several hundred and a night of filings, are where the two signals overlapped.
Reading it, and the caveats
Every row links to the underlying Form 4 and the earnings release, and I open both before drawing any conclusion. Timing matters more than it looks: a purchase filed the day before results is different from one filed two weeks after, and the pipeline records the dates so I can see which I am looking at. Signals also decay as they become widely known, so a name that has already run on the same news is less interesting than one the market has not repriced. And a beat is management's framing until you have checked it against the filed numbers. The pipeline surfaces the overlap; it does not tell you the overlap is right. That part does not automate, and it should not.
Build it yourself
The filters are yours to set, and they are where your judgment goes in. Mine keep code-P purchases above a dollar threshold, prefer multiple insiders over one, and require the beat to clear a surprise floor so a rounding-error beat does not count. You might add an 8-K branch to catch material events in the same window - the approach is the same one in monitoring 8-K filings at scale - or a price-reaction node so you only see names the market has not already moved on. Whatever you choose, the rules sit on the canvas in plain sight, so the digest is never a number you have to trust. It is a filtered view of public filings whose logic you can read, change, and defend.
That is the pipeline. It does not decide anything. It reads every Form 4 and every release overnight, keeps the ones where two independent signals line up, and leaves me a short list with the filings attached - so my morning starts with four names to investigate instead of four hundred to sort.
Note: this is not investment advice. Insider buying and earnings beats are inputs, not theses, and the output of a screen is a research starting point. Verify every transaction and figure against the source filings on EDGAR before acting.
Frequently asked
What does SEC filing automation for analysts actually mean? It means pulling filings directly from EDGAR - Form 4 insider transactions, 8-K material events, and others - as structured data on a schedule, then filtering them on the fields that matter (filing type, transaction code, dollar size) so an analyst reviews a short, relevant list instead of a raw feed. It is automation of the mechanical filtering, not of the judgment.
Why combine insider buying with an earnings beat? Each signal on its own is weak. Insiders buy for many reasons, and plenty of companies beat consensus without it meaning much. But a name where an insider put personal capital in on the open market and the business just beat is a rarer overlap - two independent reads pointing the same way - which makes for a much shorter and more worthwhile list to investigate.
Which insider filings does the pipeline keep? Only open-market purchases - transaction code P on the Form 4. Grants (code A), option exercises (code M), and shares withheld for taxes (code F) are compensation events, not discretionary buys, and are filtered out. Screening on the transaction code is what separates a real insider purchase from a payroll event.
Is the pipeline making investment decisions? No. It filters filings on rules you set and surfaces the overlap, with each name linked back to the source filing on EDGAR. It never forms a view. A name appears because it met your criteria, and verifying why - and whether it means anything - is the analyst's job, not the pipeline's.