Tools: How to Track What Billionaire Investors Are Buying (Using SEC EDGAR Data)

Tools: How to Track What Billionaire Investors Are Buying (Using SEC EDGAR Data)

Source: Dev.to

What Are 13F Filings? ## The Problem with Raw EDGAR Data ## Searching for Companies ## Pulling 13F Holdings (The Good Stuff) ## Searching Filings by Type ## Tracking Insider Trades ## Building Something Useful: A Python Portfolio Tracker ## Who Uses This Data? ## Available Endpoints ## Why I Built This Warren Buffett just filed his latest 13F. Cathie Wood reshuffled her portfolio. A CEO quietly sold $50M worth of shares. All of this is public data — the SEC requires it. But actually getting to it programmatically? That's where most people give up. SEC EDGAR's website is a maze of SGML files, inconsistent formatting, and nested folders. I spent weeks parsing it and built an API so others don't have to. Here's what I learned and how to use it. Every institutional investment manager with over $100M in assets must file a 13F-HR with the SEC each quarter. This filing lists every equity position they hold — stock name, number of shares, and market value. This is how you find out what Berkshire Hathaway, Bridgewater, or Renaissance Technologies actually own. If you go to sec.gov/cgi-bin/browse-edgar and try to pull 13F data, you'll find: I ended up building a pipeline that ingests all of this into ClickHouse and exposes it through a clean REST API. First, find the company you want to track. Every company in EDGAR has a CIK (Central Index Key): Once you have the CIK, you can pull their latest 13F holdings. Here's Berkshire Hathaway's portfolio: Berkshire's top 3 positions: Occidental Petroleum ($10.9B), Chubb ($10.7B), and Kraft Heinz ($7.9B). 42 total holdings worth $66.8 billion. This is live data from their latest filing. You can search for specific filing types across any company: This returns recent 13F-HR filings with accession numbers. You can then use the accession number to get the full filing detail. SEC Form 4 filings disclose when company insiders (officers, directors, 10%+ shareholders) buy or sell shares. This is often a leading signal: This returns all recent insider transactions for Apple (CIK 320193) — who traded, what they traded, how many shares, and whether it was a buy or sell. Here's a practical example — a script that tracks quarterly changes in any fund's portfolio: The API is available on RapidAPI with a free tier. SEC EDGAR is one of the richest free data sources in finance, but the raw data format makes it painful to work with. Commercial alternatives like Bloomberg Terminal or FactSet cost thousands per month. I wanted something in between — structured, searchable, API-accessible SEC data for developers building financial tools. The backend uses ClickHouse for fast analytical queries across millions of filings. If you're building anything finance-related and need SEC data, give it a try. Happy to answer questions in the comments. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK: curl "https://edgar.dapdev.tech/companies/search?query=Tesla" Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: curl "https://edgar.dapdev.tech/companies/search?query=Tesla" COMMAND_BLOCK: curl "https://edgar.dapdev.tech/companies/search?query=Tesla" CODE_BLOCK: { "results": [ { "cik": 1318605, "name": "Tesla, Inc.", "ticker": "TSLA" } ], "total": 1, "query": "Tesla" } Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: { "results": [ { "cik": 1318605, "name": "Tesla, Inc.", "ticker": "TSLA" } ], "total": 1, "query": "Tesla" } CODE_BLOCK: { "results": [ { "cik": 1318605, "name": "Tesla, Inc.", "ticker": "TSLA" } ], "total": 1, "query": "Tesla" } COMMAND_BLOCK: curl "https://edgar.dapdev.tech/holdings/13f/1067983" Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: curl "https://edgar.dapdev.tech/holdings/13f/1067983" COMMAND_BLOCK: curl "https://edgar.dapdev.tech/holdings/13f/1067983" CODE_BLOCK: { "cik": 1067983, "company_name": "BERKSHIRE HATHAWAY INC", "report_date": "2026-02-17", "total_value_usd": 66858093626, "total_holdings": 42, "holdings": [ { "name_of_issuer": "OCCIDENTAL PETE CORP", "value_usd": 10894391643, "shares": 264941431, "share_type": "SH" }, { "name_of_issuer": "CHUBB LIMITED", "value_usd": 10689854998, "shares": 34249183, "share_type": "SH" }, { "name_of_issuer": "KRAFT HEINZ CO", "value_usd": 7896644337, "shares": 325634818, "share_type": "SH" } ] } Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: { "cik": 1067983, "company_name": "BERKSHIRE HATHAWAY INC", "report_date": "2026-02-17", "total_value_usd": 66858093626, "total_holdings": 42, "holdings": [ { "name_of_issuer": "OCCIDENTAL PETE CORP", "value_usd": 10894391643, "shares": 264941431, "share_type": "SH" }, { "name_of_issuer": "CHUBB LIMITED", "value_usd": 10689854998, "shares": 34249183, "share_type": "SH" }, { "name_of_issuer": "KRAFT HEINZ CO", "value_usd": 7896644337, "shares": 325634818, "share_type": "SH" } ] } CODE_BLOCK: { "cik": 1067983, "company_name": "BERKSHIRE HATHAWAY INC", "report_date": "2026-02-17", "total_value_usd": 66858093626, "total_holdings": 42, "holdings": [ { "name_of_issuer": "OCCIDENTAL PETE CORP", "value_usd": 10894391643, "shares": 264941431, "share_type": "SH" }, { "name_of_issuer": "CHUBB LIMITED", "value_usd": 10689854998, "shares": 34249183, "share_type": "SH" }, { "name_of_issuer": "KRAFT HEINZ CO", "value_usd": 7896644337, "shares": 325634818, "share_type": "SH" } ] } COMMAND_BLOCK: curl "https://edgar.dapdev.tech/filings/search?query=Berkshire+Hathaway&type=13F&limit=5" Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: curl "https://edgar.dapdev.tech/filings/search?query=Berkshire+Hathaway&type=13F&limit=5" COMMAND_BLOCK: curl "https://edgar.dapdev.tech/filings/search?query=Berkshire+Hathaway&type=13F&limit=5" COMMAND_BLOCK: curl "https://edgar.dapdev.tech/insider/0000320193" Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: curl "https://edgar.dapdev.tech/insider/0000320193" COMMAND_BLOCK: curl "https://edgar.dapdev.tech/insider/0000320193" COMMAND_BLOCK: import httpx API = "https://edgar.dapdev.tech" HEADERS = {"X-RapidAPI-Key": "your-key-here"} def get_portfolio(cik: int) -> dict: """Get latest 13F holdings for a fund.""" resp = httpx.get(f"{API}/holdings/13f/{cik}", headers=HEADERS) resp.raise_for_status() return resp.json() def top_positions(portfolio: dict, n: int = 10) -> None: """Print top N positions by value.""" holdings = sorted( portfolio["holdings"], key=lambda h: h["value_usd"], reverse=True ) total = portfolio["total_value_usd"] print(f"\n{portfolio['company_name']} - {portfolio['report_date']}") print(f"Total portfolio: ${total:,.0f}") print(f"{'Position':<30} {'Value':>15} {'% of Portfolio':>15}") print("-" * 62) for h in holdings[:n]: pct = (h["value_usd"] / total) * 100 print(f"{h['name_of_issuer']:<30} ${h['value_usd']:>14,.0f} {pct:>14.1f}%") # Berkshire Hathaway portfolio = get_portfolio(1067983) top_positions(portfolio) Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: import httpx API = "https://edgar.dapdev.tech" HEADERS = {"X-RapidAPI-Key": "your-key-here"} def get_portfolio(cik: int) -> dict: """Get latest 13F holdings for a fund.""" resp = httpx.get(f"{API}/holdings/13f/{cik}", headers=HEADERS) resp.raise_for_status() return resp.json() def top_positions(portfolio: dict, n: int = 10) -> None: """Print top N positions by value.""" holdings = sorted( portfolio["holdings"], key=lambda h: h["value_usd"], reverse=True ) total = portfolio["total_value_usd"] print(f"\n{portfolio['company_name']} - {portfolio['report_date']}") print(f"Total portfolio: ${total:,.0f}") print(f"{'Position':<30} {'Value':>15} {'% of Portfolio':>15}") print("-" * 62) for h in holdings[:n]: pct = (h["value_usd"] / total) * 100 print(f"{h['name_of_issuer']:<30} ${h['value_usd']:>14,.0f} {pct:>14.1f}%") # Berkshire Hathaway portfolio = get_portfolio(1067983) top_positions(portfolio) COMMAND_BLOCK: import httpx API = "https://edgar.dapdev.tech" HEADERS = {"X-RapidAPI-Key": "your-key-here"} def get_portfolio(cik: int) -> dict: """Get latest 13F holdings for a fund.""" resp = httpx.get(f"{API}/holdings/13f/{cik}", headers=HEADERS) resp.raise_for_status() return resp.json() def top_positions(portfolio: dict, n: int = 10) -> None: """Print top N positions by value.""" holdings = sorted( portfolio["holdings"], key=lambda h: h["value_usd"], reverse=True ) total = portfolio["total_value_usd"] print(f"\n{portfolio['company_name']} - {portfolio['report_date']}") print(f"Total portfolio: ${total:,.0f}") print(f"{'Position':<30} {'Value':>15} {'% of Portfolio':>15}") print("-" * 62) for h in holdings[:n]: pct = (h["value_usd"] / total) * 100 print(f"{h['name_of_issuer']:<30} ${h['value_usd']:>14,.0f} {pct:>14.1f}%") # Berkshire Hathaway portfolio = get_portfolio(1067983) top_positions(portfolio) CODE_BLOCK: BERKSHIRE HATHAWAY INC - 2026-02-17 Total portfolio: $66,858,093,626 Position Value % of Portfolio -------------------------------------------------------------- OCCIDENTAL PETE CORP $10,894,391,643 16.3% CHUBB LIMITED $10,689,854,998 16.0% KRAFT HEINZ CO $7,896,644,337 11.8% MOODYS CORP $6,448,842,688 9.6% ALPHABET INC $5,585,842,446 8.4% VISA INC $2,910,002,197 4.4% Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: BERKSHIRE HATHAWAY INC - 2026-02-17 Total portfolio: $66,858,093,626 Position Value % of Portfolio -------------------------------------------------------------- OCCIDENTAL PETE CORP $10,894,391,643 16.3% CHUBB LIMITED $10,689,854,998 16.0% KRAFT HEINZ CO $7,896,644,337 11.8% MOODYS CORP $6,448,842,688 9.6% ALPHABET INC $5,585,842,446 8.4% VISA INC $2,910,002,197 4.4% CODE_BLOCK: BERKSHIRE HATHAWAY INC - 2026-02-17 Total portfolio: $66,858,093,626 Position Value % of Portfolio -------------------------------------------------------------- OCCIDENTAL PETE CORP $10,894,391,643 16.3% CHUBB LIMITED $10,689,854,998 16.0% KRAFT HEINZ CO $7,896,644,337 11.8% MOODYS CORP $6,448,842,688 9.6% ALPHABET INC $5,585,842,446 8.4% VISA INC $2,910,002,197 4.4% - Filings are in XML/SGML with inconsistent schemas across years - No unified search across companies and filing types - Holdings are buried in informationtable.xml files - No simple way to compare quarter-over-quarter changes - Rate limits that will throttle you after a few requests - Retail investors tracking what the "smart money" is doing - Quant funds using institutional holdings as features in their models - Financial journalists covering portfolio changes - Compliance teams monitoring insider activity - Fintech apps building portfolio analytics dashboards