跳到正文
DEV Community· Bosco Labs·· 5 天前AI 評分43

透過 API 將股票的 SEC Form 4 內幕交易資料轉為 JSON

Get SEC insider trades (Form 4) for a stock as JSON

AI 導讀

Apify 的 SEC Insider Trading API 讀取 EDGAR 上的 SEC Form 4 申報,並按每宗交易輸出資料列,供用戶以 JSON 查閲。API 支援按股票代號和交易代碼篩選、查看內幕人士集中買入訊號,並可取得可追溯至 sec.gov 原始申報的連結;數據可追溯至 2006 年。費用為每筆交易資料列 $0.0018,每個集中訊號 $0.02。

正文

When a director, officer or 10% owner of a US-listed company buys or sells its stock, they file a Form 4 with the SEC within two business days. The filings are public, but each one is an XML document somewhere in EDGAR, and a single filing can hold several transactions. Our SEC Insider Trading API on Apify reads them and gives you one row per transaction.

One stock, last 90 days

Say you want the open-market buys and sells by NVIDIA insiders over the last 90 days. The input:

{
  "tickers": ["NVDA"],
  "transactionCodes": ["P", "S"],
  "lookbackDays": 90,
  "maxResults": 3,
  "includeClusterSignals": false
}

P is an open-market purchase and S an open-market or private sale. Leave transactionCodes out to get every Form 4 code, including grants and option exercises.

One of the rows we got back on 17 November 2026, trimmed:

{
  "ticker": "NVDA",
  "issuer_name": "NVIDIA CORP",
  "insider_roles": ["officer"],
  "officer_title": "EVP, General Counsel and Sec",
  "transaction_date": "2026-09-21",
  "transaction_code": "S",
  "transaction_type": "Open-market or private sale",
  "shares": 4499,
  "price": 223.75,
  "value_usd": 1006651.25,
  "shares_owned_after": 2687660,
  "plan_10b5_1": true,
  "filing_date": "2026-09-23",
  "source_url": "https://www.sec.gov/Archives/edgar/data/1045810/000169684126000014/0001696841-26-000014-index.htm"
}

The full row also names the insider and their SEC CIK, as the filing does.

Reading the row

  • plan_10b5_1 says the trade was made under a Rule 10b5-1 trading plan, set up in advance. A planned sale says much less about what the insider thinks than a sale they chose to make that week.
  • filing_date and transaction_date differ: the trade happened on the 21st and was filed on the 23rd. If you backtest a signal, use the filing date (the row also has usable_from, the first day you could have acted on it).
  • source_url opens the filing on sec.gov, so you can check any number against the original.

The whole market, and clusters

Leave tickers empty to read every Form 4 in the date range. Set clusterBuysOnly to true to keep only open-market purchases where several insiders of the same company bought within a short window (clusterWindowDays); those rows say how many insiders and how much in total. Data goes back to 2006.

On a daily schedule, set onlyNewSinceLastRun to get, and pay for, only the transactions you haven't seen.

Run it

On the Store page, click Try for free, paste the input and press Start. From Python, with Apify's official client (pip install apify-client):

from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("bosco_labs/sec-insider-trades").call(run_input={
    "tickers": ["NVDA"],
    "transactionCodes": ["P", "S"],
    "lookbackDays": 90,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["transaction_date"], row["transaction_code"], row["value_usd"])

From an AI agent, add this server URL to your MCP client (Claude, Cursor, VS Code):

https://mcp.apify.com?tools=bosco_labs/sec-insider-trades

The agent then has the Actor as a tool and reads the rows itself.

Price

$0.0018 per transaction row ($1.80 per 1,000) and $0.02 per cluster signal, through Apify's pay per event. The same data is on our own HTTP API if you'd rather not use Apify.

來源:DEV Community · dev.to