Form 4 Insider Trading Endpoints

API Reference: Track corporate insider transactions, identify buying/selling patterns, and analyze insider conviction signals.

Overview

Form 4 insider trading endpoints provide comprehensive access to SEC Form 4 filings, which disclose insider transactions within 2 business days. Available data includes:

Light Tier:

  • Recent Activity — Latest insider transactions with flexible filtering
  • Top Insiders — Highest conviction traders by transaction value
  • Largest Transactions — Biggest dollar-value insider trades
  • Company Summary — Per-company insider activity aggregation
  • Transaction Breakdown — Analysis by transaction type and role

Medium Tier:

  • Trends — Time-series aggregation of insider activity
  • Clusters — Detection of coordinated insider buying/selling
  • Role Analytics — Analysis by insider role (CEO, CFO, Director, etc.)
  • Repeated Activity — Insiders with multiple recent transactions
  • Confidence Scores — Signal strength scoring for insider activity

Advanced Tier:

  • Unusual Ownership — Significant ownership percentage changes
  • Network Effects — Connected insiders trading together
  • Sentiment Momentum — Directional trend analysis

Insider Search:

  • Insider Search — Find insiders by name or attributes
  • Insider Profile — Individual insider statistics
  • Insider Transactions — Transaction history for specific insider
  • Insider Companies — Companies an insider trades

All endpoints require authentication. Some endpoints require Pro or Elite tier access.


Recent Activity

Get the latest insider transactions with comprehensive filtering options.

Request

    
    GET /v1/form4-recent-activity

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker (comma-separated for multiple)
day_intervalnumberNo30Days of history to retrieve
acquired_disposed_codestringNoA for acquisitions, D for dispositions
min_valuenumberNoMinimum transaction value in USD
rolestringNoFilter by insider role
sectorstringNoFilter by company sector
industrystringNoFilter by company industry
transaction_codestringNoFilter by transaction code (P, S, M, A, etc.)
is_acquisitionstringNotrue for buys, false for sells
cursorstringNoPagination cursor (transaction_date)
limitnumberNo500Maximum results to return

Response Format

CSV (pipe-delimited)

    
    transaction_date|issuer_cik|issuer_name|trading_symbols|owner_cik|insider_name|role|officer_title|transaction_code|transaction_description|transaction_shares|transaction_price_per_share|transaction_value|acquired_disposed_code|shares_owned_following_transaction|direct_or_indirect_ownership|accession_number|created_at

  

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-recent-activity?symbol=AAPL&day_interval=7&acquired_disposed_code=A"

  

Response:

    
    transaction_date|issuer_cik|issuer_name|trading_symbols|owner_cik|insider_name|role|officer_title|transaction_code|transaction_description|transaction_shares|transaction_price_per_share|transaction_value|acquired_disposed_code|shares_owned_following_transaction|direct_or_indirect_ownership|accession_number|created_at
2024-01-15|0000320193|Apple Inc.|AAPL|0001234567|WILLIAMS JEFF|Officer|Chief Operating Officer|P|Open market or private purchase|5000|186.25|931250.00|A|125000|D|0001234567-24-000012|2024-01-16 08:15:23
2024-01-14|0000320193|Apple Inc.|AAPL|0002345678|KONDO DEIRDRE|Director||M|Exercise of derivative security|10000|45.50|455000.00|A|35000|D|0002345678-24-000008|2024-01-15 10:22:11

  

Response Fields

FieldTypeDescription
transaction_datedateDate of transaction
issuer_cikstringCompany SEC CIK
issuer_namestringCompany name
trading_symbolsstringStock ticker(s)
owner_cikstringInsider SEC CIK
insider_namestringInsider full name
rolestringInsider role (Officer, Director, 10% Owner)
officer_titlestringSpecific title if officer
transaction_codestringSEC transaction code
transaction_descriptionstringHuman-readable description
transaction_sharesnumberNumber of shares traded
transaction_price_per_sharenumberPrice per share
transaction_valuenumberTotal transaction value (USD)
acquired_disposed_codestringA (acquired) or D (disposed)
shares_owned_following_transactionnumberTotal shares owned after trade
direct_or_indirect_ownershipstringD (direct) or I (indirect)
accession_numberstringSEC filing identifier
created_attimestampWhen record was created

Transaction Codes

CodeDescription
POpen market or private purchase
SOpen market or private sale
MExercise or conversion of derivative
AGrant, award, or other acquisition
FPayment of exercise price or tax liability
GGift
DSale to issuer (e.g., tender offer)

