{
  "openapi": "3.1.0",
  "info": {
    "title": "Insidewell API API",
    "version": "1.0.1",
    "summary": "SEC Form 4 insider trading API: the latest insider transactions (open-market buys and sales, grants, option exercises and more) from EDGAR, refreshed about once a minute, with ticker, insider, role, transaction code, shares, price, dollar value, shares owned after, Rule 10b5-1 flag and the filing link. Filters: ticker, insider, code, minimum value, date range, role, 10b5-1 plan. Plus cluster buys (2+ insiders buying within 7 days). REST + MCP server. Information only, not investment advice.",
    "description": "Every SEC Form 4 insider trade, pulled from EDGAR about once a minute and cleaned into one table: filter by ticker, insider, buy or sale, dollar value and dates, or ask for cluster buys (2+ insiders buying the same stock within 7 days). For traders, analysts, newsletters, fintech builders and AI agents. Free tier, no key; plans from $19/month.\n\nFree tier: Up to 100 trades per call; 20 calls a minute per IP on the free tier. Free tier: 100 calls a day per IP, no key. Paid keys from $19/month (see Get an API key). Rolling 45-day window of Form 4 and 4/A filings, pulled from SEC EDGAR about once a minute; each response says when the data was last updated. Non-derivative transactions (common stock and similar); option grants and other derivative rows are not included. Joint filings are attributed to the first reporting owner. Information only, not investment advice. No key needed. Remote MCP server: https://insidewell-api.cybermax-tools.workers.dev/mcp\n\nPricing: free tier 100 calls/day per IP, no key. Paid API keys: Watchlist $19/month = 10,000 calls/month; Desk $49/month = 50,000 calls/month; Fund $99/month = 150,000 calls/month; Pay as you go $5 = 2,000 calls (one-time pack); Watchlist yearly $190/year = 10,000 calls/month; Desk yearly $490/year = 50,000 calls/month; Fund yearly $990/year = 150,000 calls/month. Get a key: https://insidewell-api.cybermax-tools.workers.dev/docs#pricing",
    "contact": {
      "name": "CyberMax",
      "url": "https://cybermax-tools-cybermax.static.hf.space/"
    },
    "license": {
      "name": "Proprietary (free tier + paid API keys)",
      "identifier": "LicenseRef-CyberMax"
    },
    "x-pricing": {
      "api": "Insidewell API",
      "currency": "USD",
      "free": {
        "price": 0,
        "callsPerDayPerIp": 100,
        "perMinutePerIp": 20,
        "key": "none needed"
      },
      "plans": [
        {
          "id": "watchlist",
          "name": "Watchlist",
          "price": 19,
          "billing": "per month",
          "calls": 10000,
          "per": "calendar month (UTC)",
          "perMinute": 30,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/watchlist?s=openapi"
        },
        {
          "id": "desk",
          "name": "Desk",
          "price": 49,
          "billing": "per month",
          "calls": 50000,
          "per": "calendar month (UTC)",
          "perMinute": 60,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/desk?s=openapi"
        },
        {
          "id": "fund",
          "name": "Fund",
          "price": 99,
          "billing": "per month",
          "calls": 150000,
          "per": "calendar month (UTC)",
          "perMinute": 120,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/fund?s=openapi"
        },
        {
          "id": "payg",
          "name": "Pay as you go",
          "price": 5,
          "billing": "one-time",
          "calls": 2000,
          "per": "until used",
          "perMinute": 30,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/payg?s=openapi"
        },
        {
          "id": "watchlist-yearly",
          "name": "Watchlist yearly",
          "price": 190,
          "billing": "per year",
          "calls": 10000,
          "per": "calendar month (UTC)",
          "perMinute": 30,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/watchlist-yearly?s=openapi"
        },
        {
          "id": "desk-yearly",
          "name": "Desk yearly",
          "price": 490,
          "billing": "per year",
          "calls": 50000,
          "per": "calendar month (UTC)",
          "perMinute": 60,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/desk-yearly?s=openapi"
        },
        {
          "id": "fund-yearly",
          "name": "Fund yearly",
          "price": 990,
          "billing": "per year",
          "calls": 150000,
          "per": "calendar month (UTC)",
          "perMinute": 120,
          "buy": "https://insidewell-api.cybermax-tools.workers.dev/buy/fund-yearly?s=openapi"
        }
      ],
      "unit": "calls",
      "howToUse": {
        "header": "x-api-key: YOUR_KEY",
        "alt": [
          "Authorization: Bearer YOUR_KEY",
          "?key=YOUR_KEY"
        ],
        "mcp": "send the key as Authorization: Bearer YOUR_KEY",
        "usage": "https://insidewell-api.cybermax-tools.workers.dev/key"
      },
      "manageKey": "https://insidewell-api.cybermax-tools.workers.dev/manage",
      "payments": "Stripe Checkout: card, Apple Pay, Google Pay, Link; sales tax/VAT handled by Stripe. Cancel any time at https://insidewell-api.cybermax-tools.workers.dev/manage."
    }
  },
  "servers": [
    {
      "url": "https://insidewell-api.cybermax-tools.workers.dev"
    }
  ],
  "paths": {
    "/api/trades": {
      "get": {
        "tags": [
          "Insidewell API"
        ],
        "summary": "Latest insider trades from SEC Form 4, filtered",
        "description": "Newest filed first. Each row: ticker, issuer, insider name, CIK and role (director/officer/10% owner, title), transaction date, code and type, acquired/disposed, shares, price, dollar value, shares owned after, direct/indirect, Rule 10b5-1 flag, form type, accession number, filed date and the EDGAR filing link. Default: open-market buys and sales (P,S) filed in the last 7 days.",
        "operationId": "insiderTradesGet",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "description": "One ticker or up to 25, comma separated (e.g. NVDA,AAPL). Empty = every company",
            "schema": {
              "type": "string"
            },
            "example": ""
          },
          {
            "name": "insider",
            "in": "query",
            "required": false,
            "description": "Insider name (part of it, e.g. musk) or their SEC CIK number",
            "schema": {
              "type": "string"
            },
            "example": ""
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "Transaction codes: P = open-market buy, S = sale (default P,S); also A (grant), M (option exercise), F (tax withholding), G (gift) ... or all",
            "schema": {
              "type": "string",
              "default": "P,S"
            },
            "example": "P"
          },
          {
            "name": "minValue",
            "in": "query",
            "required": false,
            "description": "Only trades worth at least this many US dollars (shares × price)",
            "schema": {
              "type": "number",
              "default": 0
            },
            "example": "100000"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Trade date from (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Trade date to (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Filed in the last N days when no from date is given (1-45)",
            "schema": {
              "type": "integer",
              "default": 7
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "description": "director, officer or ten_percent_owner",
            "schema": {
              "type": "string",
              "enum": [
                "director",
                "officer",
                "ten_percent_owner"
              ]
            }
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "description": "Rule 10b5-1 trading plans: exclude (only discretionary trades) or only",
            "schema": {
              "type": "string",
              "enum": [
                "exclude",
                "only"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows (1-100)",
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Skip rows (paging, up to 2000)",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "query": {
                    "ticker": [
                      "MNSO",
                      "PRTA",
                      "CRBG"
                    ],
                    "insider": null,
                    "codes": [
                      "P"
                    ],
                    "minValue": 100000,
                    "from": null,
                    "to": null,
                    "filedSince": "2026-09-23",
                    "role": null,
                    "plan": null,
                    "limit": 3,
                    "offset": 0
                  },
                  "count": 3,
                  "more": false,
                  "trades": [
                    {
                      "accession_number": "0001104659-26-112076",
                      "seq": 0,
                      "filed_at": "2026-09-30",
                      "form_type": "4",
                      "transaction_date": "2026-09-29",
                      "ticker": "MNSO",
                      "issuer_name": "MINISO Group Holding Ltd",
                      "issuer_cik": "0001815846",
                      "owner_name": "Zhang Jingjing Eason",
                      "owner_cik": "0002111254",
                      "owner_role": "VP and Chief Financial Officer",
                      "is_director": false,
                      "is_officer": true,
                      "is_ten_percent_owner": false,
                      "joint_filers": 1,
                      "transaction_code": "P",
                      "transaction_type": "Open-market or private purchase",
                      "acquired_disposed": "A",
                      "is_open_market": true,
                      "shares": 150600,
                      "price_per_share": 2.2583,
                      "total_value_usd": 340099.98,
                      "shares_owned_after": 394474,
                      "direct_or_indirect": "D",
                      "ownership_nature": null,
                      "security_title": "Ordinary Shares",
                      "rule_10b5_1": false,
                      "filing_url": "https://www.sec.gov/Archives/edgar/data/2111254/000110465926112076/0001104659-26-112076-index.htm"
                    },
                    {
                      "accession_number": "0001045463-26-000017",
                      "seq": 0,
                      "filed_at": "2026-09-29",
                      "form_type": "4",
                      "transaction_date": "2026-09-28",
                      "ticker": "PRTA",
                      "issuer_name": "PROTHENA CORP PUBLIC LTD CO",
                      "issuer_cik": "0001559053",
                      "owner_name": "SCULLY WILLIAM P",
                      "owner_cik": "0001045463",
                      "owner_role": "10% owner",
                      "is_director": false,
                      "is_officer": false,
                      "is_ten_percent_owner": true,
                      "joint_filers": 1,
                      "transaction_code": "P",
                      "transaction_type": "Open-market or private purchase",
                      "acquired_disposed": "A",
                      "is_open_market": true,
                      "shares": 103500,
                      "price_per_share": 8.5978,
                      "total_value_usd": 889872.3,
                      "shares_owned_after": 187000,
                      "direct_or_indirect": "I",
                      "ownership_nature": "By Manatee Equity Fund LLC",
                      "security_title": "Ordinary Shares, par value $0.01 per share",
                      "rule_10b5_1": false,
                      "filing_url": "https://www.sec.gov/Archives/edgar/data/1559053/000104546326000017/0001045463-26-000017-index.htm"
                    },
                    {
                      "accession_number": "0001193125-26-407701",
                      "seq": 0,
                      "filed_at": "2026-09-29",
                      "form_type": "4",
                      "transaction_date": "2026-09-25",
                      "ticker": "CRBG",
                      "issuer_name": "Corebridge Financial, Inc.",
                      "issuer_cik": "0001889539",
                      "owner_name": "NIPPON LIFE INSURANCE CO",
                      "owner_cik": "0000905591",
                      "owner_role": "10% owner",
                      "is_director": false,
                      "is_officer": false,
                      "is_ten_percent_owner": true,
                      "joint_filers": 1,
                      "transaction_code": "P",
                      "transaction_type": "Open-market or private purchase",
                      "acquired_disposed": "A",
                      "is_open_market": true,
                      "shares": 178840,
                      "price_per_share": 34.5232,
                      "total_value_usd": 6174129.09,
                      "shares_owned_after": 124773872,
                      "direct_or_indirect": "D",
                      "ownership_nature": null,
                      "security_title": "Common Stock",
                      "rule_10b5_1": true,
                      "filing_url": "https://www.sec.gov/Archives/edgar/data/1889539/000119312526407701/0001193125-26-407701-index.htm"
                    }
                  ],
                  "data": {
                    "source": "SEC EDGAR Form 4 and 4/A filings (public domain), pulled about once a minute",
                    "updated": "2026-09-30T12:27:18.747Z",
                    "filed_from": "2026-09-28",
                    "filed_to": "2026-09-30"
                  },
                  "disclaimer": "Information only, not investment advice. Data: SEC EDGAR Form 4 filings (public domain), as filed by insiders; check the linked filing before relying on any row. Not affiliated with or endorsed by the SEC."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (100/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Insidewell API"
        ],
        "summary": "Latest insider trades from SEC Form 4, filtered",
        "description": "Newest filed first. Each row: ticker, issuer, insider name, CIK and role (director/officer/10% owner, title), transaction date, code and type, acquired/disposed, shares, price, dollar value, shares owned after, direct/indirect, Rule 10b5-1 flag, form type, accession number, filed date and the EDGAR filing link. Default: open-market buys and sales (P,S) filed in the last 7 days.",
        "operationId": "insiderTradesPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ticker": {
                    "type": "string",
                    "description": "One ticker or up to 25, comma separated (e.g. NVDA,AAPL). Empty = every company"
                  },
                  "insider": {
                    "type": "string",
                    "description": "Insider name (part of it, e.g. musk) or their SEC CIK number"
                  },
                  "code": {
                    "type": "string",
                    "default": "P,S",
                    "description": "Transaction codes: P = open-market buy, S = sale (default P,S); also A (grant), M (option exercise), F (tax withholding), G (gift) ... or all"
                  },
                  "minValue": {
                    "type": "number",
                    "default": 0,
                    "description": "Only trades worth at least this many US dollars (shares × price)"
                  },
                  "from": {
                    "type": "string",
                    "format": "date",
                    "description": "Trade date from (YYYY-MM-DD)"
                  },
                  "to": {
                    "type": "string",
                    "format": "date",
                    "description": "Trade date to (YYYY-MM-DD)"
                  },
                  "days": {
                    "type": "integer",
                    "default": 7,
                    "description": "Filed in the last N days when no from date is given (1-45)"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "director",
                      "officer",
                      "ten_percent_owner"
                    ],
                    "description": "director, officer or ten_percent_owner"
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "exclude",
                      "only"
                    ],
                    "description": "Rule 10b5-1 trading plans: exclude (only discretionary trades) or only"
                  },
                  "limit": {
                    "type": "integer",
                    "default": 50,
                    "description": "Rows (1-100)"
                  },
                  "offset": {
                    "type": "integer",
                    "default": 0,
                    "description": "Skip rows (paging, up to 2000)"
                  }
                }
              },
              "example": {
                "ticker": "NVDA,AAPL",
                "code": "P,S",
                "minValue": 100000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "query": {
                    "ticker": [
                      "MNSO",
                      "PRTA",
                      "CRBG"
                    ],
                    "insider": null,
                    "codes": [
                      "P"
                    ],
                    "minValue": 100000,
                    "from": null,
                    "to": null,
                    "filedSince": "2026-09-23",
                    "role": null,
                    "plan": null,
                    "limit": 3,
                    "offset": 0
                  },
                  "count": 3,
                  "more": false,
                  "trades": [
                    {
                      "accession_number": "0001104659-26-112076",
                      "seq": 0,
                      "filed_at": "2026-09-30",
                      "form_type": "4",
                      "transaction_date": "2026-09-29",
                      "ticker": "MNSO",
                      "issuer_name": "MINISO Group Holding Ltd",
                      "issuer_cik": "0001815846",
                      "owner_name": "Zhang Jingjing Eason",
                      "owner_cik": "0002111254",
                      "owner_role": "VP and Chief Financial Officer",
                      "is_director": false,
                      "is_officer": true,
                      "is_ten_percent_owner": false,
                      "joint_filers": 1,
                      "transaction_code": "P",
                      "transaction_type": "Open-market or private purchase",
                      "acquired_disposed": "A",
                      "is_open_market": true,
                      "shares": 150600,
                      "price_per_share": 2.2583,
                      "total_value_usd": 340099.98,
                      "shares_owned_after": 394474,
                      "direct_or_indirect": "D",
                      "ownership_nature": null,
                      "security_title": "Ordinary Shares",
                      "rule_10b5_1": false,
                      "filing_url": "https://www.sec.gov/Archives/edgar/data/2111254/000110465926112076/0001104659-26-112076-index.htm"
                    },
                    {
                      "accession_number": "0001045463-26-000017",
                      "seq": 0,
                      "filed_at": "2026-09-29",
                      "form_type": "4",
                      "transaction_date": "2026-09-28",
                      "ticker": "PRTA",
                      "issuer_name": "PROTHENA CORP PUBLIC LTD CO",
                      "issuer_cik": "0001559053",
                      "owner_name": "SCULLY WILLIAM P",
                      "owner_cik": "0001045463",
                      "owner_role": "10% owner",
                      "is_director": false,
                      "is_officer": false,
                      "is_ten_percent_owner": true,
                      "joint_filers": 1,
                      "transaction_code": "P",
                      "transaction_type": "Open-market or private purchase",
                      "acquired_disposed": "A",
                      "is_open_market": true,
                      "shares": 103500,
                      "price_per_share": 8.5978,
                      "total_value_usd": 889872.3,
                      "shares_owned_after": 187000,
                      "direct_or_indirect": "I",
                      "ownership_nature": "By Manatee Equity Fund LLC",
                      "security_title": "Ordinary Shares, par value $0.01 per share",
                      "rule_10b5_1": false,
                      "filing_url": "https://www.sec.gov/Archives/edgar/data/1559053/000104546326000017/0001045463-26-000017-index.htm"
                    },
                    {
                      "accession_number": "0001193125-26-407701",
                      "seq": 0,
                      "filed_at": "2026-09-29",
                      "form_type": "4",
                      "transaction_date": "2026-09-25",
                      "ticker": "CRBG",
                      "issuer_name": "Corebridge Financial, Inc.",
                      "issuer_cik": "0001889539",
                      "owner_name": "NIPPON LIFE INSURANCE CO",
                      "owner_cik": "0000905591",
                      "owner_role": "10% owner",
                      "is_director": false,
                      "is_officer": false,
                      "is_ten_percent_owner": true,
                      "joint_filers": 1,
                      "transaction_code": "P",
                      "transaction_type": "Open-market or private purchase",
                      "acquired_disposed": "A",
                      "is_open_market": true,
                      "shares": 178840,
                      "price_per_share": 34.5232,
                      "total_value_usd": 6174129.09,
                      "shares_owned_after": 124773872,
                      "direct_or_indirect": "D",
                      "ownership_nature": null,
                      "security_title": "Common Stock",
                      "rule_10b5_1": true,
                      "filing_url": "https://www.sec.gov/Archives/edgar/data/1889539/000119312526407701/0001193125-26-407701-index.htm"
                    }
                  ],
                  "data": {
                    "source": "SEC EDGAR Form 4 and 4/A filings (public domain), pulled about once a minute",
                    "updated": "2026-09-30T12:27:18.747Z",
                    "filed_from": "2026-09-28",
                    "filed_to": "2026-09-30"
                  },
                  "disclaimer": "Information only, not investment advice. Data: SEC EDGAR Form 4 filings (public domain), as filed by insiders; check the linked filing before relying on any row. Not affiliated with or endorsed by the SEC."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (100/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/cluster-buys": {
      "get": {
        "tags": [
          "Insidewell API"
        ],
        "summary": "Cluster buys: 2+ insiders buying the same stock within 7 days",
        "description": "Companies where several different insiders bought shares on the open market (code P) within a short window: insider count, total dollars and shares, first and last trade, each insider with role and amount, and the filing links. Most insiders first, then biggest dollars.",
        "operationId": "clusterBuysGet",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Look back N days of filings (1-45)",
            "schema": {
              "type": "integer",
              "default": 14
            },
            "example": "14"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Buys must fall within this many days of each other (1-30)",
            "schema": {
              "type": "integer",
              "default": 7
            }
          },
          {
            "name": "minInsiders",
            "in": "query",
            "required": false,
            "description": "Distinct insiders buying (2-10)",
            "schema": {
              "type": "integer",
              "default": 2
            }
          },
          {
            "name": "minValue",
            "in": "query",
            "required": false,
            "description": "Only clusters whose buys add up to at least this many US dollars",
            "schema": {
              "type": "number",
              "default": 0
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "description": "Only these tickers (comma separated)",
            "schema": {
              "type": "string"
            },
            "example": ""
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Clusters (1-100)",
            "schema": {
              "type": "integer",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (100/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Insidewell API"
        ],
        "summary": "Cluster buys: 2+ insiders buying the same stock within 7 days",
        "description": "Companies where several different insiders bought shares on the open market (code P) within a short window: insider count, total dollars and shares, first and last trade, each insider with role and amount, and the filing links. Most insiders first, then biggest dollars.",
        "operationId": "clusterBuysPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "default": 14,
                    "description": "Look back N days of filings (1-45)"
                  },
                  "window": {
                    "type": "integer",
                    "default": 7,
                    "description": "Buys must fall within this many days of each other (1-30)"
                  },
                  "minInsiders": {
                    "type": "integer",
                    "default": 2,
                    "description": "Distinct insiders buying (2-10)"
                  },
                  "minValue": {
                    "type": "number",
                    "default": 0,
                    "description": "Only clusters whose buys add up to at least this many US dollars"
                  },
                  "ticker": {
                    "type": "string",
                    "description": "Only these tickers (comma separated)"
                  },
                  "limit": {
                    "type": "integer",
                    "default": 25,
                    "description": "Clusters (1-100)"
                  }
                }
              },
              "example": {
                "days": 14,
                "minInsiders": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (100/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "tags": [
          "Insidewell API"
        ],
        "summary": "Data freshness: last update, filings and trades in the window (free, not metered)",
        "description": "When the ledger last pulled EDGAR, the filed-date range covered and counts of filings and trades.",
        "operationId": "dataStatusGet",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (100/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Insidewell API"
        ],
        "summary": "Data freshness: last update, filings and trades in the window (free, not metered)",
        "description": "When the ledger last pulled EDGAR, the filed-date range covered and counts of filings and trades.",
        "operationId": "dataStatusPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (100/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer"
          },
          "limits": {
            "type": "object"
          }
        },
        "required": [
          "error",
          "message"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Optional. Paid plan key from https://insidewell-api.cybermax-tools.workers.dev/docs#pricing; leave out for the free tier."
      },
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Same key as a Bearer token."
      }
    }
  },
  "x-mcp-server": "https://insidewell-api.cybermax-tools.workers.dev/mcp",
  "externalDocs": {
    "description": "Get an API key (pricing)",
    "url": "https://insidewell-api.cybermax-tools.workers.dev/docs#pricing"
  },
  "security": [
    {},
    {
      "ApiKeyHeader": []
    },
    {
      "BearerKey": []
    }
  ]
}