Insider Transactions
curl --request GET \
--url https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactionsimport requests
url = "https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions")
.asString();require 'uri'
require 'net/http'
url = URI("https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"company_name": "<string>",
"insider_transactions": [
{
"insider": "<string>",
"relation": "<string>",
"transaction": "<string>",
"cost": 123,
"shares": 123,
"value": 123,
"shares_owned_following": 123
}
],
"total_transactions": 123,
"timestamp": "<string>",
"source": "<string>"
}Stock Data
Insider Transactions
Get recent insider trading activity for a company
GET
/
api
/
v1
/
stock
/
{symbol}
/
insider-transactions
Insider Transactions
curl --request GET \
--url https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactionsimport requests
url = "https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions")
.asString();require 'uri'
require 'net/http'
url = URI("https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/insider-transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"company_name": "<string>",
"insider_transactions": [
{
"insider": "<string>",
"relation": "<string>",
"transaction": "<string>",
"cost": 123,
"shares": 123,
"value": 123,
"shares_owned_following": 123
}
],
"total_transactions": 123,
"timestamp": "<string>",
"source": "<string>"
}Overview
Retrieve recent insider trading transactions for any publicly traded company. This endpoint provides information about stock purchases, sales, and other transactions by company insiders including executives, directors, and large shareholders.This endpoint uses YFinance data. Insider trading data helps investors understand sentiment and potential future performance based on insider activity.
Parameters
string
required
Stock ticker symbol (e.g., AAPL, MSFT, GOOGL, TSLA)
Response
string
The stock ticker symbol
string
Full company name
array
Array of recent insider transactions
Show Transaction Object
Show Transaction Object
string
Name of the insider (executive, director, etc.)
string
Relationship to company (e.g., “CEO”, “Director”, “10% Owner”)
string
Type of transaction (e.g., “Sale”, “Purchase”, “Option Exercise”)
number
Transaction cost/price per share
number
Number of shares involved in transaction
number
Total transaction value (shares × cost)
number
Total shares owned by insider after transaction
number
Total number of transactions returned
string
ISO timestamp of the response
string
Data source identifier (“YFinance”)
Examples
curl "https://stocks-dev.up.railway.app/api/v1/stock/AAPL/insider-transactions"
import requests
response = requests.get("https://stocks-dev.up.railway.app/api/v1/stock/AAPL/insider-transactions")
data = response.json()
print(f"Insider Transactions for {data['company_name']}:")
for transaction in data['insider_transactions'][:3]: # Show first 3
print(f"- {transaction['insider']}: {transaction['transaction']}")
print(f" Shares: {transaction['shares']:,} at ${transaction['cost']:.2f}")
print(f" Value: ${transaction['value']:,.2f}")
const response = await fetch('https://stocks-dev.up.railway.app/api/v1/stock/AAPL/insider-transactions');
const data = await response.json();
console.log(`Insider Transactions for ${data.company_name}:`);
data.insider_transactions.slice(0, 3).forEach(transaction => {
console.log(`- ${transaction.insider}: ${transaction.transaction}`);
console.log(` Shares: ${transaction.shares.toLocaleString()} at $${transaction.cost.toFixed(2)}`);
console.log(` Value: $${transaction.value.toLocaleString()}`);
});
<?php
$response = file_get_contents('https://stocks-dev.up.railway.app/api/v1/stock/AAPL/insider-transactions');
$data = json_decode($response, true);
echo "Insider Transactions for " . $data['company_name'] . ":\n";
foreach (array_slice($data['insider_transactions'], 0, 3) as $transaction) {
echo "- " . $transaction['insider'] . ": " . $transaction['transaction'] . "\n";
echo " Shares: " . number_format($transaction['shares']) . " at $" . $transaction['cost'] . "\n";
echo " Value: $" . number_format($transaction['value']) . "\n";
}
?>
Response Example
{
"symbol": "AAPL",
"company_name": "Apple Inc.",
"insider_transactions": [
{
"insider": "Timothy D Cook",
"relation": "CEO",
"transaction": "Sale",
"cost": 189.84,
"shares": 511000,
"value": 97049440,
"shares_owned_following": 3204462
},
{
"insider": "Katherine L Adams",
"relation": "Senior Vice President",
"transaction": "Sale",
"cost": 186.74,
"shares": 25000,
"value": 4668500,
"shares_owned_following": 427334
},
{
"insider": "Luca Maestri",
"relation": "Chief Financial Officer",
"transaction": "Sale",
"cost": 185.73,
"shares": 96735,
"value": 17969528,
"shares_owned_following": 110673
}
],
"total_transactions": 10,
"timestamp": "2025-06-28T19:30:15.123456",
"source": "YFinance"
}
Use Cases
Investment Research
Investment Research
- Insider Sentiment: Large sales by executives may indicate overvaluation
- Confidence Signals: Insider purchases often signal confidence in company prospects
- Timing Analysis: Track patterns in insider trading around earnings or events
Risk Assessment
Risk Assessment
- Executive Behavior: Monitor if leadership is reducing their holdings
- Diversification: Understand if sales are for portfolio diversification
- Regulatory Compliance: Track required disclosures and filings
Market Intelligence
Market Intelligence
- Industry Trends: Compare insider activity across sector competitors
- Compensation Analysis: Understand stock-based compensation patterns
- Corporate Governance: Monitor director and officer trading patterns
Error Responses
Invalid Symbol (404)
Invalid Symbol (404)
{
"error": "Failed to fetch insider transactions for INVALID"
}
No Data Available (200)
No Data Available (200)
{
"symbol": "NEWCO",
"company_name": "New Company Inc.",
"insider_transactions": "No insider transaction data available",
"timestamp": "2025-06-28T19:30:15.123456",
"source": "YFinance"
}
Rate Limited (429)
Rate Limited (429)
{
"error": "Rate limit exceeded",
"detail": "YFinance rate limited. Please try again later.",
"retry_after": 60
}
Important Notes
Data Limitations: Insider trading data depends on SEC filings and may have delays. Not all transactions may be immediately available.
Regulatory Context: Insider transactions are regulated by the SEC and must be reported within specific timeframes. This data reflects publicly disclosed transactions only.
Analysis Tips:
- Focus on patterns rather than individual transactions
- Consider the insider’s role and typical trading behavior
- Look at transaction timing relative to company events
MCP Protocol Usage
For AI agents using the Model Context Protocol:{
"method": "tools/call",
"params": {
"name": "get_insider_transactions",
"arguments": {
"symbol": "AAPL"
}
}
}
Related Endpoints
Stock Quote
Get current stock price and market data
Company Overview
Get comprehensive company information
Analyst Recommendations
Get analyst buy/sell recommendations
Government Trades
Track Congressional and Senate trading activity