Introducing the Wiley x Valyu HLS Startup Program
Valyu
A packed arena at the 2025 Berkshire Hathaway annual meeting in Omaha, with Warren Buffett shown on the large screens above the stage.
Tutorial

13F API: How to Track an Institution's Portfolio From SEC Filings

Prosper
Share this article

On this page
TL;DR
  • A 13F lists a large institutional manager's long positions at quarter end. Ask Valyu what a fund owns and you get its latest 13F as a table, one row per security, with no CIK lookup or XML parsing.
  • Ask for changes from the previous quarter and you get new, increased, decreased and exited positions side by side, so you can see what a fund actually bought and sold.
  • Flip the question to see which institutional managers hold a given stock, each tied to its filing. DeepResearch can then write up the quarter or compare two filings for you.
  • The guide uses Berkshire Hathaway's Q3 2026 filing as the worked example, checks every figure against EDGAR and explains why a 13F always lags the trades it reports.

If you're an agent: Set up Valyu and make your first search.

If you're a human: Create an account and get an API key.

MCP onboarding: Connect your agent to https://mcp.valyu.ai/mcp and follow the MCP setup guide for authentication.

What is a 13F filing?

A 13F is the quarterly report an institutional investment manager files with the SEC once it has investment discretion over $100 million or more in Section 13(f) securities. It is due within 45 days of each quarter end and lists, for every reportable holding, the name and class, CUSIP, number of shares and market value at quarter end. It covers long positions in exchange-listed equities, certain options and warrants, closed-end funds and some convertibles. It leaves out short positions, mutual fund shares and shares that trade only on non-US exchanges, according to the SEC's Form 13F FAQ.

The raw filing is an XML information table with one row per holding per reporting entity. Berkshire Hathaway's Q3 2026 table has 89 rows across Berkshire and 14 related managers, such as GEICO and National Indemnity, so you have to add them up before you know what Berkshire owns. A 13F API should do that for you. This guide shows how Valyu does, using Berkshire's filing of November 16, 2026.

What did Berkshire file?

Holdings as ofJune 30, 2026September 30, 2026
FiledAugust 14, 2026November 16, 2026, 4:00 p.m. ET
SEC accession0001193125-26-3522000001193125-26-463399
Rows in the information table8989
Distinct securities2930
Total reported value$299.25 billion$304.20 billion
Positions withheld as confidentialNoneNone

The Q3 deadline, 45 days after September 30, fell on Saturday, November 14, so the filing was due the next business day.

Figure 1. Berkshire's changes in share count between its June 30 and September 30, 2026 13F filings.

Step 1: ask what a fund owns

Install the SDK and set your key:

Shell
pip install valyu
export VALYU_API_KEY="your-api-key"
Shell
npm install valyu-js
export VALYU_API_KEY="your-api-key"

Then ask the question in plain English with Search, limited to SEC filings:

from valyu import Valyu
 
valyu = Valyu() # reads VALYU_API_KEY
 
response = valyu.search(
"What does Berkshire Hathaway own?",
included_sources=["valyu/valyu-sec-filings"],
max_num_results=1,
)
 
result = response.results[0]
print(result.metadata["filing_date"], result.metadata["accession_number"])
print(result.content) # one row per security: issuer, CUSIP, value, shares

This returned the November 16 filing, accession 0001193125-26-463399, as a 30-row table in about eight seconds for $0.012. The 89 raw rows were already combined into one row per security. The ten largest positions:

SecuritySharesValue at Sept 30
Apple227,917,808$75.90 billion
American Express151,610,700$46.10 billion
Coca-Cola400,000,000$34.43 billion
Alphabet (Class A)78,791,167$27.11 billion
Bank of America455,860,908$24.81 billion
Chevron84,375,856$17.23 billion
Occidental Petroleum264,941,431$14.66 billion
Moody's24,669,778$11.20 billion
Chubb34,249,183$11.14 billion
Alphabet (Class C)27,188,433$9.26 billion

"Warren Buffett portfolio 13F" returned the same filing. "Berkshire 13F Q3 2026" returned nothing, so name the filer and either ask a question or include "13F-HR". For an older quarter, add the date: "Berkshire Hathaway 13F-HR holdings March 31, 2026" returned the Q1 filing.

Step 2: ask what changed

Most people open a 13F to find out what a fund bought and sold. Ask for that directly:

from valyu import Valyu
 
valyu = Valyu()
 
response = valyu.search(
"Berkshire Hathaway 13F-HR changes from previous quarter",
included_sources=["valyu/valyu-sec-filings"],
max_num_results=1,
)
 