Tier Requirement

Light Tier — Available to all authenticated users.


Top Insiders

Get the highest conviction insiders ranked by total transaction value.

Request

    
    GET /v1/form4-top-insiders

  

Parameters

ParameterTypeRequiredDefaultDescription
day_intervalnumberNo90Days of history to analyze
acquired_disposed_codestringNoA for buyers, D for sellers
symbolstringNoFilter by ticker (comma-separated for multiple)
limitnumberNo50Maximum results (max 100)

Response Format

CSV (pipe-delimited)

    
    owner_cik|insider_name|acquired_disposed_code|total_transaction_value|total_transactions|avg_transaction_size|most_recent_date|companies_traded|rank

  

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-top-insiders?acquired_disposed_code=A&limit=10"

  

Response:

    
    owner_cik|insider_name|acquired_disposed_code|total_transaction_value|total_transactions|avg_transaction_size|most_recent_date|companies_traded|rank
0001234567|BUFFETT WARREN E|A|125000000.00|15|8333333.33|2024-01-12|Berkshire Hathaway Inc. (BRK.A, BRK.B), Occidental Petroleum Corp. (OXY)|1
0002345678|ICAHN CARL C|A|89500000.00|8|11187500.00|2024-01-10|Icahn Enterprises LP (IEP), CVR Energy Inc. (CVI)|2

  

Response Fields

FieldTypeDescription
owner_cikstringInsider SEC CIK
insider_namestringInsider full name
acquired_disposed_codestringA (buyer) or D (seller)
total_transaction_valuenumberTotal USD value across all transactions
total_transactionsnumberCount of transactions
avg_transaction_sizenumberAverage transaction value
most_recent_datedateDate of most recent transaction
companies_tradedstringList of companies traded
ranknumberRanking within acquired/disposed group

Tier Requirement

Light Tier — Available to all authenticated users.


Largest Transactions

Get the biggest dollar-value insider transactions.

Request

    
    GET /v1/form4-largest-transactions

  

Parameters

ParameterTypeRequiredDefaultDescription
day_intervalnumberNo30Days of history to retrieve
min_valuenumberNo1000000Minimum transaction value (USD)
acquired_disposed_codestringNoA for acquisitions, D for dispositions
symbolstringNoFilter by ticker
rolestringNoFilter by insider role
sectorstringNoFilter by company sector
industrystringNoFilter by company industry
transaction_codestringNoFilter by transaction code
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns same fields as Recent Activity endpoint, sorted by transaction value descending.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-largest-transactions?min_value=5000000&limit=20"

  

Tier Requirement

Light Tier — Available to all authenticated users.


Company Summary

Get aggregated insider activity statistics for a specific company.

Request

    
    GET /v1/form4-company-summary

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringYesStock ticker symbol
day_intervalnumberNo90Days of history to analyze

Response Format

CSV (pipe-delimited)

Returns aggregated statistics including total buy/sell value, transaction counts, and unique insiders.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-company-summary?symbol=TSLA&day_interval=30"

  

Tier Requirement

Light Tier — Available to all authenticated users.


Transaction Breakdown

Get transaction type and role breakdown for companies.

Request

    
    GET /v1/form4-transaction-breakdown

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
day_intervalnumberNo90Days of history to analyze
rolestringNoFilter by insider role
sectorstringNoFilter by company sector
industrystringNoFilter by company industry

Response Format

CSV (pipe-delimited)

Returns breakdown of transaction types, counts, and values.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-transaction-breakdown?symbol=NVDA"

  

Tier Requirement

Light Tier — Available to all authenticated users.


Get time-series aggregation of insider activity trends.

Request

    
    GET /v1/form4-trends

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
aggregationstringNoweeklyTime bucket: daily, weekly, monthly
limitnumberNo52Number of periods to return

Response Format

CSV (pipe-delimited)

Returns time-bucketed aggregations of buy/sell activity, transaction counts, and values.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-trends?symbol=AAPL&aggregation=weekly&limit=26"

  

Response:

    
    period_start|period_end|buy_count|sell_count|buy_value|sell_value|net_value|unique_insiders
2024-01-08|2024-01-14|12|5|2450000.00|890000.00|1560000.00|8
2024-01-01|2024-01-07|8|3|1820000.00|320000.00|1500000.00|6

  

Response Fields

