Financial regulators publish company data as XBRL (XBRL), most of it now Inline XBRL inside XHTML reports. Three routes lead into a warehouse:
| Route | What you get | Notes |
|---|---|---|
| Parse the filing (lxml 3,063 , Arelle) | Facts with contexts and units | Full detail, most work |
| Arelle export to xBRL-JSON or xBRL-CSV | Tables of facts | Open Information Model formats |
| SEC companyfacts and frames APIs | JSON per company or period | Already aggregated; JSON, not XML |
The EDGAR APIs (data.sec.gov) serve US filings' facts as JSON under fair-access rules; this book does not call them. Either way, load facts as rows of entity, concept, period, unit, decimals and value, as xbrl_facts.py did in XBRL.