
I Was Tired of Parsing XBRL, So I Built a SEC EDGAR API
If you've ever tried to pull financial data from the SEC's EDGAR system, you probably know where this is going. I wanted to build a stock screener. Simple idea — just show me revenue trends for a few companies. Should take an afternoon, right? Nope. First you need a company's CIK number (Apple is 0000320193 — don't ask me why it's zero-padded to 10 digits). Then you download their XBRL filings, which are nested XML with namespaces like us-gaap:RevenueFromContractWithCustomerExcludingAssessedTax . Then you realize different companies use slightly different tags for the same concept. Then you start questioning your life choices. I spent way too long on this, so I wrapped the whole thing in a REST API. Pass a ticker, get JSON back. Done. Show me the data Company info: GET /v1/company/AAPL { "cik" : "320193" , "ticker" : "AAPL" , "name" : "Apple Inc." , "sic" : "3571" , "sic_description" : "Electronic Computers" , "fiscal_year_end" : "0926" , "state" : "CA" } No CIK lookup. Just the ticker
Continue reading on Dev.to Tutorial
Opens in a new tab

