AI & Agents

Build a 13F Tracker with AI: Raw EDGAR vs a Clean API

An honest build-vs-buy tutorial: what parsing raw EDGAR 13F filings yourself really costs, versus pointing your AI agent at a clean, provenance-tracked API.

Updated July 2, 20268 min read
Build a 13F Tracker with AI: Raw EDGAR vs a Clean API

The short version

There are two honest ways to build a 13F tracker. The hard way is pulling raw filings from SEC EDGAR and writing your own fetcher, parser, amendment logic, and CUSIP mapping; the data plumbing will dwarf the tracker itself. The fast way is calling a clean API that has already absorbed that work, so your AI agent can query institutional holdings in a few lines of code. This tutorial sketches both paths, with code, so you can decide where your time is actually worth spending.

What a 13F tracker actually has to do

A 13F tracker answers questions like "what did this fund buy last quarter?", "who holds NVDA?", and "which positions changed the most across the smart-money universe?". To answer them reliably, it needs five capabilities:

  1. Discovery. Catch every new 13F-HR, and every 13F-HR/A amendment, as it lands on EDGAR. Managers with at least $100M in covered US equities must file within 45 days of quarter end; the 2026 deadlines are Feb 17, May 15, Aug 14, and Nov 16. Filings cluster heavily in the final days before each deadline, so the load arrives as a flood four times a year, not a steady trickle.
  2. Parsing. Extract the information table (issuer name, CUSIP, value, share count, put or call flag) from each filing's XML documents.
  3. Identity. Map CUSIPs to tickers and issuers, and keep that mapping current as securities change.
  4. Diffing. Compare position tables quarter over quarter, per fund, to derive new buys, adds, trims, and exits. This is the part people actually want.
  5. Serving. Expose the result to whatever consumes it: a dashboard, a screener, a backtest, or an AI agent.

None of this is exotic computer science. The honest framing for the whole tutorial is that steps 1, 2, and 5 are a fun weekend, while steps 3 and 4, plus the amendment semantics hiding inside step 1, are where side projects quietly die. If you have never read one of these documents end to end, start with how to read a 13F filing before writing any code.

Restrained editorial illustration of a developer desk and data connectors: image for

The raw EDGAR build: a working sketch

EDGAR is genuinely open. Every filing is a free public record, searchable at EDGAR full-text search, and the SEC documents programmatic access. A minimal fetch loop looks like this:

import requests

HEADERS = {"User-Agent": "[email protected]"}  # SEC requires a real contact

cik = "0001067983"  # Berkshire Hathaway, zero-padded to 10 digits
subs = requests.get(
    f"https://data.sec.gov/submissions/CIK{cik}.json", headers=HEADERS
).json()

# 1. Filter subs["filings"]["recent"] for form "13F-HR" or "13F-HR/A"
# 2. For each accession number, fetch the filing's index.json
# 3. Locate the information-table XML among the documents
# 4. Parse <infoTable> rows: nameOfIssuer, cusip, value, sshPrnamt, putCall

Steps 2 through 4 are comments because that is where the cliff is. The information table is a separate document inside the filing, and its filename is not standardized: some funds call it infotable.xml, others use opaque numeric names. A naive "grab the first XML file" heuristic will sometimes grab the cover page instead, and your tracker silently freezes for that fund. You find out weeks later, when a famous manager appears to have stopped trading. We run this pipeline in production at Arkolith, and exactly this failure mode has bitten us; the fetch layer, not the parser, is where the incident writeups accumulate. Add the SEC's fair-access rate limits, the required User-Agent header, retry logic, and the deadline-week flood, and the "simple fetcher" becomes real software with monitoring and alerting attached.

Where most of the work hides: amendments, identity, and history

Parsing well-formed XML is the easy half of a 13F tracker. The semantics are the hard half.