FieldTypeDescription
period_startdateStart of time bucket
period_enddateEnd of time bucket
buy_countnumberNumber of buy transactions
sell_countnumberNumber of sell transactions
buy_valuenumberTotal buy value (USD)
sell_valuenumberTotal sell value (USD)
net_valuenumberNet buy/sell value
unique_insidersnumberCount of unique insiders

Tier Requirement

Medium Tier — Requires Pro or Elite subscription.


Clusters

Detect coordinated insider buying or selling (multiple insiders within narrow timeframe).

Request

    
    GET /v1/form4-clusters

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker (comma-separated for multiple)
day_intervalnumberNo90Days of history to analyze
min_insidersnumberNo3Minimum insiders in cluster
min_valuenumberNo100000Minimum cluster total value (USD)
acquired_disposed_codestringNoA for buy clusters, D for sell clusters
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

    
    issuer_cik|issuer_name|trading_symbols|cluster_start_date|cluster_end_date|acquired_disposed_code|insider_count|transaction_count|cluster_total_value|days_since_cluster

  

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-clusters?min_insiders=5&acquired_disposed_code=A"

  

Response:

    
    issuer_cik|issuer_name|trading_symbols|cluster_start_date|cluster_end_date|acquired_disposed_code|insider_count|transaction_count|cluster_total_value|days_since_cluster
0001234567|Tesla Inc.|TSLA|2024-01-10|2024-01-12|A|6|9|4250000.00|5
0002345678|NVIDIA Corp.|NVDA|2024-01-08|2024-01-09|A|5|7|3820000.00|7

  

Response Fields

FieldTypeDescription
issuer_cikstringCompany SEC CIK
issuer_namestringCompany name
trading_symbolsstringStock ticker(s)
cluster_start_datedateFirst transaction in cluster
cluster_end_datedateLast transaction in cluster
acquired_disposed_codestringA (buy cluster) or D (sell cluster)
insider_countnumberNumber of insiders in cluster
transaction_countnumberTotal transactions in cluster
cluster_total_valuenumberCombined transaction value (USD)
days_since_clusternumberDays since cluster occurred

Tier Requirement

Medium Tier — Requires Pro or Elite subscription.


Role Analytics

Analyze insider activity by role (CEO, CFO, Director, 10% Owner, etc.).

Request

    
    GET /v1/form4-role-analytics

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
day_intervalnumberNo90Days of history to analyze
rolestringNoFilter by specific role
acquired_disposed_codestringNoA for buys, D for sells
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns aggregated statistics by insider role.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-role-analytics?symbol=MSFT&role=Officer"

  

Tier Requirement

Medium Tier — Requires Pro or Elite subscription.


Repeated Activity

Find insiders with multiple transactions in the lookback period.

Request

    
    GET /v1/form4-repeated-activity

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
day_intervalnumberNo90Days of history to analyze
min_occurrencesnumberNo3Minimum transactions to qualify
acquired_disposed_codestringNoA for repeated buys, D for repeated sells
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns insiders with multiple recent transactions, showing consistency of conviction.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-repeated-activity?min_occurrences=5&acquired_disposed_code=A"

  

Tier Requirement

Medium Tier — Requires Pro or Elite subscription.


Confidence Scores

Get insider activity with signal confidence scoring.

Request

    
    GET /v1/form4-confidence-scores

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
day_intervalnumberNo90Days of history to analyze
min_scorenumberNo50.0Minimum confidence score (0-100)
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns transactions with confidence scores based on transaction size, insider role, timing, and other factors.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-confidence-scores?min_score=75&limit=50"

  

Confidence Score Factors

Scores are calculated based on:

  • Transaction size relative to insider's history
  • Insider role and seniority
  • Open market purchases (higher weight)
  • Clustered activity with other insiders
  • Repeated transactions in same direction

Tier Requirement

Medium Tier — Requires Pro or Elite subscription.


Unusual Ownership

Detect significant ownership percentage changes.

Request

    
    GET /v1/form4-unusual-ownership

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
min_percent_changenumberNo10.0Minimum ownership % change
severitystringNoFilter: high, medium, low
rolestringNoFilter by insider role
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns transactions where insiders significantly changed their ownership stake.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-unusual-ownership?min_percent_change=20&severity=high"

  

Tier Requirement

Advanced Tier — Requires Elite subscription.


Network Effects

Identify connected insiders trading together (board members, management teams).

