Skip to main content

Official Python SDK for the Insider Trades API — real-time SEC Form 3, 4, and 5 insider transaction data.

Project description

Insider Trades API — Python SDK

Official Python SDK for the Insider Trades API — real-time SEC Form 3, 4, and 5 insider transaction data.

Installation

pip install insider-trades-api

Requires Python 3.8+. No runtime dependencies.

Quick Start

import os
from insider_trades_api import InsiderTradesAPI

client = InsiderTradesAPI(api_key=os.environ["INSIDER_TRADES_API_KEY"])

# Get recent insider purchases for Apple
result = client.get_insider_transactions(
    issuer_ticker="AAPL",
    transaction_types="purchase",
    limit=10,
)

for tx in result["insiderTransactions"]:
    owner = tx.get("reportingOwnerInformation", {})
    print(owner.get("name"), tx.get("purchaseAmount"))

If you omit api_key, the client reads INSIDER_TRADES_API_KEY from the environment.

Get your API key at insidertrades.us.


API Reference

For the full reference including all parameters, response schemas, and plan limits, see insidertrades.us/docs.

InsiderTradesAPI(api_key=None, *, timeout=30.0)

Argument Type Required Description
api_key str Yes Your API key. Falls back to INSIDER_TRADES_API_KEY env var
timeout float No Per-request socket timeout in seconds (default 30.0)

get_insider_transactions(**params)

Retrieve SEC insider transactions from Form 3, 4, and 5 filings. All arguments are keyword-only. Returns the decoded JSON response as a dict with insiderTransactions, count, and recordedTimeInUtc.

result = client.get_insider_transactions(
    issuer_ticker="AAPL",
    transaction_types=["purchase", "sale"],
    filing_date_in_est_start_date="2026-01-01",
    filing_date_in_est_end_date="2026-01-31",
    limit=50,
)
print(result["count"], len(result["insiderTransactions"]))
Parameter Type Description
filing_id str Direct lookup by filing ID
issuer_ticker str Filter by ticker symbol, e.g. "AAPL"
issuer_cik str Filter by issuer CIK
reporting_owner_cik str Filter by insider CIK
accession_number str Filter by SEC accession number
form_types str | Sequence[str] Form types: "3", "4", "5" (default: all)
transaction_types str | Sequence[str] See transaction types below
owner_roles str | Sequence[str] "director", "officer", "tenPercentOwner"
officer_titles str | Sequence[str] Normalized titles: "CEO", "CFO", "COO", etc.
filing_date_in_est_start_date str Filing date start YYYY-MM-DD (Eastern Time)
filing_date_in_est_end_date str Filing date end YYYY-MM-DD (Eastern Time)
period_of_report_start_date str Period of report start YYYY-MM-DD
period_of_report_end_date str Period of report end YYYY-MM-DD
min_total_amount float Minimum total dollar value
max_total_amount float Maximum total dollar value
fieldset "minimal" | "standard" | "full" Control response size (see below)
limit int Max results, default 100, max 900

Transaction types

Value SEC Code Description
"purchase" P Open market purchase
"sale" S Open market sale
"grant" A Grant or award
"gift" G Bona fide gift
"exercise" M Option exercise (Rule 16b-3)
"derivativeExercise" O, X Derivative exercise
"disposition" D Disposition to issuer
"discretionary" I Discretionary transaction
"derivativeConversion" C Conversion of derivative
"derivativeExpiration" E, H Expiration of derivative
"smallAcquisition" L Small acquisition (Rule 16a-6)
"inheritance" W Inheritance
"equitySwap" K Equity swap
"tender" U Tender offer / change of control
"other" J Other acquisition / disposition

Fieldsets

Fieldset Fields included
"minimal" ID, issuer, owner, key amounts, dates
"standard" All of minimal + all aggregates, boolean flags, links, AI summary
"full" All of standard + raw transaction arrays (nonDerivativeTransactions, derivativeTransactions, holdings)

Default (no fieldset): all stored fields are returned. minimal and standard produce significantly smaller payloads — recommended for bulk queries.

Sample response:

{
  "insiderTransactions": [
    {
      "id": "97e823b724619e921c68ba73b2f95f3b015fb83cc05666320b6ddf34b97cdcbe",
      "formType": "4",
      "accessionNumber": "0001140361-26-023363",
      "issuerCik": "320193",
      "issuerInformation": {
        "cik": "0000320193",
        "tradingSymbol": "AAPL",
        "companyName": "Apple Inc."
      },
      "reportingOwnerCik": "1214128",
      "reportingOwnerInformation": {
        "cik": "0001214128",
        "name": "LEVINSON ARTHUR D",
        "city": "CUPERTINO",
        "state": "CA",
        "isDirector": true,
        "isOfficer": false
      },
      "ownerRoles": "director",
      "filingDateInEst": "2026-05-29",
      "periodOfReport": "2026-05-27",
      "totalAmount": 15551000.0,
      "saleAmount": 15551000.0,
      "saleCount": 1,
      "netSharesAcquired": -50000.0,
      "netTradingAmount": -15551000.0,
      "hasSales": "true",
      "hasLateTransactions": false,
      "aff10b5One": false,
      "summary": "Arthur D. Levinson sold 50,000 shares of Apple Inc. common stock at $311.02 per share on May 27, 2026.",
      "linkToFilingDetail": "https://www.sec.gov/Archives/edgar/data/1214128/000114036126023363/0001140361-26-023363-index.htm"
    }
  ],
  "count": 1,
  "recordedTimeInUtc": "2026-05-29T22:30:00Z"
}

