> ## Documentation Index
> Fetch the complete documentation index at: https://docs.financialdatasets.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Insider Trades

> Get SEC Form 4 insider trading data for any US stock. Includes buy/sell transactions by officers and directors.

### Overview

The insider trades API lets you access the stock buys and sales of public company insiders like CEOs, CFOs, and Directors.

In addition to the stock buys and sales, you can also access the current ownership stakes of insiders.

This data is useful for understanding the sentiment of company insiders. For example, you can answer questions like:

* How many shares of Nvidia does Jensen Huang own?
* How many shares of Microsoft did Satya Nadella buy last quarter?
* How many shares of Apple has Tim Cook sold over the past year?

To get started, please create an account and grab your <b>API key</b> at [financialdatasets.ai](https://financialdatasets.ai).

You will use the API key to authenticate your API requests.

### Coverage

| Tickers | Years of Coverage | Updated           |
| ------- | ----------------- | ----------------- |
| 8,200+  | 15+ years         | Within 10 seconds |

### Available Tickers

You can fetch a list of available tickers with a `GET` request to:
[https://api.financialdatasets.ai/insider-trades/tickers/](https://api.financialdatasets.ai/insider-trades/tickers/)

### Available Insiders

You can fetch a list of available insider names for a given ticker with a `GET` request to:
[https://api.financialdatasets.ai/insider-trades/names/?ticker=AAPL](https://api.financialdatasets.ai/insider-trades/names/?ticker=AAPL)

### Available Transaction Types

You can fetch a list of available transaction types with a `GET` request to:
[https://api.financialdatasets.ai/insider-trades/transaction-types/](https://api.financialdatasets.ai/insider-trades/transaction-types/)

### Getting Started

There are only 3 steps for making a successful API call:

1. Add your API key to the header of the request as `X-API-KEY`.
2. Add query params like `ticker` and `limit` to filter the data.
3. Execute the API request.

### Filtering the Data

You can filter the data by `ticker`, `name`, `transaction_type`, `form_type`, `limit`, and `filing_date`.

**Note**: `ticker` is required.  By default, `limit` is `100`, `name` is `null`, `transaction_type` is `null`, `form_type` is `null`, and `filing_date` is `null`.

The `name` parameter is used to filter trades by a specific insider.  You can get the list of available names for a ticker from the `/names` endpoint above.

The `transaction_type` parameter is used to filter trades by type (e.g., "Open market sale", "Gift").  You can get the list of available transaction types from the `/transaction-types` endpoint above.

The `form_type` parameter filters by SEC form: `4` for trade reports, `5` for transactions reported on annual statements, or their amendments `4/A` and `5/A`.  Each item also carries its `form_type`.

The `limit` parameter is used to specify the number of trades to return.  The maximum value is `1000`.

The `filing_date` parameter is used to specify the date of the trades.  For example, you can include filters like `filing_date_lte=2024-09-30` and `filing_date_gte=2024-01-01` to get trades between January 1, 2024 and September 30, 2024.

The available `filing_date` operations are:

* `filing_date_lte`
* `filing_date_lt`
* `filing_date_gte`
* `filing_date_gt`
* `filing_date`

### Example

```python Insider Trades theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set your query params
ticker = 'NVDA'     # stock ticker
limit = 100         # number of trades to return

# create the URL
url = (
    f'https://api.financialdatasets.ai/insider-trades'
    f'?ticker={ticker}'
    f'&limit={limit}'
)

# make API request
response = requests.get(url, headers=headers)

# parse insider_trades from the response
insider_trades = response.json().get('insider_trades')
```

### Example (with name)

```python Insider Trades theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set your query params
ticker = 'NVDA'                 # stock ticker
name = 'Jen Hsun Huang'        # insider name

# create the URL
url = (
    f'https://api.financialdatasets.ai/insider-trades'
    f'?ticker={ticker}'
    f'&name={name}'
)

# make API request
response = requests.get(url, headers=headers)

# parse insider_trades from the response
insider_trades = response.json().get('insider_trades')
```

### Example (with transaction\_type)

```python Insider Trades theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set your query params
ticker = 'NVDA'                             # stock ticker
transaction_type = 'Open market sale'       # transaction type

# create the URL
url = (
    f'https://api.financialdatasets.ai/insider-trades'
    f'?ticker={ticker}'
    f'&transaction_type={transaction_type}'
)

# make API request
response = requests.get(url, headers=headers)

# parse insider_trades from the response
insider_trades = response.json().get('insider_trades')
```

### Example (with filing\_date)

```python Insider Trades theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set your query params
ticker = 'NVDA'     
filing_date_lte = '2024-01-01' # end date
filing_date_gte = '2020-01-01' # start date

# create the URL
url = (
    f'https://api.financialdatasets.ai/insider-trades'
    f'?ticker={ticker}'
    f'&filing_date_lte={filing_date_lte}'
    f'&filing_date_gte={filing_date_gte}'
)

# make API request
response = requests.get(url, headers=headers)

# parse insider_trades from the response
insider_trades = response.json().get('insider_trades')
```


## OpenAPI

````yaml GET /insider-trades
openapi: 3.0.1
info:
  title: Financial Datasets API
  description: >-
    Stock market API with real-time and historical financial data for 27,000+
    tickers over 30+ years. Financial statements, equity prices, insider trades,
    SEC filings, and more.
  version: 1.0.0
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    name: API Support
    url: mailto:support@financialdatasets.ai
    email: support@financialdatasets.ai
  termsOfService: https://financialdatasets.ai/terms-of-use
servers:
  - url: https://api.financialdatasets.ai/
    description: Production server
security:
  - X-API-KEY: []
tags:
  - name: Financial Statements
    description: Access to income statements, balance sheets, and cash flow statements
  - name: Market Data
    description: Real-time and historical price data
  - name: Company Information
    description: Company facts like ticker, name, and description
  - name: Earnings
    description: Earnings data and related information
  - name: News
    description: Real-time and historical news articles
  - name: SEC Filings
    description: SEC filings and regulatory documents
  - name: Insider Trades
    description: Insider trading activity and transactions
  - name: Activist Ownership
    description: Activist stakes from SEC Schedule 13D filings, in real time
  - name: Beneficial Ownership
    description: >-
      Holders of more than 5% of a company's shares, from SEC Schedules 13D and
      13G
  - name: Insider Ownership
    description: Insider ownership statements from SEC Forms 3 and 5
  - name: Institutional Holdings
    description: SEC-direct 13F equity holdings of institutional investment managers
  - name: IPOs
    description: >-
      Upcoming IPOs from SEC registration statements (Form S-1), with extracted
      pre-IPO financial statements
  - name: Index Funds
    description: >-
      ETF and index-fund holdings, weights, and the funds that hold a given
      security
  - name: Financial Metrics
    description: Financial ratios, metrics, and key performance indicators
  - name: Macroeconomics
    description: Real-time and historical macroeconomic data like interest rates
  - name: KPIs
    description: Sector-specific operational KPIs extracted from earnings releases.
paths:
  /insider-trades:
    get:
      tags:
        - Insider Trades
      summary: Get insider trades
      description: >-
        Get insider trades like buys and sells for a ticker by a company
        insider.
      operationId: getInsiderTrades
      parameters:
        - name: ticker
          in: query
          description: The ticker symbol of the company.
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: 'The maximum number of transactions to return (default: 10).'
          required: false
          schema:
            type: integer
            default: 10
        - name: name
          in: query
          description: >-
            Filter by insider name (e.g., 'Jen Hsun Huang'). Use the
            /insider-trades/names endpoint to get available names for a ticker.
          required: false
          schema:
            type: string
        - name: transaction_type
          in: query
          description: >-
            Filter by transaction type (e.g., 'Open market sale', 'Gift'). Use
            the /insider-trades/transaction-types endpoint to get available
            types.
          required: false
          schema:
            type: string
        - name: form_type
          in: query
          description: >-
            Filter by SEC form type: 4 for trades, 5 for annual statements (or
            their amendments 4/A, 5/A).
          required: false
          schema:
            type: string
            enum:
              - '4'
              - 4/A
              - '5'
              - 5/A
        - name: filing_date
          in: query
          description: Filter by exact filing date in YYYY-MM-DD format.
          required: false
          schema:
            type: string
            format: date
        - name: filing_date_gte
          in: query
          description: >-
            Filter by filing date greater than or equal to this date
            (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
        - name: filing_date_lte
          in: query
          description: Filter by filing date less than or equal to this date (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
        - name: filing_date_gt
          in: query
          description: Filter by filing date greater than this date (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
        - name: filing_date_lt
          in: query
          description: Filter by filing date less than this date (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Insider trades response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsiderTradesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/PaymentRequiredError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    InsiderTradesResponse:
      type: object
      properties:
        insider_trades:
          type: array
          items:
            $ref: '#/components/schemas/InsiderTrade'
    InsiderTrade:
      type: object
      properties:
        ticker:
          type: string
          description: The ticker symbol of the company.
        issuer:
          type: string
          description: The name of the issuing company.
        name:
          type: string
          description: The name of the insider.
        title:
          type: string
          description: The title of the insider.
        is_board_director:
          type: boolean
          description: Whether the insider is a board director.
        form_type:
          type: string
          description: >-
            The SEC form type: 4 (trade report) or 5 (annual statement), or
            their amendments 4/A, 5/A.
        filing_date:
          type: string
          format: date
          description: The date the filing was accepted by the SEC.
        report_period:
          type: string
          format: date
          description: >-
            The reporting period declared on the filing. For Form 4 this is the
            date of the earliest transaction reported, and it may be earlier
            than the filing_date.
        transaction_date:
          type: string
          format: date
          description: The date of the transaction.
        transaction_code:
          type: string
          description: >-
            The SEC Form 4 transaction code (for example, `P` for open market
            purchase, `S` for open market sale, `M` for exercise of derivative
            securities, `F` for shares withheld to cover taxes, `G` for gift).
            Distinguishes the individual legs of a multi-part filing.
        transaction_type:
          type: string
          description: >-
            A human-readable description of the transaction, derived from the
            transaction_code.
        transaction_shares:
          type: number
          description: The number of shares involved in the transaction.
        transaction_price_per_share:
          type: number
          description: The price per share in the transaction.
        transaction_value:
          type: number
          description: The total value of the transaction.
        shares_owned_before_transaction:
          type: number
          description: The number of shares owned before the transaction.
        shares_owned_after_transaction:
          type: number
          description: The number of shares owned after the transaction.
        security_title:
          type: string
          description: The title of the security involved in the transaction.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: A short error message.
        message:
          type: string
          description: A more detailed error message.
  responses:
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Bad Request
            message: Invalid request parameters
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorized
            message: Invalid API key provided
    PaymentRequiredError:
      description: The request requires a paid subscription
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Payment Required
            message: >-
              This endpoint requires a paid subscription. Please upgrade your
              plan.
    NotFoundError:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Not Found
            message: Ticker XXXX not found
  securitySchemes:
    X-API-KEY:
      type: apiKey
      name: X-API-KEY
      description: API key for authentication.
      in: header

````