{
  "id": 8662840,
  "title": "Build an insider-buying screener with Python and SEC Form 4 data",
  "url": "https://urgent.news/2026/09/20/build-an-insider-buying-screener-with-python-and-sec-form-4-data",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-20T09:52:13.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/makeev/build-an-insider-buying-screener-with-python-and-sec-form-4-data-4eg1"
  },
  "original_language": "en",
  "account": "This article provides a tutorial on building an insider-buying screener using Python and SEC Form 4 data. The process involves fetching insider trading events from the AlphAI API, filtering the results based on specific criteria, and generating a Markdown table and CSV file for further analysis.\n\nThe script uses Python 3.10 or newer and has no package dependencies. It retrieves data from the AlphAI API using a GET request with the endpoint /api/symbols/{ticker}/insider-trades/?page_size=1, which returns a paginated list of insider trades for a given ticker symbol. The script reads the chart_events array, which contains the recorded events from the trailing twelve months, and applies a 30-day transaction-date window locally.\n\nThe selection function filters the events based on the following criteria:\n1. Only transactions with the transaction code 'P' (purchase) are considered.\n2. The total value of the transaction in USD must be greater than a specified minimum threshold.\n3. Events marked as 10b5-1 plans (e.g., insider loans) are excluded if the exclude_plans flag is set to True.\n4. Only events involving officers or directors are considered if the leadership_only flag is set to True.\n\nThe script stops and prints an error message if an HTTP error occurs during the API request. It also handles unknown values and converts decimal strings to Decimal objects for accurate calculations.\n\nThe output of the script includes a Markdown report containing the filtered insider-buying events and a CSV file that can be sorted by the user. The report is generated with the selected events sorted by the total value of the transaction in descending order.",
  "summary": "A director bought $101,760 of Tenax Therapeutics. Another bought $500,000 of Inhibrx Biosciences. Sorted by dollars, the second purchase comes first. Measured against the holding reported with each transaction, the increases were 2330.7% and 1.2%. Both numbers came back in the same API field. They answer a different question from the dollar amount, and neither tells you what the stock will do…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}