- Table of Contents
- Setup
- CIKs
- Indexes: Quarterly, and Daily
- Company Submissions
- Filing Submissions and Forms
- Company Facts
- SPACs
- Portals
- Reg-A and Reg-A+
- Reg-CF
To install dependencies, run:
bun install
Create a .env.local
file in the root of the project and add the following:
SEC_RAW_DATA_FOLDER=<path-to-raw-data>
SEC_DB_FOLDER=<path-to-db-folder>
SEC_DB_NAME=edgar
The CIK (Central Index Key) is a unique identifier assigned to companies and individuals by the SEC.
To facilitate data retrieval, maintaining a full list of CIK numbers and their associated names is beneficial. Even if only a subset of filings is required, having a reference list is useful. The SEC provides an official CIK lookup file.
You can retrieve and process this file using the following:
- Task: FetchAllCikNamesTask.ts
- Command: BootstrapAllCikNames.ts
./src/sec.ts bootstrap-all-cik-names
The SEC publishes txt
index files listing all submitted filings. Each entry includes:
- Company Name
- CIK Number
- Filing Form Type
- Submission Date & Time
- Task: FetchQuarterlyIndexRangeTask.ts
- Command: BootstrapCikLastUpdate.ts
We utilize these indexes to generate a "dirty" CIK list, indicating which filings need to be downloaded. While an optimized approach would selectively fetch only required filings, our method ensures data integrity by marking CIKs for processing. This helps recover missing files due to: process failures, skipped days, and other errors.
./src/sec.ts bootstrap-quarterly-index <year to start>
The SEC provides an API to fetch company submission data, including metadata about a company's filings. However, it does not include the actual filing contents.
- Accession Number – Unique filing identifier
- Filing Date – Submission date
- Form – Filing type
- Filename – Associated document
- Description – Filing summary
- Document Type – Type of content submitted
- Size – File size (bytes)
- Items – Number of included items
- Task: FetchSubmissionsTask.ts
- Command: CompanySubmissions.ts
./src/sec.ts company-submissions 1018724
The SEC API allows retrieval of individual filing submissions, containing the actual filing data. Each form type has unique processing requirements.
- Form D – Private capital fundraising
- Form 10 – Public capital fundraising
- Form 10-K – Annual financial report
- Form 10-Q – Quarterly financial report
- Form 8-K – Material event disclosures
- Form 6-K – Foreign company disclosures
- Form 4 – Insider trading disclosures
The SEC API provides Company Facts, delivering structured and normalized financial and operational data for a specific company.
- Task: FetchCompanyFactsTask.ts
- Command: CompanyFacts.ts
./src/sec.ts company-facts 1018724
Special Purpose Acquisition Companies (SPACs) are formed to raise capital from public investors with the intent to acquire a private company and take it public.
Reg-A and Reg-CF Portals facilitate investment in private companies by public investors through SEC-regulated platforms.
Regulation A (Reg-A) and Regulation A+ (Reg-A+) filings enable private companies to raise funds from public investors via SEC-registered portals.
Regulation Crowdfunding (Reg-CF) allows private companies to raise smaller amounts of capital from public investors compared to Reg-A or Reg-A+.