Request

    
    GET /v1/form4-network-effects

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
min_connected_insidersnumberNo3Minimum connected insiders
acquired_disposed_codestringNoA for buys, D for sells
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns groups of connected insiders with correlated trading activity.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-network-effects?min_connected_insiders=4"

  

Tier Requirement

Advanced Tier — Requires Elite subscription.


Sentiment Momentum

Analyze directional trends in insider sentiment.

Request

    
    GET /v1/form4-sentiment-momentum

  

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringNoFilter by ticker
momentum_categorystringNoFilter: accelerating_buys, decelerating_sells, etc.
acquired_disposed_codestringNoA for buy momentum, D for sell momentum
limitnumberNo100Maximum results to return

Response Format

CSV (pipe-delimited)

Returns companies with shifting insider sentiment patterns.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-sentiment-momentum?momentum_category=accelerating_buys"

  

Tier Requirement

Advanced Tier — Requires Elite subscription.


Search for insiders by name or browse with filters.

Request

    
    GET /v1/form4-insider-search

  

Parameters

ParameterTypeRequiredDefaultDescription
name_querystringNoFuzzy name search (min 3 characters)
owner_cikstringNoExact CIK lookup
min_companiesnumberNo1Minimum companies traded
activity_levelstringNoVery Active, Active, Moderate, Occasional
position_typestringNoNet Buyer, Net Seller, Mixed
limitnumberNo50Maximum results (max 100)

Response Format

CSV (pipe-delimited)

    
    owner_cik|insider_name|companies_traded|total_transactions|total_buy_value|total_sell_value|net_position_change|avg_transaction_size|primary_role|activity_level|position_type|first_transaction|last_transaction|transactions_last_30_days

  

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-insider-search?name_query=Warren%20Buffett"

  

Response:

    
    owner_cik|insider_name|companies_traded|total_transactions|total_buy_value|total_sell_value|net_position_change|avg_transaction_size|primary_role|activity_level|position_type|first_transaction|last_transaction|transactions_last_30_days
0001234567|BUFFETT WARREN E|8|156|2850000000.00|125000000.00|2725000000.00|19102564.10|Director|Very Active|Net Buyer|2018-03-15|2024-01-12|3

  

Response Fields

FieldTypeDescription
owner_cikstringInsider SEC CIK (padded to 10 digits)
insider_namestringInsider full name
companies_tradednumberCount of companies traded
total_transactionsnumberTotal transactions (all time)
total_buy_valuenumberCumulative buy value (USD)
total_sell_valuenumberCumulative sell value (USD)
net_position_changenumberNet buy/sell value
avg_transaction_sizenumberAverage transaction value
primary_rolestringMost common role
activity_levelstringTrading frequency category
position_typestringNet buyer, seller, or mixed
first_transactiondateDate of first transaction
last_transactiondateDate of most recent transaction
transactions_last_30_daysnumberRecent transaction count

Search Modes

Discovery Mode (no name_query):

  • Returns insiders sorted by activity level
  • Useful for finding most active traders

Search Mode (with name_query):

  • Fuzzy matching using trigrams
  • Handles name variations and typos
  • Results ranked by similarity

Tier Requirement

Insider Search — Available to all authenticated users.


Insider Profile

Get comprehensive profile for a specific insider.

Request

    
    GET /v1/form4-insider-profile

  

Parameters

ParameterTypeRequiredDefaultDescription
owner_cikstringYesInsider SEC CIK

Response Format

CSV (pipe-delimited)

Returns same fields as Insider Search for the specified CIK.

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-insider-profile?owner_cik=0001234567"

  

Tier Requirement

Insider Search — Available to all authenticated users.


Insider Transactions

Get transaction history for a specific insider across all companies.

Request

    
    GET /v1/form4-insider-transactions

  

Parameters

ParameterTypeRequiredDefaultDescription
owner_cikstringYesInsider SEC CIK
day_intervalnumberNo90Days of history to retrieve
limitnumberNo100Maximum results (max 500)

Response Format

CSV (pipe-delimited)

    
    transaction_date|issuer_cik|issuer_name|trading_symbols|role|officer_title|transaction_code|transaction_description|transaction_shares|transaction_price_per_share|transaction_value|acquired_disposed_code|shares_owned_following_transaction|direct_or_indirect_ownership|accession_number

  

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-insider-transactions?owner_cik=0001234567&day_interval=180"

  

Tier Requirement

Insider Search — Available to all authenticated users.


