Home / Guides / Getting started
Getting started

SEC data in Google Sheets and Excel with one formula (CSV export)

Pull 13F holdings, fails to deliver, insider trades or any other SecFeed list into Google Sheets with a small custom function, or download it as a CSV file for Excel.

Most people who read filings for a living work in a spreadsheet, not in code. Every SecFeed call that returns a list of records can come back as a CSV file instead of JSON: add format=csv to the URL. The rows are the same rows the JSON call returns, with the same size limit, and it counts as one call.

A CSV file for Excel

Paste a URL with your key into a terminal and save the file:

curl -H "Authorization: Bearer $SECFEED_KEY" -o gme-fails.csv \
  "https://secfeedapi.com/v1/fails-to-deliver?symbol=GME&startDate=2026-10-01&endDate=2026-10-31&size=4&format=csv"
settlementDate,symbol,description,quantity,price,value,sourceFile,sourceUrl
2026-10-27,GME,GAMESTOP CORP (HLDG CO) CL A,105836,23.9,2529480.4,cnsfails202610b.zip,https://www.sec.gov/files/data/fails-deliver-data/cnsfails202610b.zip
2026-10-26,GME,GAMESTOP CORP (HLDG CO) CL A,2310,24.82,57334.2,cnsfails202610b.zip,https://www.sec.gov/files/data/fails-deliver-data/cnsfails202610b.zip
2026-10-20,GME,GAMESTOP CORP (HLDG CO) CL A,3496,26.44,92434.24,cnsfails202610b.zip,https://www.sec.gov/files/data/fails-deliver-data/cnsfails202610b.zip
2026-10-19,GME,GAMESTOP CORP (HLDG CO) CL A,6167,26.81,165337.27,cnsfails202610b.zip,https://www.sec.gov/files/data/fails-deliver-data/cnsfails202610b.zip

Open the file in Excel or Numbers. Every row keeps its source: here the SEC file the fail was reported in.

How the columns are built:

  • Nested fields become dotted column names, for example issuer.cik.
  • A list of plain values is joined with ; in one cell. A list of objects is kept as compact JSON in one cell.
  • CUSIP columns are left out of CSV files unless your call looked up one CUSIP. CUSIPs belong to CUSIP Global Services; SecFeed shows them one lookup at a time, never as a file of them.

A live formula in Google Sheets

In your sheet open Extensions > Apps Script, paste this, and save:

/**
 * SecFeed data in a cell range. Example: =SECFEED("/v1/fails-to-deliver?symbol=GME&size=20")
 * @param {string} path An API path starting with /v1/
 * @customfunction
 */
function SECFEED(path) {
  var key = PropertiesService.getScriptProperties().getProperty('SECFEED_KEY');
  if (!key) throw new Error('Add SECFEED_KEY under Project Settings > Script properties');
  var url = 'https://secfeedapi.com' + path + (path.indexOf('?') > -1 ? '&' : '?') + 'format=csv';
  var cache = CacheService.getScriptCache(), hit = cache.get(url);
  if (hit) return Utilities.parseCsv(hit);
  var res = UrlFetchApp.fetch(url, { headers: { Authorization: 'Bearer ' + key }, muteHttpExceptions: true });
  if (res.getResponseCode() !== 200) throw new Error(res.getContentText());
  var text = res.getContentText();
  if (text.length < 95000) cache.put(url, text, 21600); // reuse for 6 hours so a recalculation is not a new call
  return Utilities.parseCsv(text);
}

Then, still in Apps Script, open Project Settings > Script properties and add SECFEED_KEY with your key. The key stays in the script's settings, not in a cell, so sharing the sheet does not share the key.

Now type a formula in any cell:

=SECFEED("/v1/form-13f/holdings?cik=1067983&period=06-30-2026&size=4")

The rows spill into the sheet. These are the first columns of that call (Berkshire Hathaway's 13F for the June 2026 quarter; value in dollars):

issuer,value,shares,period
AMERICAN EXPRESS CO,50419898471.0,149061045.0,06-30-2026
ALPHABET INC,23523689772.0,65824467.0,06-30-2026
APPLE INC,23341172315.0,80664820.0,06-30-2026
COCA COLA CO,22976876186.0,282722729.0,06-30-2026

The CSV output above was captured from the live API. The Apps Script function itself was not run inside Google Sheets for this guide: Google's custom functions can call UrlFetchApp, PropertiesService and CacheService, but test it once in your own sheet before you rely on it.

Things to know

  • Each fresh formula result is one call. Sheets recalculates custom functions when the sheet opens or the formula changes; the 6 hour cache in the script keeps repeat opens from using calls.
  • Size limits are the API's. Most list endpoints return up to 200 rows a call (some 500 or 1,000); use from and size for the next page.
  • Endpoints that are not lists (one company profile, one filing) return an error for format=csv; call them without it.
  • Not investment advice. The data is as filed with the SEC.

See the CSV export notes in the docs, or get a free API key to try it.

More getting started guides

Run this guide with your own key

Free key, no card needed. Every example on this page works on the free plan.

Get free API key →