sec-financials
Pull a US-listed company's real as-reported financials — revenue, earnings, cash flow, capex, debt, share count — straight from the SEC's free XBRL API. Use when a valuation, screen or thesis would ot
SKILL.mdskills/sec-financials/SKILL.md
GitHubSEC financials — as-reported, free, no key
The tool skill under intrinsic-value. It exists so a valuation is never
built on a number someone remembered.
A summary site gives you a number with no period, no basis and no filing behind it. Restatements, "adjusted" figures and stale comparatives all look identical once they are prose — and in a valuation every downstream multiple inherits the error silently.
python3 sec_financials.py CTVA --years 7
python3 sec_financials.py CTVA --ttm # trailing twelve months
python3 sec_financials.py CTVA --json
python3 sec_financials.py CTVA --concept AmortizationOfIntangibleAssets
Source is data.sec.gov/api/xbrl/companyfacts. No key, no account. The only
requirement is a User-Agent carrying a real contact address — SEC blocks
anonymous clients outright rather than rate-limiting them. Set it once:
export SEC_USER_AGENT="Your Name you@example.com". Responses are cached
for a day under ~/.cache/sec-financials because a 30-name screen otherwise
pulls a couple of hundred MB.
The five traps, each of which returns a plausible wrong number
fyis the FILING's year, not the data's period. The big one. A 10-K carries two prior years as comparatives and stamps them all with the filing'sfy. Corteva's FY2019 D&A ($1,599M) appears underfy=2019,fy=2020andfy=2021— key onfyand you get the same stale year three times, which reads as a beautifully flat trend rather than as an error. Key on the periodenddate.Issuers switch tags mid-history. Corteva reported capex under
PaymentsToAcquirePropertyPlantAndEquipmentthrough FY2021, thenPaymentsToAcquireProductiveAssets. First-tag-wins across the whole history silently truncates the series to blanks. Candidates are tried per period in priority order — they are alternates, never components, so never sum them.Annual and Q4 facts share a tag. Flows are filtered to a 300–400 day
start→endspan, or you book a quarter as a year.Not every line is tagged. Corteva never tags
GrossProfitorOperatingIncomeLoss. Derive (revenue − COGS), label itDERIVED, or go read the statement — never leave a silent blank where a number is expected.companyfacts can miss a whole filing for months. One issuer's companyfacts stopped at its Q1 10-Q while the Q2 10-Q had been filed for months, so
--ttmand "latest quarter" were one quarter stale with no error. The same quarter WAS in the frames API (/api/xbrl/frames/us-gaap/GrossProfit/USD/CY2026Q2.json) and in the filing's own XBRL. Before quoting "latest", compare the newestaccnin companyfacts against the submissions list (/submissions/CIK##########.json).
Rules
- Pre-spin history is a different company. Corteva's FY2018 D&A is $2,790M against $1,599M in FY2019 — that is DowDuPont, not Corteva. Same CIK, different entity. Check the separation date before charting a long series. The same applies to any carve-out: GE Vernova and Constellation both carry parent-era years that belong to the former parent, not to the business you are valuing.
- Split
d_and_abefore using it.DepreciationandAmortizationOfIntangibleAssetsare separate tags meaning opposite things for valuation — seeintrinsic-value, where the whole adjustment turns on it. --ttmneeds a prior-year year-to-date figure to subtract and returnsn/awith the reason rather than guessing. A TTM that double-counts a seasonal half-year is worse than no TTM: some businesses earn the whole year in H1.- Foreign private issuers file 20-F/40-F with
ifrs-fulltags, notus-gaap. Handled, but the line names differ and coverage is thinner. - Segment data is NOT in companyfacts. Segments are dimensional XBRL and this endpoint is flat — take segment splits from the earnings 8-K or the 10-K.
Related
Feeds intrinsic-value and buffett-checklist. For live quotes and
where a name sits in its own cycle, that is price-history.