print(response.results[0].content) # previous shares, current shares, change, status

Valyu matched the June 30 and September 30 filings and returned every security with previous shares, current shares, the change and a status. These are the 11 that moved:

SecurityJune 30 sharesSept 30 sharesStatus
Bending Spoons020,689,655New position
Lennar (Class A)13,111,74126,034,436Increased
Delta Air Lines57,320,00064,450,000Increased
Lennar (Class B)298,117553,000Increased
Macy's7,347,4267,538,800Increased
Bank of America483,394,015455,860,908Decreased
Kroger39,000,00035,000,000Decreased
VeriSign8,989,8805,922,136Decreased
Capital One3,000,0001,150,000Decreased
Nucor1,857,7521,580,776Decreased
DaVita28,880,20928,697,229Decreased

Read the share columns, not the value columns. Berkshire's Apple stake rose by $9.95 billion in value over the quarter with no change in shares; that was the share price, not a purchase. For large portfolios the comparison is capped: Bridgewater Associates' returned 50 rows, not its full holdings, so check the count before you treat the list as complete.

Step 3: ask who else holds a stock

Berkshire's one new position was Bending Spoons. To see which other managers own it, turn the question around:

from valyu import Valyu
 
valyu = Valyu()
 
response = valyu.search(
"which 13F-HR filers hold Bending Spoons",
included_sources=["valyu/valyu-sec-filings"],
max_num_results=1,
)
 
print(response.results[0].content) # one row per manager, largest stake first

This returned 25 managers from their September 30 filings, each with its accession number. The first eight, as returned:

ManagerSharesReported value
Baillie Gifford & Co51,710,771$1.72 billion
Berkshire Hathaway20,689,655$689.4 million
Durable Capital Partners21,042,453$668.5 million
Capital International Investors14,836,752$494.4 million
Capital Research Global Investors9,200,179$306.5 million
Capital World Investors6,919,385$230.6 million
Allen Operations5,695,200$189.8 million
FMR (Fidelity)3,955,416$127.1 million

Values are as each manager reported them, and the list is sorted by reported value. We checked two rows against the managers' own filings: Baillie Gifford's 51,710,771 shares are spread across five rows in its information table and add up exactly, and Tiger Global's 600,000 shares match too. The query returned 25 managers, so treat it as the largest holders rather than every holder.

Why a 13F is always a quarter behind

Bending Spoons shows how far a 13F can lag. The Milan-based company listed on Nasdaq on July 1, 2026, and Berkshire invested $600 million at the IPO, according to CNBC. At the $29.00 IPO price in the company's pricing announcement, that buys 20,689,655 shares, exactly the figure in the 13F. On October 14, Berkshire agreed to buy 10 million more shares for $330 million. That happened after September 30, so it is not in this filing. It should appear in the Q4 13F, which the SEC's calendar puts due by February 16, 2027.

So a 13F tells you what a manager held on the last day of the quarter, up to 45 days later. For a faster signal on a single stake, watch Schedule 13D filings, which are due within five business days of an investor crossing 5%, with amendments within two business days.

Step 4: check a number against EDGAR

Before a number goes into a report, check it against the filing. Contents returns the full submission, and a few lines of code add up the raw rows:

import re
from collections import defaultdict
from valyu import Valyu
 
valyu = Valyu()
 
url = (
"https://www.sec.gov/Archives/edgar/data/1067983/"
"000119312526463399/0001193125-26-463399.txt"
)
filing = valyu.contents(urls=[url], response_length="max").results[0].content
 
totals = defaultdict(lambda: [0, 0]) # CUSIP -> [value, shares]
for row in re.findall(r"<infoTable>(.*?)</infoTable>", filing, re.S):
cusip = re.search(r"<cusip>(.*?)</cusip>", row).group(1)
totals[cusip][0] += int(re.search(r"<value>(.*?)</value>", row).group(1))
totals[cusip][1] += int(re.search(r"<sshPrnamt>(.*?)</sshPrnamt>", row).group(1))
 
print(len(totals), "positions")
print(totals["037833100"]) # Apple: [value, shares]

We ran this check on both quarters. All 30 Q3 positions and all 29 Q2 positions in Valyu's tables matched the summed EDGAR rows exactly, for both shares and value, and the totals matched the cover pages: $304,196,581,325 and $299,253,556,246. The change table matched as well, row for row.

Step 5: have DeepResearch write it up