Amendments can restate or extend. A 13F-HR/A is either a full restatement of the quarter or a new-holdings addition to the original, and the filing itself tells you which (the SEC's 13F FAQ covers the mechanics). Treat an addition as a restatement and you delete most of a fund's portfolio; do the reverse and you double-count it. You also need one deterministic rule for which filing wins when several cover the same quarter.

Options are not longs. Rows carry a putCall flag. Sum everything naively and a manager's large bearish put renders as their biggest "holding". A correct tracker keeps the long book and the options book separate.

Identity is a dataset, not a lookup. Filers report CUSIPs, not tickers, and different filers spell the same issuer differently. Mapping and deduplicating across 1,824 filers is ongoing maintenance, not a one-time script.

History must be point in time. If an amendment overwrites rows in place, you lose the as-filed record, which matters the moment you backtest or audit a signal.

Component Effort from raw EDGAR The trap
Discovery + fetch Days, plus ongoing ops Odd filenames, rate limits, deadline floods
XML parsing Days The easy part; breeds false confidence
Amendment semantics Weeks Restatement vs addition, supersession order
CUSIP and issuer identity Weeks, then forever Reference data drifts
Quarter-over-quarter diffs Days, once identity is right Bad identity fabricates fake "trades"
Point-in-time storage Days to design Overwrites silently destroy history

The buy side: a tracker in three API calls

The alternative is to let someone else carry the pipeline and consume the cleaned result. Arkolith's Q1 2026 dataset covers 1,824 institutional filers, 1.87 million long positions, and $53.7 trillion in reported value, with 51,000+ insider transactions tracked alongside from Form 4 filings (due within 2 business days of the trade, a far fresher signal than the 45-day 13F lag). A working tracker is three calls:

# Resolve a fund by name
curl -H "Authorization: Bearer YOUR_KEY" \
  "https://arkolith.com/api/v1/search?q=berkshire"

# Browse the covered universe
curl -H "Authorization: Bearer YOUR_KEY" \
  "https://arkolith.com/api/v1/funds"

# Pull a fund's holdings by CIK
curl -H "Authorization: Bearer YOUR_KEY" \
  "https://arkolith.com/api/v1/funds/1067983/holdings"

The responses already encode the painful decisions from the previous section: amendments resolved with a single supersession rule, options separated from the long book, exits made explicit instead of silently vanishing, and every datapoint carrying provenance back to its SEC EDGAR accession number so you (or your agent) can open the underlying filing and check. Setup takes a few minutes via the quickstart, and the same data is browsable by humans on the investors leaderboard or a fund page like Warren Buffett's portfolio. The honest cost on this side: you pay per call in prepaid credits, and you inherit our modeling decisions instead of making your own.

Wiring it into an AI agent, and the honest verdict

For most readers in 2026 the consumer is not a dashboard but an agent. If you are building on Claude or another LLM stack, you can skip even the REST glue: connect the MCP server and the agent gets typed tools for fund search, holdings, and quarter-over-quarter moves, with the walkthrough in connecting market data to Claude over MCP. Provenance matters more in this mode, not less. An agent that can cite an accession number for every claim is one you can verify; an agent summarizing your half-finished parser's output will confidently launder its bugs.

So, build or buy. Build from raw EDGAR if data engineering is the product (you are selling the dataset itself), if you need custom semantics that someone else's modeling does not expose, or if you simply want the education; it is a genuinely instructive build. Buy the clean API if the tracker is a means to an end: an input to research, a feature in your app, or a tool your agent calls. The prototype economics favor building; the year-two economics, when the pipeline needs care through every deadline-week flood and every identity drift, usually do not.

Either way, respect what the regime can and cannot tell you. A 13F shows long US equity positions only, lagged up to 45 days, with no shorts and no cash, and academic work has generally found that naively copying filings is a much weaker strategy than it looks. Read how accurate 13F data really is before promising anyone alpha.

Restrained editorial illustration of a developer desk and data connectors, alternate view: image for

Frequently asked questions about building a 13F tracker

How long does it take to build a 13F tracker from scratch?

A fetch-and-parse prototype against EDGAR is a weekend. A production tracker is weeks to months, because amendment semantics, CUSIP-to-issuer identity, options handling, and point-in-time storage each hide failure modes that only surface with real filings. Most abandoned trackers die in that second phase, not the first.

Is SEC EDGAR data free to use?

Yes. 13F filings are public records, free to download, and the SEC documents programmatic access. You must follow the fair-access rules (a declared User-Agent and modest request rates), and free to download is not the same as free to operate: the cleaning and maintenance labor is the real cost.

How fresh is the data in any 13F tracker?

Never fresher than the regime allows. 13Fs are due 45 days after quarter end (Feb 17, May 15, Aug 14, and Nov 16 in 2026), so a position can be that stale on arrival, and the manager may have traded since. Insider Form 4 filings, due within 2 business days of the trade, are the faster public signal.

Can an AI agent query 13F data directly?

Yes. Over REST, any agent that can make HTTP calls can hit the endpoints shown above with a bearer key. Over MCP, the agent gets the same data as typed tools without custom glue code, and per-datapoint accession numbers let it cite the underlying filing instead of guessing.

This article explains public filings and data concepts. It is not investment advice.

#13F tracker#SEC EDGAR#AI agents#build vs buy#MCP#API