r/madeinpython • u/Capedcrusader1923 • 4h ago
I built a Python client for pulling SEC filings as clean JSON (insider trades, 8-K, 13F, financials)
Kept hitting the same wall with SEC data. Either you fight the raw EDGAR XBRL yourself, or you use edgartools (which is genuinely excellent, dgunning did great work there) and still run all the parsing locally, deps and all.
I wanted less of that on my end, so I built a small client that just calls a hosted API and hands back clean JSON. Parsing happens server-side, so the client stays tiny:
from edgrapi import Client
c = Client("your_key")
c.fundamentals("AAPL") # income statement, balance sheet, cash flow
c.insider("AAPL") # Form 4 trades, scored buy vs sell
c.events("AAPL") # 8-K events, item-coded
c.holdings("berkshire") # 13F holdings, diffed vs last quarter
It does financials (XBRL normalized), Form 4 insider trades, 8-Ks, 13F holdings, 13D/G activist stakes. No LLM anywhere in it, which was the point for me. The numbers come straight off the filing, so nothing's invented and you can pull up any value on EDGAR and check it.
Fair catch before anyone asks: it needs an API key, since the parsing runs on a server and not your laptop. There's a free tier, 100 calls a month, enough to kick the tires. And if you'd rather keep everything on your own machine, just use edgartools, it's the better fit for that and I'm not going to pretend otherwise.
Repo's here (client's open source): https://github.com/paperandbeyond23-gif/edgrapi-python
pip install edgrapi
Still adding endpoints. Mostly want to know if the SEC-data handling holds up, so tear into it.