For a written summary, use DeepResearch in instant mode, but give it the filings. When we passed the URLs of both information tables and asked for new, increased and decreased positions by share count, it listed all 11 changes correctly in 32 seconds. When we asked the same kind of question without the URLs, it misread the data and concluded that no changes could be established.

instant mode (1 step) is built for fast cited summaries, while DeepResearch offers five modes that scale your research budget and depth: instant (1 step), fast (up to 12 steps), standard (up to 25 steps), heavy (up to 45 steps) and max (up to 75 steps).

For deeper multi-step institutional portfolio analysis across quarters or multiple managers, switch mode to "standard" or "heavy" (pass mode explicitly, because the Python SDK defaults to "standard" while the TypeScript SDK defaults to "fast"), pair it with research_strategy (researchStrategy in TypeScript) and report_format (reportFormat) to guide which holdings and issuer filings DeepResearch cross-checks, and request downloadable deliverables such as CSV or Excel files (supported in every mode except instant).

Here is how to run a deeper multi-step 13F comparison in Python and TypeScript:

from valyu import Valyu
 
valyu = Valyu() # reads VALYU_API_KEY
 
q3_13f = "https://www.sec.gov/Archives/edgar/data/1067983/000119312526463399/0001193125-26-463399.txt"
q2_13f = "https://www.sec.gov/Archives/edgar/data/1067983/000119312526352200/0001193125-26-352200.txt"
 
task = valyu.deepresearch.create(
query=(
"Compare Berkshire Hathaway's Q3 2026 and Q2 2026 Form 13F-HR filings. "
"Combine duplicate manager rows by CUSIP, list every new, increased, decreased, "
"and exited position by share count, and cross-check the largest moves against "
"recent SEC filings from those issuers."
),
mode="standard", # use "heavy" or "max" for multi-manager or multi-quarter deep dives
urls=[q3_13f, q2_13f],
search={"included_sources": ["valyu/valyu-sec-filings", "sec.gov"]},
research_strategy=(
"Verify exact combined share counts and dollar values from both 13F information "
"tables before pulling issuer 10-Q or 8-K context for the biggest position changes."
),
report_format=(
"Executive summary, quarter-over-quarter changes table by share count, "
"and cited notes on the top additions and trims."
),
deliverables=[
{
"type": "csv",
"description": "One row per changed Berkshire Hathaway position with Q2 and Q3 share counts and values.",
"columns": ["issuer", "cusip", "change_type", "q2_shares", "q3_shares", "share_delta", "source_url"],
}
],
)
 
result = valyu.deepresearch.wait(task.deepresearch_id)
print(result.output)
for dl in result.deliverables or []:
print(dl.type, dl.title, dl.url)

For a fuller report, DeepResearch also runs Workflows, in beta: saved research jobs with typed inputs. The curated SEC Filing Changes workflow, hf-filing-diff, compares two filings and returns a cited report plus an Excel change log. It is described for 10-Ks and 10-Qs, but it accepts two 13Fs:

from valyu import Valyu
 
valyu = Valyu() # reads VALYU_API_KEY
 
task = valyu.deepresearch.create(
workflow_id="hf-filing-diff", # the curated "SEC Filing Changes" workflow
workflow_params={
"company": "Berkshire Hathaway (BRK.B)",
"filings": "Q3 2026 13F-HR (September 30, 2026) vs Q2 2026 13F-HR (June 30, 2026)",
"sections": "Holdings: new, increased, decreased and exited positions by share count",
},
)
 
result = valyu.deepresearch.wait(task.deepresearch_id)
print(result.output) # cited report, most important changes first
for deliverable in result.deliverables or []:
print(deliverable.title, deliverable.url) # Excel change log

We ran it twice, and both times every figure we checked matched the tables above: one new position, four increases, six decreases, no exits and 19 unchanged, Bank of America down 27,533,107 shares and Lennar Class A up 12,922,695. The first run took about seven minutes. Its sourcing varied: in the first run most citations went to third-party write-ups of the filing, while in the second 65 of 67 went to EDGAR. Check the sources, and use Steps 1 to 4 for the numbers you publish.

Valyu's other hedge-fund workflows, such as Earnings Recap and Long Thesis Write-up, take a company as input and suit the next step, researching a name a fund has just bought. List them with valyu.workflows.list(vertical="hedge-funds").

Example: the morning after a 13F lands

The problem. Berkshire's 13F was accepted at 4:00 p.m. ET on November 16. By the next morning your investment committee wants to know what Buffett's team bought and sold, and what it means for names you own.

