SEC EDGAR API with Google Sheets: Auto-Refresh a 13F Holdings Tracker
Berkshire Hathaway's third-quarter 13F landed on November 16, 2026, with 30 positions worth $304.2 billion, one new holding, four increases and six cuts. A Google Sheet can show you all of that the Monday after, sorted and color-coded, without you opening EDGAR.
A 13F holdings tracker in Google Sheets needs one Apps Script: list the funds you follow in a tab, call a 13F holdings API for each, and write every position with its quarter-over-quarter change into its own tab. A weekly time-driven trigger keeps it current, and an optional email tells you when a fund files a new quarter. This guide gives you the full script, tested against live data.
How do you track hedge fund 13F holdings in Google Sheets?
Add an Apps Script to your sheet that calls a 13F API for each fund you list, then writes the positions into one tab per fund. Each row shows the ticker, shares, value, percent of the portfolio and whether the position is new, added, reduced or unchanged since last quarter, with exits listed below. A Monday trigger refreshes it, so the sheet stays current without you touching it.
You type fund names in a "Funds" tab and the script does the rest. The data comes from Edgrapi's /v1/holdings/{fund} endpoint, which is my own API, so weigh that accordingly, but the sheet side works with any 13F source that returns positions as JSON. The endpoint takes a fund nickname like berkshire or burry, a CIK, or a ticker when the manager is itself public.
It parses the 13F information table, adds up positions a fund splits across sub-managers and diffs each one against the prior quarter, which is the tedious part if you try it with two downloaded tables and a VLOOKUP.
If you want the background on 13F itself first, see what a 13F filing is.
What is a 13F filing and when does it come out?
Form 13F is the quarterly report of stock holdings that large investment managers file with the SEC. Any manager with discretion over $100 million or more in Section 13(f) securities has to file one, within 45 days after each calendar quarter ends. So a 13F shows what a fund owned on the last day of the quarter, published up to six weeks later.
The rules come from the SEC's Form 13F FAQ. The $100 million threshold counts only securities on the SEC's official list of Section 13(f) securities, mostly US-listed stocks, ETFs and listed options.
So a 13F is a snapshot of where a fund stood up to six weeks ago, not what it's doing today.
For 2026 and early 2027 the deadlines fall like this:
| Quarter | Quarter ended | 13F due |
|---|---|---|
| Q3 2026 | September 30, 2026 | November 16, 2026 |
| Q4 2026 | December 31, 2026 | February 16, 2027 |
Plenty of funds file right at the deadline. Berkshire and Pershing Square both filed their Q3 2026 13Fs on November 16, the due date, so a weekly refresh catches a filing within a week of it landing.
What do you need before you start?
You need a Google account, a Google Sheet, and an Edgrapi API key. Apps Script is built into Sheets, so there's nothing to install. The free Edgrapi tier gives you 50 credits, and each fund refresh costs 5, so you can test 10 refreshes before paying anything. The script stores your key in Script Properties, not in a cell.
Set it up like this:
- Create a new Google Sheet and rename the first tab to
Funds. - Put a header in A1 (anything, like "Fund") and your funds from A2 down:
berkshire,pershing-square,burry, or any CIK. - Open Extensions > Apps Script.
- In Project Settings > Script properties, add
EDGRAPI_KEYwith your key from the Edgrapi dashboard. - Optionally add
NOTIFY_EMAILwith the address that should hear about new filings.
Keeping the key in Script Properties matters. People you share the sheet with as viewers or commenters can read every cell but not the script, though anyone with edit access can open the script and its properties, so be careful who gets edit rights.
The full Apps Script for a 13F holdings tracker
The script has four parts: a menu, a function that calls the holdings API for one fund, a function that writes that fund's tab with color-coded changes, and a refresh function that loops over your fund list and builds a summary tab. A fifth function installs the weekly trigger. Paste it into Code.gs, save, and reload the sheet to see the menu.
Here's the whole thing:
// 13F holdings tracker for Google Sheets, powered by the Edgrapi API.
// Setup: Project Settings > Script properties > EDGRAPI_KEY = your key.
// List fund names or CIKs in column A of a tab called "Funds" (from A2 down).
var API = "https://api.edgrapi.com/v1/holdings/";
var COLORS = { "new": "#d9ead3", "added": "#eef6e8", "reduced": "#fbe9e7", "exited": "#f4c7c3" };
function onOpen() {
SpreadsheetApp.getUi().createMenu("13F tracker")
.addItem("Refresh all funds", "refreshAll")
.addItem("Refresh every Monday", "installWeeklyTrigger")
.addToUi();
}
function fetchHoldings(fund) {
var key = PropertiesService.getScriptProperties().getProperty("EDGRAPI_KEY");
var res = UrlFetchApp.fetch(API + encodeURIComponent(fund) + "?limit=200", {
headers: { "X-API-Key": key }, muteHttpExceptions: true
});
var data = JSON.parse(res.getContentText());
if (res.getResponseCode() !== 200) {
throw new Error(fund + ": " + (data.detail || data.error || res.getResponseCode()));
}
return data;
}
function writeFund(ss, fund, d) {
var sh = ss.getSheetByName(fund) || ss.insertSheet(fund);
sh.clear();
sh.getRange(1, 1, 3, 2).setValues([
["Manager", d.manager],
["Quarter", d.period_label + " (filed " + d.filed + ")"],
["Book value", d.total_value]
]);
sh.getRange(3, 2).setNumberFormat("$#,##0");
var header = ["Ticker", "Issuer", "Put/Call", "Shares", "Value", "% of book", "Change", "Share change", "Change %"];
var rows = d.positions.map(function (p) {
return [p.ticker || "", p.issuer, p.put_call || "", p.shares, p.value, p.pct_portfolio / 100,
p.change.status, p.change.delta_shares, p.change.delta_pct == null ? "" : p.change.delta_pct / 100];
});
(d.exits || []).forEach(function (x) {
rows.push([x.ticker || "", x.issuer, x.put_call || "", 0, 0, 0, "exited", -x.prior_shares, -1]);
});
sh.getRange(5, 1, 1, header.length).setValues([header]).setFontWeight("bold");
if (rows.length) {
sh.getRange(6, 1, rows.length, header.length).setValues(rows);
sh.getRange(6, 4, rows.length, 2).setNumberFormat("#,##0");
sh.getRange(6, 6, rows.length, 1).setNumberFormat("0.00%");
sh.getRange(6, 8, rows.length, 1).setNumberFormat("#,##0");
sh.getRange(6, 9, rows.length, 1).setNumberFormat("0.0%");
sh.getRange(6, 1, rows.length, header.length).setBackgrounds(rows.map(function (r) {
var c = COLORS[r[6]] || null;
return header.map(function () { return c; });
}));
}
sh.setFrozenRows(5);
sh.autoResizeColumns(1, header.length);
}
function refreshAll() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var props = PropertiesService.getScriptProperties();
var funds = ss.getSheetByName("Funds").getRange("A2:A").getValues()
.map(function (r) { return String(r[0]).trim(); }).filter(String);
var summary = [["Fund", "Manager", "Quarter", "Filed", "Positions", "New", "Added", "Reduced", "Exited", "Note"]];
var newFilings = [];
funds.forEach(function (fund) {
try {
var d = fetchHoldings(fund);
writeFund(ss, fund, d);
var c = d.changes || {};
summary.push([fund, d.manager, d.period_label, d.filed, d.positions_count,
c["new"], c.added, c.reduced, c.exited, d.reported_via ? d.reported_via.note : ""]);
if (props.getProperty("last_" + fund) !== d.period) {
if (props.getProperty("last_" + fund)) newFilings.push(d.manager + ": " + d.period_label);
props.setProperty("last_" + fund, d.period);
}
} catch (e) {
summary.push([fund, "ERROR", String(e.message), "", "", "", "", "", "", ""]);
}
});
var sh = ss.getSheetByName("Changes") || ss.insertSheet("Changes", 1);
sh.clear();
sh.getRange(1, 1, summary.length, summary[0].length).setValues(summary);
sh.getRange(1, 1, 1, summary[0].length).setFontWeight("bold");
var to = props.getProperty("NOTIFY_EMAIL");
if (to && newFilings.length) {
MailApp.sendEmail(to, "New 13F filings", newFilings.join("\n") + "\n\n" + ss.getUrl());
}
}
function installWeeklyTrigger() {
ScriptApp.getProjectTriggers().forEach(function (t) {
if (t.getHandlerFunction() === "refreshAll") ScriptApp.deleteTrigger(t);
});
ScriptApp.newTrigger("refreshAll").timeBased()
.onWeekDay(ScriptApp.WeekDay.MONDAY).atHour(7).create();
}
The first time you run it, Google asks you to authorize the script, because it fetches URLs, edits the sheet and can send email. That's normal for any Apps Script that calls an outside API.
muteHttpExceptions: true lets the script read the API's error message instead of crashing. A typo in a fund name lands in the Changes tab as an ERROR row, and the other funds still refresh.
The script writes each tab in a handful of range calls rather than cell by cell. Apps Script is slow per call, and Berkshire's 30 rows or a big fund's 200 would crawl if you wrote them one at a time.
The last_ properties remember each fund's latest quarter. The email only fires when that quarter changes, so a weekly run with nothing new stays quiet.
How did I test the 13F tracker?
I ran the exact script above in Node.js against the live Edgrapi API on November 27, 2026, with Google's Sheets, Properties, Mail and trigger services replaced by small stand-ins that record what the script writes. Three funds refreshed, a misspelled fund produced an ERROR row without stopping the run, and the email fired only when I faked a new quarter.
The API calls were real. Only the Google side was simulated, so I haven't watched it run inside an actual Google Sheet for this article.
Here's what the run produced in the Changes tab:
| Fund | Manager | Quarter | Positions | New | Added | Reduced | Exited |
|---|---|---|---|---|---|---|---|
| berkshire | Berkshire Hathaway Inc | Q3 2026 | 30 | 1 | 4 | 6 | 0 |
| pershing-square | Pershing Square Inc. | Q3 2026 | 16 | 2 | 1 | 8 | 1 |
| burry | Scion Asset Management | Q3 2025 | 8 | 7 | 1 | 0 | 14 |
Running the weekly-trigger installer twice left exactly one trigger, because the function deletes any existing refreshAll trigger first. Without that, every click would add another Monday run.
curl -H "X-API-Key: edgr_your_key" "https://api.edgrapi.com/v1/insider/AAPL"Get a free API key 50 free credits, no card.What does the Berkshire tab show?
Berkshire's Q3 2026 tab lists 30 positions worth $304.2 billion, with Apple at 24.95% of the portfolio and the top 10 holdings making up 89.4%. The changes stand out in color: Lennar was nearly doubled (up 98.6% in shares), Capital One was cut 61.7%, VeriSign 34.1% and Bank of America 5.7%, while Apple, American Express and Coca-Cola didn't move.
In a 30-row list the color does the work, since the six reduced rows and five new or added ones are what you'd go looking for anyway.
The biggest positions after Apple were American Express at 15.16%, Coca-Cola at 11.32%, Alphabet at 8.91% and Bank of America at 8.16%.
One new line shows up with no ticker: Bending Spoons SpA. The API resolves tickers from CUSIPs on a best-effort basis, and a blank ticker means it couldn't match one to a US listing, so the issuer name and CUSIP are what to trust there.
For a deeper look at following individual funds, the superinvestor portfolio tracker post covers Buffett, Burry and others in more detail.
Why did Pershing Square's 13F move to a different filer?
Pershing Square Capital Management stopped filing a full 13F after Q1 2026 and filed a 13F-NT notice instead. Its notice says its holdings are now included in the report of its public parent company, Pershing Square Inc., which files its own 13F under a different CIK. A tracker that only follows the original CIK would show Q1 2026 forever.
I hit this while testing. The original filer's last full 13F-HR covers March 31, 2026, and it filed 13F-NT notices for the June and September quarters.
A 13F-NT has a cover page and nothing else. It names the other manager whose 13F includes these holdings, which is where you have to look next.
Edgrapi now follows that pointer automatically: when a fund's newest filing is a 13F-NT naming one other manager, the holdings come from that manager and the response says so in a reported_via note. The script puts that note in the Changes tab, so you can see why the manager name changed.
Pershing's Q3 2026 tab showed a new position in Intercontinental Exchange, a 34.5% cut to Microsoft, and Hertz in the exits.
So keep an eye on the filed date on each tab, because if it stops moving after a deadline passes, something changed with the filer.
How should you read options and exits in a 13F?
Treat any row with PUT or CALL in the Put/Call column as an option position, not a stock holding. A 13F reports an option's value as the notional value of the shares it controls, so a big put can show up as more than 100% of the stock portfolio. Exits are positions held last quarter and gone this quarter, and an exit can be the option leg while the stock stays.
Scion Asset Management's last 13F, for Q3 2025, is the extreme case. Its stock book was about $68 million, and its Palantir put had a notional value of $912 million, which the tab shows as 1,338.61% of the book.
That's correct, but only if you read the Put/Call column, because without it the sheet looks like Scion bet 13 times its portfolio on Palantir shares.
The same filing had 14 exits, including UnitedHealth and Regeneron twice each: once as a call option and once as stock. The Put/Call column tells them apart.
Scion hasn't filed a 13F holdings report since that one, so its tab will keep showing Q3 2025 until it does, which is worth knowing before you read anything into its positions.
How often should the tracker refresh, and what does it cost?
Weekly is enough for 13F data, because each fund files once a quarter. Each fund refresh is one API call at 5 credits, and failed calls cost nothing. Tracking 10 funds every Monday uses about 217 credits a month, which fits Edgrapi's $3 Lite plan with room to spare. Refreshing daily during filing season costs more but catches filings a few days sooner.
The math, assuming 4.33 weeks a month:
| Funds | Weekly refresh | Daily refresh |
|---|---|---|
| 3 funds | 65 credits | 450 credits |
| 10 funds | 217 credits | 1,500 credits |
| 25 funds | 541 credits | 3,750 credits |
All of these fit in a Lite plan ($3 for 1,500 credits) or a Starter plan ($10 for 10,000). The full cost table per endpoint is on the pricing page.
Google has its own limits, per its Apps Script quotas page. A free Gmail account gets 20,000 URL fetches a day, 90 minutes of trigger runtime a day, and 6 minutes per script run. A 25-fund refresh is 25 fetches, so you won't get near any of them.
Time-driven triggers also aren't exact. Google's trigger docs say a 7am trigger runs sometime between 7 and 8, then keeps that time.
What can't a 13F tracker tell you?
A 13F only shows long positions in US-listed securities at the quarter's end, published up to 45 days later. It doesn't show short positions, cash, bonds outside the 13(f) list, or anything a fund bought and sold between quarter-ends. So treat it as a lagged map of a fund's biggest bets, not a copy-trading signal.
A few specific gaps:
- The lag. Berkshire's Q3 2026 filing describes September 30. By November 16, positions may have changed again.
- Confidential treatment. Managers can ask the SEC to delay disclosing some positions, so a quarter can be incomplete and amended later.
- Missing tickers. A blank ticker means the CUSIP didn't match a US listing. Use the issuer name.
- Funds that stop filing. Scion's last 13F is Q3 2025. The tracker keeps showing it, so check the Filed column.
If you need faster signals for the same companies, pair this with Form 4 insider trades or Schedule 13D stakes, which are filed within days. The 13F API guide covers the endpoint itself in more depth.
Start with three funds and a Monday refresh
Make the Funds tab with three managers you actually follow, paste the script, add your key, and run Refresh all funds once from the menu. Check that each tab's Filed date matches what you expect, then click Refresh every Monday. Add NOTIFY_EMAIL if you want a heads-up when the next quarter lands.
The free tier covers 10 refreshes, which is enough to see it work with three funds, and you can get a key here.
Frequently asked questions
How do I import 13F data into Google Sheets?
Use an Apps Script with UrlFetchApp to call a 13F holdings API, parse the JSON, and write the positions with setValues. Edgrapi's /v1/holdings endpoint returns each fund's latest 13F with quarter-over-quarter changes. One call per fund costs 5 credits, and a weekly trigger keeps the sheet updated without you running anything by hand.
How often are 13F filings updated?
Every quarter. Managers with $100 million or more in 13(f) securities file within 45 days after each calendar quarter ends, so Q3 2026 filings were due November 16, 2026, and Q4 2026 filings are due February 16, 2027. Between deadlines, a fund's 13F doesn't change unless it files an amendment.
Can Google Sheets update 13F holdings automatically?
Yes. An installable time-driven trigger in Apps Script can run your refresh function every Monday or every day, even when the sheet is closed. It runs under the account of whoever created it, and the run time can drift within the hour you chose.
What does a 13F-NT filing mean?
A 13F-NT is a notice that a manager's holdings are reported in another manager's 13F, so it has a cover page and no holdings table. Pershing Square Capital Management switched to 13F-NT filings in 2026 because its holdings moved into the 13F of its public parent, Pershing Square Inc.
Why does a 13F show a position above 100% of the portfolio?
It's almost always an option. A 13F reports puts and calls at the notional value of the shares they control, not what the fund paid. Scion's Q3 2025 Palantir put had $912 million of notional value against a $68 million stock book, so it shows as 1,338.61%.
Is 13F data free?
The filings are free on SEC EDGAR, but you have to parse the XML information table and diff quarters yourself. An API does that for you. Edgrapi's free tier includes 50 credits, enough for 10 fund refreshes, and paid plans start at $3 a month.