for income statement, balance sheet and cash flow numbers from 10-k and 10-q filings there are two routes and theyre good at different things.
xbrl uses the tagged data that comes with the filing. the secs companyfacts api returns every tagged fact for a company as json, theres bulk financial statement data sets too and edgartools or secxbrl wrap a lot of it. machine readable so no parsing errors.
it does get messy though. companies use their own extension tags so the same line item can have different names across companies. segment and dimensional facts sit right next to the consolidated totals and are easy to mix up and restated numbers show up in later filings so you have to pick the right period and filing.
parsing the actual document still helps for md&a, footnotes and risk factors, which mostly arent tagged as numbers.…