Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sec-edgar-api

Read SEC EDGAR filings and XBRL financials by ticker. No API key, no registration.

npx sec-edgar filings AAPL --forms 10-K
npx sec-edgar financials NVDA revenue --limit 8
2025-10-31  10-K     10-K
  https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm

Why this exists

The SEC publishes excellent APIs and asks nothing but that you identify yourself. Two things make them awkward to use directly, and this library fixes both:

  • Everything is keyed by CIK, a ten-digit identifier nobody remembers. This resolves tickers against the SEC's own list — 10,000+ companies — so AAPL works.
  • Financial figures are XBRL tags like NetIncomeLoss and CashAndCashEquivalentsAtCarryingValue. This maps plain names onto the ones people actually ask for, and still accepts a raw tag when you know the one you want.

It also spaces requests out, because the SEC asks for no more than ten a second.

Install

npm install sec-edgar-api

Node 20 or newer. No dependencies.

Use

import { filings, financials, options } from "sec-edgar-api";

// The SEC asks clients to identify themselves. Set a contact before doing anything real.
options.userAgent = "my-research-tool/1.0 (me@example.com)";

const annual = await filings("AAPL", { forms: ["10-K"], since: "2020-01-01" });
// → [{ form: "10-K", filedAt: "2025-10-31", documentUrl: "https://www.sec.gov/Archives/...", ... }]

const revenue = await financials("NVDA", "revenue", { limit: 8 });
// → [{ fiscalYear: 2026, fiscalPeriod: "FY", value: 215938000000, unit: "USD", form: "10-K", ... }]

filings(tickerOrCik, { forms, since, limit })

Newest first. Every row carries the company (name, tickers, industry, state of incorporation), the filing (form, filedAt, reportDate, accession number, whether it has XBRL) and documentUrl — a direct link to the document itself, so the next step in a pipeline needs no path arithmetic.

financials(tickerOrCik, concept, { limit, taxonomy })

One figure across every period a company reported it, newest first.

Shorthands: revenue · netIncome · assets · liabilities · equity · cash · eps · operatingIncome · researchAndDevelopment · sharesOutstanding

A figure a company never reported returns [] rather than throwing — that distinction matters in financial data, so it is preserved rather than flattened to a zero.

resolveCik(tickerOrCik)

Returns the padded CIK, or null if it is neither a known ticker nor a CIK.

Command line

sec-edgar filings <ticker|cik> [--forms 10-K,10-Q] [--since 2024-01-01] [--limit 20] [--json]
sec-edgar financials <ticker|cik> <figure> [--limit 8] [--json]

Set a contact with SEC_EDGAR_UA:

SEC_EDGAR_UA="my-tool/1.0 (you@example.com)" npx sec-edgar filings TSLA

Notes

  • Requests are spaced to stay well under the SEC's ten-per-second guidance.
  • The ticker list is fetched once and reused.
  • US registrants only — EDGAR covers companies that file with the SEC.
  • XBRL figures exist from around 2009, and only for companies that tag them.
  • Revenues is one of several revenue tags in US GAAP. A company using another will return nothing for the revenue shorthand; pass the exact tag when that matters.

Hosted version

The same code runs as a hosted, monitored Actor on Apify, with scheduling, storage and CSV export: SEC EDGAR Filings & Financials.

Not affiliated

Independent library. Not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Data comes from the SEC's publicly documented EDGAR APIs.

Licence

MIT

About

Read SEC EDGAR filings and XBRL financials by ticker. No API key. Node client for the SEC's public API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages