{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nomior-com/json-schema/nomior-com-trade-search-result-schema.json",
  "title": "TradeSearchResult",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/invest-openapi.json#/components/schemas/TradeSearchResult",
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "filters": {
      "type": "object",
      "additionalProperties": {
        "nullable": true
      },
      "description": "Source, filters and the date window actually read."
    },
    "summary": {
      "type": "object",
      "properties": {
        "trades": {
          "type": "integer"
        },
        "buys": {
          "type": "integer",
          "description": "Purchases; insider: open-market code P."
        },
        "sells": {
          "type": "integer",
          "description": "Sales; insider: open-market code S."
        },
        "exchanges": {
          "type": "integer",
          "description": "Congress only."
        },
        "awards": {
          "type": "integer",
          "description": "Insider, every line: code A."
        },
        "exercises": {
          "type": "integer",
          "description": "Insider, every line: codes M, X."
        },
        "other": {
          "type": "integer",
          "description": "Insider, every line: other codes."
        },
        "people": {
          "type": "integer",
          "description": "Distinct members or reporting owners."
        },
        "companies": {
          "type": "integer",
          "description": "Distinct listed companies."
        },
        "rangeUsd": {
          "allOf": [
            {
              "$ref": "#/$defs/CongressRange"
            },
            {
              "description": "Congress: sums of the band bounds; never a midpoint."
            }
          ]
        },
        "buyValueUsd": {
          "type": "number",
          "description": "Insider: priced purchases, USD."
        },
        "sellValueUsd": {
          "type": "number",
          "description": "Insider: priced sales, USD."
        },
        "netValueUsd": {
          "type": "number",
          "description": "Insider: buys minus sells, USD."
        },
        "unpriced": {
          "type": "integer",
          "description": "Insider: unpriced trades, counted in no value."
        }
      },
      "required": [
        "trades",
        "buys",
        "sells",
        "people",
        "companies"
      ]
    },
    "groupBy": {
      "type": "string",
      "enum": [
        "none",
        "ticker",
        "person",
        "month",
        "party",
        "sector",
        "day"
      ]
    },
    "groups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TradeGroup"
      },
      "description": "Per group, most trades first (months newest first)."
    },
    "data": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tradeId": {
                "type": "string",
                "description": "Filing id and row: \"house:20035590:1\" or \"senate:<uuid>:3\"."
              },
              "filingId": {
                "type": "string"
              },
              "member": {
                "$ref": "#/$defs/CongressMember"
              },
              "owner": {
                "type": "string",
                "enum": [
                  "self",
                  "spouse",
                  "joint",
                  "dependent"
                ],
                "description": "Whose holding: the member, a spouse, jointly, or a dependent child."
              },
              "txType": {
                "type": "string",
                "enum": [
                  "purchase",
                  "sale",
                  "sale_partial",
                  "exchange"
                ]
              },
              "txDate": {
                "type": "string",
                "maxLength": 10,
                "format": "date",
                "description": "Trade date as reported."
              },
              "notificationDate": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 10,
                "format": "date",
                "description": "When the filer learned of it (House only)."
              },
              "filedDate": {
                "type": "string",
                "maxLength": 10,
                "format": "date",
                "description": "When the report was filed: the day it became public."
              },
              "availableAt": {
                "type": "string",
                "maxLength": 40,
                "format": "date-time",
                "description": "When Nomior first read the report."
              },
              "amount": {
                "$ref": "#/$defs/CongressAmount"
              },
              "assetName": {
                "type": "string"
              },
              "assetTypeCode": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "House asset code (ST stock, OP option, GS government, ...)."
              },
              "tickerRaw": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The symbol as filed."
              },
              "instrument": {
                "$ref": "#/$defs/CongressInstrument"
              },
              "security": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "fullTicker": {
                    "type": "string"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "fullTicker",
                  "name"
                ],
                "description": "The listed security the symbol named on the trade date."
              },
              "mappingStatus": {
                "type": "string",
                "enum": [
                  "matched",
                  "ambiguous",
                  "unmatched",
                  "not_mapped"
                ],
                "description": "not_mapped: no symbol, or not a listed equity or an option on one (bonds, funds)."
              },
              "documentUrl": {
                "type": "string",
                "description": "The report on the House or Senate site."
              },
              "amends": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "filingId": {
                      "type": "string"
                    },
                    "rowNo": {
                      "type": "integer"
                    },
                    "documentUrl": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "amendment",
                        "restatement",
                        "amended_row",
                        "duplicate_row",
                        "instrument_corrected"
                      ]
                    }
                  },
                  "required": [
                    "filingId",
                    "rowNo",
                    "documentUrl",
                    "method"
                  ]
                },
                "description": "The earlier row this row amends or restates (at most one); absent for none."
              },
              "unresolvedAmendment": {
                "type": "string",
                "enum": [
                  "no_matching_row"
                ],
                "description": "An amending row paired with no earlier row (a corrected date or asset never pairs): both are served, so the trade may count twice."
              },
              "parserVersion": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "accession": {
                "type": "string",
                "description": "SEC accession number of the filing."
              },
              "formType": {
                "type": "string",
                "description": "Form filed: 4, 4/A, 5 or 5/A (an amendment ends in /A)."
              },
              "availableAt": {
                "type": "string",
                "description": "When the filing became public (UTC): SEC acceptance, else 23:59:59 New York on the filing date (availableAtBasis). Not a trade or price time."
              },
              "availableAtBasis": {
                "type": "string",
                "enum": [
                  "sec_acceptance",
                  "end_of_filing_day"
                ],
                "description": "sec_acceptance: the EDGAR acceptance time. end_of_filing_day: the source (SEC quarterly Form 3/4/5 data sets) has no acceptance time, so availableAt is the latest public moment that day, not observed."
              },
              "filingDate": {
                "type": "string",
                "description": "Date the filing was made with the SEC (YYYY-MM-DD, UTC)."
              },
              "transactionDate": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Transaction date (YYYY-MM-DD, UTC); null when the filing omits it (e.g. a holdings-only amendment)."
              },
              "ownerName": {
                "type": "string",
                "description": "Reporting person or entity exactly as filed (individuals LAST FIRST MIDDLE); for matching and provenance."
              },
              "ownerDisplayName": {
                "type": "string",
                "description": "ownerName made readable: individuals given names first, title-cased; entities title-cased, legal suffixes (Inc, LLC, LP) kept. Same identity."
              },
              "ownerCik": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Reporting owner's SEC CIK; null when not filed."
              },
              "jointFilerCount": {
                "type": "integer",
                "description": "Owners on the filing; above 1, one joint report listed under the first owner."
              },
              "officerTitle": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "As reported when the owner is an officer; null otherwise."
              },
              "isDirector": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Owner is a director of the issuer; null: flags not disclosed."
              },
              "isOfficer": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Owner is an officer of the issuer; null: flags not disclosed."
              },
              "isTenPercentOwner": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Owner holds 10% or more of the issuer; null: flags not disclosed."
              },
              "transactionCode": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "SEC Form 4 code (e.g. P purchase, S sale, A grant, M option exercise, F tax withholding, G gift); null when not reported."
              },
              "category": {
                "type": "string",
                "enum": [
                  "open_market",
                  "equity_comp",
                  "tax_withholding",
                  "gift",
                  "other"
                ],
                "description": "From the transaction code: open_market (purchases, sales), equity_comp (grants, awards, exercises), tax_withholding, gift, other."
              },
              "acquiredDisposed": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "A",
                  "D",
                  null
                ],
                "description": "A: the owner's position increased (acquired); D: it decreased (disposed). Null when not reported."
              },
              "shares": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Number of shares in the transaction. Null when not reported."
              },
              "priceUsd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Per-share price as reported, USD; null when not reported; 0 is common for grants and gifts."
              },
              "valueUsd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Shares × price, USD, non-derivative lines only. Null when the price is missing or zero (unknown, not zero), and on derivative lines (their units and prices share no basis)."
              },
              "sharesOwnedFollowing": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Shares beneficially owned right after the transaction, as reported; null when not disclosed."
              },
              "isPreArrangedPlan": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Made under a Rule 10b5-1 trading plan, per the filing; null when not disclosed."
              },
              "isLateFiling": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Filed after the SEC two-business-day deadline; null when timeliness is not determined."
              },
              "documentUrl": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The filing on SEC EDGAR; null when unavailable."
              },
              "issuerCik": {
                "type": "string",
                "description": "SEC CIK of the issuer (10 digits)."
              },
              "issuerName": {
                "type": "string",
                "description": "Issuer as filed."
              },
              "fullTicker": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Security-master listing (TICKER-REGION); null when not listed (fullTickerMissingReason)."
              },
              "issuerTicker": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "SEC's ticker (company_tickers_exchange.json) for an issuer outside the security master; null when fullTicker is set or SEC lists none."
              },
              "issuerExchange": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "SEC's exchange for issuerTicker (NYSE, Nasdaq, OTC, CBOE); null with none."
              },
              "issuerTickerAsOf": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 10,
                "format": "date",
                "description": "Date of the SEC ticker map read behind issuerTicker."
              },
              "fullTickerMissingReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "not_in_master",
                  "otc",
                  "no_sec_ticker",
                  null
                ],
                "description": "Why fullTicker is null: not_in_master (SEC lists an exchange the master does not carry it on), otc (over the counter only), no_sec_ticker (SEC lists none). Null when fullTicker is set."
              },
              "lineKind": {
                "type": "string",
                "enum": [
                  "ND",
                  "DT"
                ],
                "description": "ND: non-derivative (shares). DT: derivative (options, units, rights)."
              },
              "securityTitle": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "awardKind": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "rsu",
                  "psu",
                  "option",
                  "other",
                  null
                ],
                "description": "Codes A and M, insider-award-kind.v1: rsu (time-vesting restricted or deferred stock units), psu (vesting on performance or shareholder return), option, other (SARs, phantom stock, LTIP units, restricted shares), from the security title and its footnotes; one grant can file RSU and PSU lines of equal title and size. Null: see awardKindReason."
              },
              "awardKindReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "not_award",
                  "not_stated",
                  "conflicting_terms",
                  null
                ],
                "description": "Why awardKind is null: not_award (no grant, award or exercise), not_stated (no title or footnote names it), conflicting_terms (footnotes name units and options). Null when awardKind is set."
              },
              "priceFlagged": {
                "type": "boolean",
                "description": "Filed price over 5x above or below that day's close: shares and price as filed, valueUsd null."
              },
              "conversionOrExercisePriceUsd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Derivative lines (Table II): conversion or exercise price per underlying share, USD, as filed (XML at full precision, quarterly data sets in cents). Null otherwise or unstated."
              },
              "exerciseDate": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 10,
                "format": "date",
                "description": "Derivative lines: first exercisable date; null otherwise or unstated."
              },
              "expirationDate": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 10,
                "format": "date",
                "description": "Derivative lines: expiration date; null otherwise or unstated."
              },
              "underlyingSecurityTitle": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Derivative lines: the underlying security (e.g. Common Stock); null otherwise."
              },
              "underlyingShares": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Derivative lines: underlying shares (or other units) covered; null otherwise or unstated."
              },
              "heldChangePct": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Change in the owner's holding, percent: shares / (held after − shares) when acquired, −shares / (held after + shares) when disposed; null without a holding figure."
              }
            },
            "additionalProperties": false
          }
        }
      ],
      "description": "Trades newest filed first when groupBy is none; empty otherwise."
    },
    "page": {
      "allOf": [
        {
          "$ref": "#/$defs/Page"
        },
        {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer"
            }
          },
          "required": [
            "total"
          ]
        }
      ]
    },
    "href": {
      "type": [
        "string",
        "null"
      ]
    },
    "meta": {
      "type": "object",
      "properties": {
        "provenance": {
          "anyOf": [
            {
              "$ref": "#/$defs/CongressProvenance"
            },
            {
              "$ref": "#/$defs/InsiderProvenance"
            }
          ]
        }
      },
      "required": [
        "provenance"
      ]
    }
  },
  "required": [
    "filters",
    "summary",
    "groupBy",
    "groups",
    "data",
    "page",
    "href",
    "meta"
  ],
  "$defs": {
    "CongressAmount": {
      "type": "object",
      "properties": {
        "band": {
          "type": "integer",
          "description": "Statutory band code, 1-11; 0 for an exact figure printed in place of a band."
        },
        "label": {
          "type": "string"
        },
        "minUsd": {
          "type": "number"
        },
        "maxUsd": {
          "type": [
            "number",
            "null"
          ],
          "description": "Null for an open band (\"Over $50,000,000\")."
        },
        "exact": {
          "type": "boolean",
          "enum": [
            true
          ],
          "description": "An exact figure printed instead of a band: minUsd = maxUsd = it."
        }
      },
      "required": [
        "band",
        "label",
        "minUsd",
        "maxUsd"
      ]
    },
    "CongressInstrument": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "stock",
            "option",
            "fund",
            "bond",
            "crypto",
            "private_stock",
            "ownership_interest",
            "other",
            "unknown"
          ],
          "description": "By asset code (option: a call or put on the security, not the stock; unknown: no code printed)."
        },
        "option": {
          "$ref": "#/$defs/CongressOptionTerms"
        }
      },
      "required": [
        "kind",
        "option"
      ]
    },
    "CongressMember": {
      "type": "object",
      "properties": {
        "politicianId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The member's bioguide id; null when the filer resolved to none."
        },
        "name": {
          "type": "string",
          "description": "The member's name, else the filer as listed."
        },
        "chamber": {
          "type": "string",
          "enum": [
            "house",
            "senate"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "district": {
          "type": [
            "integer",
            "null"
          ],
          "description": "House district; 0 = at-large."
        },
        "party": {
          "type": [
            "string",
            "null"
          ],
          "description": "Party of the term the report falls in."
        }
      },
      "required": [
        "politicianId",
        "name",
        "chamber",
        "state",
        "district",
        "party"
      ]
    },
    "CongressOptionTerms": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "call",
            "put",
            null
          ]
        },
        "strikeUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "expiry": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 10,
          "format": "date",
          "description": "Expiration day."
        },
        "contracts": {
          "type": [
            "integer",
            "null"
          ]
        },
        "missingReason": {
          "type": "string",
          "enum": [
            "not_stated",
            "not_read"
          ],
          "description": "Why a term is null: not_stated (stated in no form read here) or not_read (row read before option terms were)."
        }
      },
      "required": [
        "type",
        "strikeUsd",
        "expiry",
        "contracts"
      ],
      "description": "Call or put, strike, expiry and contracts as the report states them; null unless an option."
    },
    "CongressProvenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "government_record"
          ]
        },
        "licensing": {
          "type": "string",
          "enum": [
            "statutory_restricted"
          ]
        },
        "formulaVersion": {
          "type": "string",
          "description": "Counts and range sums."
        },
        "parserVersions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "memberMapVersion": {
          "type": "string"
        },
        "securityMapVersion": {
          "type": "string"
        },
        "amendmentLinkVersion": {
          "type": "string",
          "description": "How a report is linked to the later report that amends or restates it."
        },
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 40,
          "format": "date-time",
          "description": "When the newest House index or Senate listing applied was read."
        },
        "availableAt": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 40,
          "format": "date-time",
          "description": "Newest report read among the rows."
        },
        "documentUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "The newest index applied."
        },
        "unavailableChambers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "chamber": {
                "type": "string",
                "enum": [
                  "house",
                  "senate"
                ]
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "chamber",
              "reason"
            ]
          },
          "description": "Chambers with no report read, and why: their trades are missing, not zero."
        },
        "missingDataHandling": {
          "type": "string",
          "enum": [
            "missing"
          ]
        }
      },
      "required": [
        "source",
        "kind",
        "licensing",
        "formulaVersion",
        "parserVersions",
        "memberMapVersion",
        "securityMapVersion",
        "amendmentLinkVersion",
        "asOf",
        "availableAt",
        "documentUrl",
        "unavailableChambers",
        "missingDataHandling"
      ]
    },
    "CongressRange": {
      "type": "object",
      "properties": {
        "minUsd": {
          "type": "number",
          "description": "Sum of the band minimums."
        },
        "maxUsd": {
          "type": [
            "number",
            "null"
          ],
          "description": "Sum of the band maximums; null when any band is open."
        }
      },
      "required": [
        "minUsd",
        "maxUsd"
      ]
    },
    "InsiderProvenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "SEC Forms 3/4/5"
          ]
        },
        "kind": {
          "type": "string",
          "enum": [
            "regulatory_filing"
          ]
        },
        "formulaVersion": {
          "type": "string",
          "description": "Store and reconciliation version (amendment chains, duplicate filings)."
        },
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 40,
          "format": "date-time",
          "description": "When the newest filing behind these figures became public. Null with none."
        },
        "historyFrom": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 10,
          "format": "date",
          "description": "Earliest filing date stored for this scope. Null with none."
        },
        "missingDataHandling": {
          "type": "string",
          "enum": [
            "missing"
          ]
        }
      },
      "required": [
        "source",
        "kind",
        "formulaVersion",
        "asOf",
        "historyFrom",
        "missingDataHandling"
      ]
    },
    "Page": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "description": "Maximum number of items requested for this page."
        },
        "hasMore": {
          "type": "boolean",
          "description": "True when more items exist after this page."
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque; pass verbatim as cursor for the next page. Null on the last page."
        }
      },
      "required": [
        "limit",
        "hasMore",
        "nextCursor"
      ]
    },
    "TradeGroup": {
      "type": "object",
      "properties": {
        "trades": {
          "type": "integer"
        },
        "buys": {
          "type": "integer",
          "description": "Purchases; insider: open-market code P."
        },
        "sells": {
          "type": "integer",
          "description": "Sales; insider: open-market code S."
        },
        "exchanges": {
          "type": "integer",
          "description": "Congress only."
        },
        "awards": {
          "type": "integer",
          "description": "Insider, every line: code A."
        },
        "exercises": {
          "type": "integer",
          "description": "Insider, every line: codes M, X."
        },
        "other": {
          "type": "integer",
          "description": "Insider, every line: other codes."
        },
        "people": {
          "type": "integer",
          "description": "Distinct members or reporting owners."
        },
        "companies": {
          "type": "integer",
          "description": "Distinct listed companies."
        },
        "rangeUsd": {
          "allOf": [
            {
              "$ref": "#/$defs/CongressRange"
            },
            {
              "description": "Congress: sums of the band bounds; never a midpoint."
            }
          ]
        },
        "buyValueUsd": {
          "type": "number",
          "description": "Insider: priced purchases, USD."
        },
        "sellValueUsd": {
          "type": "number",
          "description": "Insider: priced sales, USD."
        },
        "netValueUsd": {
          "type": "number",
          "description": "Insider: buys minus sells, USD."
        },
        "unpriced": {
          "type": "integer",
          "description": "Insider: unpriced trades, counted in no value."
        },
        "key": {
          "type": [
            "string",
            "null"
          ],
          "description": "fullTicker, personId (person, day), YYYY-MM, party or sector; null where it does not apply (no listed company, no resolved member)."
        },
        "label": {
          "type": "string"
        },
        "ownerDisplayName": {
          "type": "string"
        }
      },
      "required": [
        "trades",
        "buys",
        "sells",
        "people",
        "companies",
        "key",
        "label"
      ]
    }
  }
}