Skip to main content
A sector dataset lists the recent SEC filings of the public companies in a client’s sector, next to your own notes on each company. You can build one in DuckDB from Dataville’s edgar export and a CSV file of your own. In this guide, you’ll run a DuckDB script that looks up each company by ticker and joins its filings from the last 12 months to your notes. The script saves the result as a CSV file for your report.

Before you start

You’ll need:

Build the dataset

Put both files from these steps in one folder, and run the script from that folder.
1

Download the company list

The company list is a CSV file with a ticker column and a segment column for your own notes. It has the three example companies from Profile a client’s competitors.

sector.csv

Download the company list with the example companies.
The file looks like this:
2

Download the script

The script is for the DuckDB command-line tool. It looks up each ticker in the edgar source, which returns the company’s CIK, the SEC’s number for a filer. It then matches each company to its filings in the edgar export by CIK, keeps the last 12 months, and saves the result as sector-filings.csv.

sector.sql

Download the DuckDB script.
3

Run the script

Set your API key, then run the script in the same terminal:
The script sends your key in a request header, so it never appears in a URL. It writes sector-filings.csv to the same folder and prints how many filings each company has. For the example companies on September 25, 2026, it printed:
If the script stops with “Set DATAVILLE_API_KEY to your Dataville API key first.”, set the key in the same terminal and run it again.Here are the Floor & Decor rows of sector-filings.csv, without the company_name and document_url columns:An 8-K’s items say what it reports. Item 2.02 is an earnings release, and 5.02 is a change of directors or officers. Item 5.07 is a shareholder vote, and 2.03 is a new financial obligation, such as a loan. Floor & Decor’s 8-K from June 25, 2026 lists items 1.01, 1.02, and 2.03. Those are a new material agreement, the end of another, and a new financial obligation.Each run makes one data lookup per ticker and one request to the export, which counts toward the export limit of 1,000 per day per account.Dataville adds a company’s filings to the export within five minutes of its first lookup. If a company you’ve added has no rows, run the script again after five minutes. If SEC EDGAR is unavailable, the lookups come from Dataville’s stored copy and may miss the newest filings, so run the script again later. See Response format to learn more about stale results.
4

Optional: Build a dataset for your own client

To build a dataset for a real client, replace the rows in sector.csv with the tickers of the companies in your client’s sector and your notes on each one. Then run the script again.

Next steps

To learn more about the export the script reads, or to compare revenue across competitors instead, see these pages.

Export datasets

Every format Dataville exports, and how to read Parquet without downloading.

Profile a client's competitors

Build a revenue comparison table from Claude and Data Studio.