The fy field in SEC XBRL data doesn't mean what you think
The SEC gives you every US public company's financials for free through data.sec.gov . No key, no signup. It's one of the best free datasets in finance, and it's easy to get wrong. Here's Apple's net income from the companyfacts endpoint, filtered the way most people would try first: fy == 2025 and form == "10-K" . start end value fp frame 2022-09-25 2023-09-30 96 , 995 , 000 , 000 FY CY 2023…
The Federal Communications Commission (SEC) provides completely free access to financial data for all publicly traded US companies via data.sec.gov. Despite being incredibly easy to use, many analysts and investors misuse its data, leading to incorrect conclusions. A simple example with Apple Inc.'s financial data illustrates the pitfalls.
When querying the SEC data for Apple's net income for the fiscal year 2025 using the endpoint 'companyfacts' with filters 'fy == 2025' and 'form == 10-K', three different data points are returned, all tagged with 'fy: 2025'. This is misleading because 'fy' represents the fiscal year of the filing, not the fiscal year of the financial figures.
Apple's 2025 10-K report includes three years of income statement data - 2023, 2024, and 2025 - and each figure for net income is tagged with 'fy: 2025'. If a programmer only takes the first matching entry, they would incorrectly report Apple's 2023 net income as 2025's.
The issue isn't just about tags changing over time, but also about the fact that fiscal years don't always align with calendar years. Apple's fiscal year 2023, for instance, ran for 371 days as it was a 53-week year, while Microsoft's fiscal year ends in June and NVIDIA's fiscal year ends in late January. Furthermore, a 10-K filing may contain both year-to-date and annual values under the same tag, leading to confusion.
One cannot simply rely on the 'fy' tag to accurately categorize financial data. Instead, analysts should focus on the period itself to determine the fiscal year of the reported figures. If a period has a start date, its duration can be used to classify it as annual or quarterly. Periods without a start date represent a balance-sheet snapshot and need to be classified based on the filing form - 10-K for annual reports and 10-Q for quarterly reports.
A robust method would be to key each value by its period end date and retain only the most recent filing for each metric. For each key metric, a priority list of tags should be established and values merged by period to prevent gaps when tags change. This approach ensures accurate and consistent representation of financial data.
For those who find it challenging to manage these complexities, Apify, a web automation platform, offers an SEC EDGAR Filings & Financials actor. By providing a list of tickers, this tool returns normalized annual and quarterly statements along with the most recent company filings.
Lastly, when interacting with the SEC data, it's crucial to include a User-Agent with a contact email in the request headers to avoid being blocked due to lack of identification. Additionally, adhering to a limit of 10 requests per second can help maintain a good rapport with the SEC's servers.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.