Usage examples

Recent Form 4 purchases by date range

result = client.get_insider_transactions(
    transaction_types="purchase",
    form_types="4",
    filing_date_in_est_start_date="2026-05-01",
    filing_date_in_est_end_date="2026-05-31",
    limit=50,
)

High-value transactions over $1M

result = client.get_insider_transactions(
    min_total_amount=1_000_000,
    transaction_types="purchase",
    filing_date_in_est_start_date="2026-05-01",
    filing_date_in_est_end_date="2026-05-31",
    limit=25,
)

All transactions by a specific insider

result = client.get_insider_transactions(reporting_owner_cik="1214128", limit=20)

CEO transactions across all companies

result = client.get_insider_transactions(
    officer_titles=["CEO"],
    form_types="4",
    filing_date_in_est_start_date="2026-05-01",
    filing_date_in_est_end_date="2026-05-31",
    limit=20,
)

Look up a specific filing

result = client.get_insider_transactions(accession_number="0001140361-26-023363")

Typing

The package ships with type hints (py.typed). Responses are plain dicts; TypedDict definitions describe their shape for editors and type checkers.

from insider_trades_api import (
    InsiderTransaction,
    InsiderTransactionsResponse,
    IssuerInformation,
    ReportingOwnerInformation,
    NonDerivativeTransaction,
    DerivativeTransaction,
    NonDerivativeHolding,
    DerivativeHolding,
    Footnote,
    OwnerSignature,
)

Note: the has* flags (hasPurchases, hasSales, …) are returned as the string "true", not a Python bool. Use truthiness checks (if tx.get("hasPurchases"):) rather than == True.


Error handling

Client-side validation failures raise ValueError before any network call. Non-success HTTP responses raise InsiderTradesAPIError, which carries the HTTP status.

from insider_trades_api import InsiderTradesAPI, InsiderTradesAPIError

try:
    result = client.get_insider_transactions(issuer_ticker="AAPL")
except InsiderTradesAPIError as err:
    print(err.status, err)  # e.g. 403 "InsiderTrades API error 403: Forbidden"
Status Meaning
400 Invalid parameters (bad date format, invalid CIK, inverted date range)
403 Invalid or missing API key, or requested date range exceeds plan limit
429 Rate limit exceeded — retried automatically up to 3 times with backoff
504 Request timed out — retried automatically up to 3 times
500 Server error

The SDK validates date format (YYYY-MM-DD), numeric CIK, and date range order before making any network request, so many errors are caught immediately without a round trip.


Changelog

[0.1.0] - 2026-06-05

  • Initial release: get_insider_transactions() with full query parameter support
  • Filters: issuer_ticker, issuer_cik, reporting_owner_cik, transaction_types, owner_roles, officer_titles, date ranges, min_total_amount, max_total_amount, fieldset
  • Retry logic for 429 and 504 with backoff
  • Client-side input validation for date format, CIK format, and date range order
  • Full type hints (py.typed) including transaction arrays, holdings, and boolean flags
  • Zero runtime dependencies (stdlib only)

Resources


Legal disclaimer

The data provided through this SDK is for informational purposes only and does not constitute investment advice, financial advice, trading advice, or any other type of advice. GoodTech LLC makes no representations as to the accuracy, completeness, or timeliness of the data. You are solely responsible for your use of the data. Past filings and transactions do not predict future performance. Always consult a qualified financial professional before making investment decisions.


Licensed under the Apache 2.0 License. Copyright 2026 GoodTech LLC.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insider_trades_api-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

insider_trades_api-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file insider_trades_api-0.1.0.tar.gz.

File metadata

  • Download URL: insider_trades_api-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for insider_trades_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 183306c68154e2787d2b936b8df59010bafbf8c0b6e4329fa0d405c7ec6f1f09
MD5 ae3a3e0e5fb30ba616d6373b54d18b51
BLAKE2b-256 f1a148d982229c69550b6706c7ab1edae6dc98e2431f7ca865f0da01fac172e9

See more details on using hashes here.

File details

Details for the file insider_trades_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for insider_trades_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a31aefc2c8a02cb18f519365fc0197737d574f479e6a7a020cd38840cd955fe
MD5 68164bee0d59e9d5ee885a3178742b90
BLAKE2b-256 bd147bdd7e1ca0d09ccccfc56d824ccb67c3de55d65f58120a8514a5ae1bf3f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page