Insider Companies

Get breakdown of companies traded by a specific insider.

Request

    
    GET /v1/form4-insider-companies

  

Parameters

ParameterTypeRequiredDefaultDescription
owner_cikstringYesInsider SEC CIK
day_intervalnumberNo90Days of history to analyze

Response Format

CSV (pipe-delimited)

    
    issuer_cik|issuer_name|trading_symbols|total_transactions|total_buy_value|total_sell_value|net_value|first_transaction|last_transaction

  

Example

Request:

    
    curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://apollo.profitelligence.com/v1/form4-insider-companies?owner_cik=0001234567"

  

Response:

    
    issuer_cik|issuer_name|trading_symbols|total_transactions|total_buy_value|total_sell_value|net_value|first_transaction|last_transaction
0001318605|Tesla Inc.|TSLA|8|0.00|45000000.00|-45000000.00|2023-11-15|2024-01-12
0001652044|Alphabet Inc.|GOOGL, GOOG|3|1250000.00|0.00|1250000.00|2023-12-01|2024-01-05

  

Response Fields

FieldTypeDescription
issuer_cikstringCompany SEC CIK
issuer_namestringCompany name
trading_symbolsstringStock ticker(s)
total_transactionsnumberCount of transactions
total_buy_valuenumberCumulative buy value (USD)
total_sell_valuenumberCumulative sell value (USD)
net_valuenumberNet buy/sell value
first_transactiondateDate of first transaction
last_transactiondateDate of most recent transaction

Tier Requirement

Insider Search — Available to all authenticated users.


Error Responses

Missing Required Parameter

    
    error,owner_cik parameter is required

  

No Data Found

    
    error,No insider activity found for the specified criteria

  

Feature Access Denied

    
    {
  "error": "Feature access denied",
  "code": "FEATURE_TIER_REQUIRED",
  "details": "This endpoint requires Pro tier subscription",
  "upgrade_url": "https://profitelligence.com/subscribe"
}

  

Code Examples

Python: Find Recent Insider Buying

    
    import requests
import io
import pandas as pd

def get_insider_buying(token: str, symbol: str, days: int = 30) -> pd.DataFrame:
    """Get recent insider buying activity for a company."""
    response = requests.get(
        "https://apollo.profitelligence.com/v1/form4-recent-activity",
        params={
            "symbol": symbol,
            "day_interval": days,
            "acquired_disposed_code": "A",  # Acquisitions only
            "limit": 100
        },
        headers={"Authorization": f"Bearer {token}"}
    )
    response.raise_for_status()

    # Parse pipe-delimited CSV
    df = pd.read_csv(io.StringIO(response.text), sep='|')
    df['transaction_date'] = pd.to_datetime(df['transaction_date'])

    return df

# Usage
buys = get_insider_buying(jwt_token, "NVDA", days=7)
print(f"Total insider buying: ${buys['transaction_value'].sum():,.0f}")
print(f"Unique insiders: {buys['insider_name'].nunique()}")

  

Python: Detect Buy Clusters

    
    def find_buy_clusters(token: str, min_insiders: int = 5) -> pd.DataFrame:
    """Find companies with clustered insider buying."""
    response = requests.get(
        "https://apollo.profitelligence.com/v1/form4-clusters",
        params={
            "min_insiders": min_insiders,
            "acquired_disposed_code": "A",  # Buy clusters
            "day_interval": 30,
            "limit": 50
        },
        headers={"Authorization": f"Bearer {token}"}
    )
    response.raise_for_status()

    df = pd.read_csv(io.StringIO(response.text), sep='|')

    # Sort by cluster value
    df = df.sort_values('cluster_total_value', ascending=False)

    return df

# Usage
clusters = find_buy_clusters(jwt_token, min_insiders=5)
print(clusters[['trading_symbols', 'insider_count', 'cluster_total_value']].head())

  