The decision. Step 2 gives you the list in seconds. The biggest share move was Bank of America, down 27,533,107 shares, about 5.7% of the June stake. Lennar Class A nearly doubled, and Bending Spoons was new. Apple's $9.95 billion rise in value was price, not buying, so leave it out of the "what they did" summary.

The next action. Run Step 3 on any name you hold to see who else is in it, note that the October Bending Spoons purchase is still to come, and set a reminder for the Q4 filing in February.

The outcome. A one-page summary with share counts, each tied to an accession number, ready before the open. This is an example of reading a disclosure, not investment advice.

What if the search goes wrong?

  • No results: name the manager and include "13F-HR", or ask a plain question such as "What does Bridgewater Associates own?"
  • Wrong quarter: add the quarter-end date, for example "March 31, 2026", and check the date in the result metadata.
  • List looks short: large portfolios and holder lists are capped, so count the rows and confirm against the filing for anything that must be complete.
  • A trade you expected is missing: check whether it happened after the quarter end. It will be in the next 13F.

FAQ

What is a 13F filing?

It is a quarterly report of an institutional manager's long positions in Section 13(f) securities, listing each security's name, class, CUSIP, shares and market value at quarter end.

Who has to file a 13F?

Any institutional investment manager with investment discretion over $100 million or more in Section 13(f) securities. That includes hedge funds, mutual fund companies, banks, insurers and pension funds that manage their own portfolios.

When are 13F filings due?

Within 45 days of each quarter end. If that day falls on a weekend or holiday, the filing is due the next business day. The SEC lists February 16, 2027 for the fourth quarter of 2026, May 17, 2027 for the first quarter of 2027 and August 16, 2027 for the second.

What were the 13F deadlines in 2026?

The report for the fourth quarter of 2025 was due February 17, 2026, because February 14 was a Saturday and February 16 a holiday. The 2026 quarterly reports were due May 15, August 14 and November 16, 2026; the last moved from Saturday, November 14. Berkshire filed its Q2 and Q3 reports on those deadline days.

When is Berkshire Hathaway's next 13F?

Its Q4 2026 report, covering holdings at December 31, 2026, is due by February 16, 2027. Berkshire filed its Q2 and Q3 reports on the deadline day.

What is the difference between 13F, 13D and 13G?

A 13F is a quarterly snapshot of a manager's whole portfolio. Schedules 13D and 13G are filed for a single company once an investor owns more than 5% of a class of its shares. A 13D is for investors who may seek to influence or control the company, and a 13G is the shorter form for passive and certain institutional investors.

Does a 13F show short positions or cash?

No. The SEC tells filers not to include short positions or net them against long ones. Cash, mutual fund shares and shares traded only on non-US exchanges are not reported either.

What is the 13F securities list?

The SEC's Official List of Section 13(f) Securities names the securities a manager reports on Form 13F. It is published shortly after each calendar quarter ends and mainly covers US exchange-traded stocks, closed-end fund shares and ETFs, plus certain convertible debt securities and equity options.

Can I see which funds hold a particular stock?

Yes. Ask "which 13F-HR filers hold" followed by the company name, as in Step 3. In our test it returned 25 managers, sorted by reported value.

Is there a free 13F API?

EDGAR publishes every 13F for free as XML, but you have to combine the rows and compare quarters yourself. Valyu does that in one query. New accounts get free credits every month, up to 2,000 with a work email, and each 13F search in this article cost $0.012.

How do I search 13F filings in ChatGPT or Claude?

Add Valyu as a custom connector with https://mcp.valyu.ai/mcp, sign in, and ask, for example, "Use Valyu to show what Berkshire Hathaway changed in its latest 13F." The chat apps guide has the setup steps. We tested the API calls in this article, not the chat interfaces.

Does a 13F show what a fund bought on a specific day?

No. It shows holdings on the last day of the quarter, so trades in between are netted and later trades wait for the next filing, as Berkshire's October purchase of Bending Spoons shows.

Build your own 13F workflow

Ask what a fund owns, what changed and who else holds a stock, then check the numbers that matter against EDGAR. Get an API key, see the finance use cases, or read how to compare institutional holdings across multiple filings and the best SEC filings APIs for AI agents.

Cover photograph: Good-investing / Wikimedia Commons. CC0. Cropped and resized for this cover.

Valyu Add

Join 12,000+ professionals and knowledge workers.

Valyu Add is a free weekly research briefing for builders, investors and operators. Every issue is sourced, cited and verified with Valyu DeepResearch.