<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: James Hsiao</title>
    <description>The latest articles on DEV Community by James Hsiao (@james-alphasmo).</description>
    <link>https://dev.to/james-alphasmo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4036186%2Fb96a04a5-2c72-448f-9705-357541e73370.png</url>
      <title>DEV Community: James Hsiao</title>
      <link>https://dev.to/james-alphasmo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/james-alphasmo"/>
    <language>en</language>
    <item>
      <title>We Spent Months Cleaning SEC EDGAR 13F Data So You Don't Have To</title>
      <dc:creator>James Hsiao</dc:creator>
      <pubDate>Fri, 24 Jul 2026 06:49:46 +0000</pubDate>
      <link>https://dev.to/james-alphasmo/we-spent-months-cleaning-sec-edgar-13f-data-so-you-dont-have-to-155k</link>
      <guid>https://dev.to/james-alphasmo/we-spent-months-cleaning-sec-edgar-13f-data-so-you-dont-have-to-155k</guid>
      <description>&lt;h2&gt;
  
  
  The data isn't the hard part. Cleaning it is.
&lt;/h2&gt;

&lt;p&gt;SEC EDGAR is public, free, and a mess. Every quarter, 13,000+ institutional investment managers file Form 13F, disclosing their U.S. equity holdings. In theory that's a beautiful dataset — every hedge fund, every pension fund, every bank, all in one place. In practice, the raw filings actively fight you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The same institution files under different names, sometimes even in the same quarter.&lt;/strong&gt; In our own database right now: &lt;code&gt;BlackRock, Inc.&lt;/code&gt; and &lt;code&gt;BlackRock Inc.&lt;/code&gt; are two distinct CIK registrations for what most people would call "one" institution. Multiply that across 13,000+ filers and you get a long tail of near-duplicate names that break any naive &lt;code&gt;GROUP BY institution_name&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CUSIPs don't map cleanly to tickers.&lt;/strong&gt; Foreign issuers frequently use CUSIP prefixes that don't resolve through the usual reference data — we ended up building a fallback resolution path (Yahoo Finance lookups plus manual validation rules) just to keep ticker coverage from silently degrading over time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quarters arrive gradually, not all at once.&lt;/strong&gt; The SEC gives managers up to 45 days after quarter-end to file. If you naively take "the latest quarter with any data" as your reporting period, you'll rank a barely-started quarter — where only a handful of small filers have reported so far — ahead of the real, complete prior quarter. We learned this the hard way: an unclamped "most recent quarter" query once let 115 newly-onboarded institutions' &lt;em&gt;entire&lt;/em&gt; existing portfolios get counted as "new inflow" with nothing to offset them, because a first-time filer has no prior-quarter row to diff against. That's the kind of bug that doesn't throw an error — it just quietly produces a chart that looks plausible and is wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amendments (13F-A) revise, replace, or partially restate earlier filings&lt;/strong&gt;, and the XML schema itself has shifted over the years, so parsing "just the latest 13F" isn't a fixed target.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is exotic — it's the normal cost of working with real-world government filing data. But it's exactly the kind of unglamorous plumbing that eats a weekend project before you get to the interesting part: actually asking questions like &lt;em&gt;"what is smart money buying right now?"&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So we built the CLI so you don't have to
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://alphasmo.com/13f" rel="noopener noreferrer"&gt;AlphaSMO&lt;/a&gt; is a free public API + CLI + MCP server sitting on top of all that cleaned-up 13F and Form 4 insider-trading data. No signup required to try it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx alphasmo stocks flows &lt;span class="nt"&gt;--limit&lt;/span&gt; 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That returns stocks ranked by net institutional buy/sell flow for the quarter — piped or scripted, it comes back as JSON automatically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ticker"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BRK-A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"issuer_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BERKSHIRE HATHAWAY INC-CL A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"net_value_change_usd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;255068024828&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"avg_weight_pct"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1.42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"institution_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1418&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The flagship signal is &lt;strong&gt;smart money convergence&lt;/strong&gt; — tickers where 13F institutions &lt;em&gt;and&lt;/em&gt; company insiders (Form 4 filers) are both buying at the same time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx alphasmo convergence &lt;span class="nt"&gt;--limit&lt;/span&gt; 5 &lt;span class="nt"&gt;--format&lt;/span&gt; table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────┬─────────────────────┬────────────┬───────────────┬───────────────┬────────────┐
│ ticker │ issuer              │ confidence │ unique buyers │ cluster alert │ last buy   │
├────────┼─────────────────────┼────────────┼───────────────┼───────────────┼────────────┤
│ KKR    │ KKR &amp;amp; CO INC        │ 80.48      │ 5             │ yes           │ 2026-03-04 │
├────────┼─────────────────────┼────────────┼───────────────┼───────────────┼────────────┤
│ ELV    │ ELEVANCE HEALTH INC │ 70         │ 2             │ no            │ 2026-07-17 │
├────────┼─────────────────────┼────────────┼───────────────┼───────────────┼────────────┤
│ IP     │ INTERNATIONAL PAPER │ 62.59      │ 3             │ yes           │ 2026-03-12 │
└────────┴─────────────────────┴────────────┴───────────────┴───────────────┴────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output format auto-detects context — a real table in your terminal, JSON when piped or spawned by a script or an AI agent. &lt;code&gt;--csv&lt;/code&gt; gets you a spreadsheet-ready export directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;alphasmo insider trades AAPL &lt;span class="nt"&gt;--csv&lt;/span&gt; | column &lt;span class="nt"&gt;-s&lt;/span&gt;, &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Built for AI agents too
&lt;/h2&gt;

&lt;p&gt;The same data ships as an &lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;MCP server&lt;/a&gt;, so Claude, ChatGPT, Cursor, or any MCP-compatible client can pull live 13F and insider data mid-conversation, without you writing a single integration line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add alphasmo &lt;span class="nt"&gt;--&lt;/span&gt; npx &lt;span class="nt"&gt;-y&lt;/span&gt; alphasmo@latest mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tools exposed: &lt;code&gt;search_institutions&lt;/code&gt;, &lt;code&gt;get_institution_profile&lt;/code&gt;, &lt;code&gt;get_institution_holdings&lt;/code&gt;, &lt;code&gt;get_stock_overview&lt;/code&gt;, &lt;code&gt;get_stock_flows&lt;/code&gt;, &lt;code&gt;get_insider_activity&lt;/code&gt;, &lt;code&gt;get_smart_money_convergence&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; alphasmo
alphasmo &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anonymous requests work out of the box at a lower rate limit; a free API key (&lt;a href="https://alphasmo.com/developer" rel="noopener noreferrer"&gt;alphasmo.com/developer&lt;/a&gt;) raises it. Full REST reference (curl-friendly, no CLI required) is at &lt;a href="https://alphasmo.com/developer/docs" rel="noopener noreferrer"&gt;alphasmo.com/developer/docs&lt;/a&gt;, and the same underlying data — institution profiles, holdings, quarter-over-quarter changes — is browsable directly at &lt;a href="https://alphasmo.com/13f" rel="noopener noreferrer"&gt;alphasmo.com/13f&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The raw data is public. We just did the annoying part first.&lt;/p&gt;

</description>
      <category>finance</category>
      <category>api</category>
      <category>cli</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
