SEC Form 4 Insider Trades to JSON
Pricing
from $0.01 / 1,000 results
SEC Form 4 Insider Trades to JSON
Fetch recent SEC Form 4 insider filings for any US ticker and get clean JSON: insider, role, transaction code, shares, price, dollar value, holdings after, plus buy-vs-sell summary. Public EDGAR data, built for AI agents and research.
Pricing
from $0.01 / 1,000 results
Rating
0.0
(0)
Developer
Trevor Charles
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
17 hours ago
Last modified
Share
SEC Form 4 Insider Trades — parsed to clean JSON
Turns raw SEC Form 4 (insider transaction) XML into plain JSON, and rolls a batch of filings up into per-ticker buy/sell totals. Zero dependencies, Node built-ins only (Node 18+).
Usage
const { parseForm4Xml, summarizeByTicker } = require('./src/core');const { fetchRecentForm4 } = require('./src/fetch');const xmls = await fetchRecentForm4('AAPL', { userAgent: 'Your Name you@example.com', limit: 10 });const filings = xmls.map(parseForm4Xml);console.log(summarizeByTicker(filings));
Run the offline tests with npm test.
Input / output
parseForm4Xml(xmlString) returns:
{"issuer": { "cik": "0000320193", "name": "Example Corp", "ticker": "EXMP" },"owners": [{ "name": "Doe Jane", "cik": "0001234567", "isDirector": false, "isOfficer": true,"isTenPercentOwner": false, "officerTitle": "Chief Financial Officer" }],"transactions": [{ "securityTitle": "Common Stock", "date": "2026-09-10", "code": "P", "shares": 1000,"pricePerShare": 25.5, "valueUsd": 25500, "acquiredDisposed": "A", "sharesOwnedAfter": 15000 }]}
- Covers
nonDerivativeTransactionentries only. - Numbers are JS numbers;
valueUsdisshares * pricePerSharerounded to 2 decimals. - A missing or footnote-only price gives
pricePerShare: 0andvalueUsd: 0. - Missing optional tags never throw: strings become
"", flagsfalse, andsharesOwnedAfternull.
summarizeByTicker(filings) takes an array of parseForm4Xml results and returns one entry per issuer ticker:
{ ticker, buyValueUsd, sellValueUsd, netValueUsd, distinctBuyers, transactionCount }, sorted by
netValueUsd descending. Only code P (open-market purchase) counts as a buy and S (open-market sale) as a
sell; other codes are ignored in the totals but still counted in transactionCount. distinctBuyers is the
number of distinct owner names on filings that contain at least one P transaction.
fetchRecentForm4(ticker, { userAgent, limit }) downloads raw Form 4 XML from sec.gov hosts only, sends your
descriptive userAgent (required by the SEC) and stays under 5 requests per second.
Limitations
- Derivative transactions (options, RSUs, warrants) and holdings tables are not parsed.
- Amendments (Form 4/A) are not deduplicated against the original filing, so amended trades can be counted twice.
- On a joint filing with several reporting owners, every owner is counted as a buyer if any transaction is a
P. - Trades made under Rule 10b5-1 plans, gifts, and tax withholding are not flagged separately; only the code is reported.
- Parsing is regex-based and targets the standard EDGAR Form 4 layout; unusual or malformed filings may parse incompletely.
fetchRecentForm4only looks at the most recent filings listed in the issuer's EDGAR submissions feed and is not covered by the offline tests.- Values use the reported price per share; transactions without a price show a value of 0.
Disclaimer
This tool reports public SEC filings as-is. It is not investment advice, makes no prediction about any security, and may contain errors or omissions. Use at your own risk; verify against the original filing on sec.gov.
License
MIT