Python: Search for Insider

    
    def search_insider(token: str, name: str) -> dict:
    """Search for an insider and get their full profile."""
    # First, search by name
    response = requests.get(
        "https://apollo.profitelligence.com/v1/form4-insider-search",
        params={"name_query": name, "limit": 1},
        headers={"Authorization": f"Bearer {token}"}
    )
    response.raise_for_status()

    df = pd.read_csv(io.StringIO(response.text), sep='|')

    if df.empty:
        return None

    owner_cik = df.iloc[0]['owner_cik']

    # Get detailed profile, transactions, and companies
    profile_resp = requests.get(
        "https://apollo.profitelligence.com/v1/form4-insider-profile",
        params={"owner_cik": owner_cik},
        headers={"Authorization": f"Bearer {token}"}
    )

    transactions_resp = requests.get(
        "https://apollo.profitelligence.com/v1/form4-insider-transactions",
        params={"owner_cik": owner_cik, "limit": 100},
        headers={"Authorization": f"Bearer {token}"}
    )

    companies_resp = requests.get(
        "https://apollo.profitelligence.com/v1/form4-insider-companies",
        params={"owner_cik": owner_cik},
        headers={"Authorization": f"Bearer {token}"}
    )

    return {
        "profile": pd.read_csv(io.StringIO(profile_resp.text), sep='|'),
        "transactions": pd.read_csv(io.StringIO(transactions_resp.text), sep='|'),
        "companies": pd.read_csv(io.StringIO(companies_resp.text), sep='|')
    }

# Usage
insider = search_insider(jwt_token, "Warren Buffett")
if insider:
    print(insider['profile'])
    print(f"\nRecent transactions: {len(insider['transactions'])}")
    print(f"Companies traded: {len(insider['companies'])}")

  

JavaScript: Get Top Insider Buyers

    
    async function getTopBuyers(token, days = 90, limit = 20) {
  const params = new URLSearchParams({
    day_interval: days,
    acquired_disposed_code: 'A',  // Acquisitions only
    limit: limit
  });

  const response = await fetch(
    `https://apollo.profitelligence.com/v1/form4-top-insiders?${params}`,
    { headers: { 'Authorization': `Bearer ${token}` } }
  );

  const csv = await response.text();

  // Parse CSV to array of objects
  const lines = csv.trim().split('\n');
  const headers = lines[0].split('|');

  return lines.slice(1).map(line => {
    const values = line.split('|');
    return headers.reduce((obj, header, i) => {
      obj[header] = values[i];
      return obj;
    }, {});
  });
}

// Usage
const topBuyers = await getTopBuyers(token, 90, 10);
topBuyers.forEach(insider => {
  console.log(`${insider.insider_name}: $${parseFloat(insider.total_transaction_value).toLocaleString()}`);
});

  
    
    async function getInsiderTrends(token, symbol, weeks = 12) {
  const params = new URLSearchParams({
    symbol: symbol,
    aggregation: 'weekly',
    limit: weeks
  });

  const response = await fetch(
    `https://apollo.profitelligence.com/v1/form4-trends?${params}`,
    { headers: { 'Authorization': `Bearer ${token}` } }
  );

  const csv = await response.text();
  const lines = csv.trim().split('\n');
  const headers = lines[0].split('|');

  const data = lines.slice(1).map(line => {
    const values = line.split('|');
    const row = headers.reduce((obj, header, i) => {
      obj[header] = values[i];
      return obj;
    }, {});

    // Calculate net sentiment
    row.net_value = parseFloat(row.buy_value) - parseFloat(row.sell_value);
    return row;
  });

  return data;
}

// Usage
const trends = await getInsiderTrends(token, 'AAPL', 12);
console.log('Insider sentiment over time:');
trends.forEach(week => {
  const sentiment = week.net_value > 0 ? 'BULLISH' : 'BEARISH';
  console.log(`${week.period_start}: ${sentiment} (Net: $${week.net_value.toLocaleString()})`);
});

  

Understanding Insider Data

What Makes Insider Trades Significant?

High-Conviction Signals:

  • Open market purchases (code P) by executives
  • Large transactions relative to insider's salary
  • Multiple insiders buying within days (clusters)
  • Repeated buying by same insider
  • Unusual ownership percentage increases

Lower Signal Value:

  • Automatic plan sales (10b5-1)
  • Option exercises (code M) followed by immediate sale
  • Tax-related sales (code F)
  • Small routine transactions

Transaction Timing

  • Form 4 must be filed within 2 business days of transaction
  • Look for patterns across multiple insiders
  • Recent clusters may indicate material non-public information boundaries
  • Compare insider activity timing with earnings reports and price movements

Role Significance

Highest Signal:

  • CEO, CFO, COO (C-suite executives)
  • 10% owners (major shareholders)
  • Board chairs

Moderate Signal:

  • Directors
  • Vice Presidents
  • Other officers

Lower Signal:

  • Lower-level officers
  • Beneficial owners with small stakes

Next Steps