sentisense 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3,6 +3,17 @@ interface SentiSenseOptions {
3
3
  baseUrl?: string;
4
4
  timeout?: number;
5
5
  maxRetries?: number;
6
+ /**
7
+ * Extra token appended to the `User-Agent`, after `sentisense-node/{version}`.
8
+ *
9
+ * Use it to say what is calling on top of the SDK, so your traffic is legible in your own
10
+ * logs and in ours: a tool name and version (`"my-bot/1.4"`), and optionally an agent
11
+ * label (`"agent/research-desk"`). Node only, since browsers set the header themselves.
12
+ *
13
+ * Carriage returns and newlines are collapsed to spaces before the header is built, and an
14
+ * empty or whitespace-only value is ignored.
15
+ */
16
+ userAgentSuffix?: string;
6
17
  }
7
18
  interface StockPrice {
8
19
  ticker: string;
@@ -378,6 +389,107 @@ interface GetFundamentalsOptions {
378
389
  fiscalPeriod?: string;
379
390
  fiscalYear?: number;
380
391
  }
392
+ /**
393
+ * One session's aggregate options activity for a ticker.
394
+ *
395
+ * Every field is optional because the response omits anything it cannot compute rather than
396
+ * sending a null, so check for presence rather than comparing against `null`. Ratio and
397
+ * implied-volatility fields drop out first: `pcVol` is absent when call volume is zero.
398
+ */
399
+ interface OptionsAggregate {
400
+ /** Session date, ISO calendar day `"YYYY-MM-DD"`. */
401
+ date?: string;
402
+ callVol?: number;
403
+ putVol?: number;
404
+ callOi?: number;
405
+ putOi?: number;
406
+ /** Put/call volume ratio. */
407
+ pcVol?: number;
408
+ /** Put/call open-interest ratio. */
409
+ pcOi?: number;
410
+ /** Volume-weighted implied volatility. */
411
+ vwIv?: number;
412
+ /** At-the-money implied volatility. */
413
+ atmIv?: number;
414
+ /** `iv25p - iv25c`: positive means puts are bid up relative to calls. */
415
+ skew25d?: number;
416
+ /** Roughly 60-day and 90-day at-the-money implied volatility: the term structure. */
417
+ atmIv60?: number;
418
+ atmIv90?: number;
419
+ /** Raw 25-delta call and put implied volatilities. */
420
+ iv25c?: number;
421
+ iv25p?: number;
422
+ netDelta?: number;
423
+ notionalVol?: number;
424
+ contracts?: number;
425
+ }
426
+ /**
427
+ * Percentile context for {@link OptionsAggregate}, against that ticker's own trailing
428
+ * history rather than against other tickers.
429
+ *
430
+ * A percentile whose window holds too few observations is omitted while the baseline builds,
431
+ * which is why a covered ticker can answer with readings and no percentiles.
432
+ */
433
+ interface OptionsContext {
434
+ pcVolPctl1y?: number;
435
+ pcVolPctl5y?: number;
436
+ pcOiPctl1y?: number;
437
+ /** Where today's at-the-money implied volatility sits in its own trailing year. */
438
+ ivRank1y?: number;
439
+ skewPctl1y?: number;
440
+ observations1y?: number;
441
+ }
442
+ /** One open-interest concentration at a strike. */
443
+ interface OptionsWall {
444
+ strike?: number;
445
+ oi?: number;
446
+ }
447
+ /** Open-interest wall structure for the dossier's expiry, up to three walls a side. */
448
+ interface OptionsOiWalls {
449
+ expiry?: string;
450
+ maxPain?: number;
451
+ callWalls?: OptionsWall[];
452
+ putWalls?: OptionsWall[];
453
+ }
454
+ /** A contract whose session volume far exceeds its open interest: fresh positioning. */
455
+ interface OptionsUnusualContract {
456
+ /** Exchange-style option symbol, e.g. `"NVDA260821C00200000"`. */
457
+ contract?: string;
458
+ /** Side of the contract. Arrives lower case (`"call"` / `"put"`), so compare case-insensitively. */
459
+ type?: string;
460
+ strike?: number;
461
+ expiry?: string;
462
+ /** Days to expiry. */
463
+ dte?: number;
464
+ volume?: number;
465
+ oi?: number;
466
+ volOiRatio?: number;
467
+ premium?: number;
468
+ }
469
+ /**
470
+ * The options dossier for one stock or ETF, from `client.stocks.getOptionsSummary()`.
471
+ *
472
+ * End of day, not live: it describes the latest completed session and refreshes the
473
+ * following morning.
474
+ */
475
+ interface OptionsSummary {
476
+ /** Session the dossier describes, ISO calendar day. */
477
+ asOf?: string;
478
+ /**
479
+ * Positioning lean for the session, roughly -1 to 1, negative for put-heavy.
480
+ *
481
+ * A number on the wire, not a label. Sampled across several tickers to confirm that,
482
+ * because the field name reads like it could carry a word.
483
+ */
484
+ sentiment?: number;
485
+ /** Today's aggregate. */
486
+ latest?: OptionsAggregate;
487
+ /** Percentiles of `latest` against this ticker's own history. */
488
+ context?: OptionsContext;
489
+ oiWalls?: OptionsOiWalls;
490
+ /** Top contracts by premium. */
491
+ unusual?: OptionsUnusualContract[];
492
+ }
381
493
  type DocumentSource = "news" | "reddit" | "x" | "substack" | "youtube";
382
494
  /** Per-entity sentiment classification with resolved entity details. */
383
495
  interface SentimentEntry {
@@ -490,6 +602,20 @@ interface Quarter {
490
602
  value: string;
491
603
  label: string;
492
604
  reportDate: string;
605
+ /**
606
+ * True while this quarter's 13F filing window is still open, which is the 45 days after
607
+ * quarter end.
608
+ *
609
+ * Read it before you pick a quarter to query. The list leads with the current quarter, so
610
+ * the newest entry is pending for six weeks of every quarter, and a holders request against
611
+ * a pending quarter answers `200` with few rows or none: correct server behaviour, and
612
+ * indistinguishable from "this stock has no institutional owners" unless you checked here
613
+ * first. For a complete picture take the newest quarter with `pending` false.
614
+ *
615
+ * Typed optional so existing object literals keep compiling; the API sends the key on
616
+ * every row.
617
+ */
618
+ pending?: boolean;
493
619
  }
494
620
  interface InstitutionalFlow {
495
621
  ticker: string;
@@ -776,8 +902,14 @@ interface CongressTrade {
776
902
  firstName: string;
777
903
  lastName: string;
778
904
  chamber: "SENATE" | "HOUSE";
779
- party: string;
780
- state: string;
905
+ /**
906
+ * Party affiliation, or `null` when the disclosure carries none. Nulls are uncommon but
907
+ * real on the ticker-scoped feed, so build a label from what is present rather than
908
+ * interpolating this directly.
909
+ */
910
+ party: string | null;
911
+ /** Two-letter state, or `null` when the disclosure carries none. Same caveat as `party`. */
912
+ state: string | null;
781
913
  bioguideId: string;
782
914
  imageUrl: string | null;
783
915
  ticker: string;
@@ -890,6 +1022,20 @@ interface GetPoliticianActivityOptions extends GetPoliticiansOptions {
890
1022
  */
891
1023
  offset?: number;
892
1024
  }
1025
+ /** Paging over one member's trade history on `getMember`. */
1026
+ interface GetPoliticianMemberOptions {
1027
+ /**
1028
+ * Trades to return. Must be >= 1; the server rejects 0 or negative with HTTP 400
1029
+ * (`invalid_limit`) and caps anything above 500 at 500. Omit for the default 200,
1030
+ * which covers a member's entire history for all but a dozen of them.
1031
+ */
1032
+ limit?: number;
1033
+ /**
1034
+ * Trade offset to start from. Defaults to 0. An offset past the end returns an
1035
+ * empty `recentTrades` array, not an error.
1036
+ */
1037
+ offset?: number;
1038
+ }
893
1039
  /** Generic preview wrapper used by PRO-gated endpoints. */
894
1040
  interface EarningsEvent {
895
1041
  ticker: string;
@@ -2194,8 +2340,23 @@ declare class Politicians {
2194
2340
  * Get detailed profile for a single politician: summary, recent trades, top tickers.
2195
2341
  *
2196
2342
  * PRO-gated. Free users receive a preview-wrapped response.
2343
+ *
2344
+ * `data.recentTrades` is one page of the member's history, not all of it. Most members
2345
+ * have a few dozen disclosures and arrive complete in the default page; a handful have
2346
+ * thousands. `totalCount` on the envelope is the size of the whole history on every
2347
+ * tier, so page with `limit` and `offset` rather than reading `recentTrades.length` as
2348
+ * the total. `data.profile` and `data.topTickers` describe the whole history whatever
2349
+ * page you ask for, so `profile.totalTrades` does not shrink with a small `limit`.
2350
+ *
2351
+ * ```typescript
2352
+ * const first = await client.politicians.getMember("Ro-Khanna", { limit: 500 });
2353
+ * for (let offset = 500; offset < first.totalCount!; offset += 500) {
2354
+ * const page = await client.politicians.getMember("Ro-Khanna", { limit: 500, offset });
2355
+ * // ... page.data.recentTrades
2356
+ * }
2357
+ * ```
2197
2358
  */
2198
- getMember(slug: string): Promise<PreviewResponse<PoliticianDetail>>;
2359
+ getMember(slug: string, options?: GetPoliticianMemberOptions): Promise<PreviewResponse<PoliticianDetail>>;
2199
2360
  }
2200
2361
 
2201
2362
  interface GetStockInsightsRangeOptions {
@@ -2570,6 +2731,28 @@ declare class Stocks {
2570
2731
  * Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
2571
2732
  */
2572
2733
  getKpiTypes(ticker: string): Promise<KpiTypeEntry[]>;
2734
+ /**
2735
+ * Get the end-of-day options dossier for one stock or ETF: the session's aggregate, its
2736
+ * percentile context, the open-interest wall structure with max pain, and the contracts
2737
+ * whose volume ran far ahead of their open interest.
2738
+ *
2739
+ * End of day, not live. `asOf` is the prior trading session and the data refreshes the
2740
+ * following morning, so this is positioning, not a quote feed.
2741
+ *
2742
+ * **`data` is `null` for a ticker outside the covered universe**, which is the most
2743
+ * actively optioned US names plus the tracked ETFs, and for a covered ticker with no
2744
+ * snapshot yet. An unknown symbol behaves the same way rather than answering 404, so treat
2745
+ * a null as "no coverage", never as an error. A covered ticker still building its baseline
2746
+ * returns its raw readings with the percentiles omitted.
2747
+ *
2748
+ * Percentiles compare a ticker to its own trailing history, never to another ticker, so an
2749
+ * ETF's readings are not comparable with a single stock's.
2750
+ *
2751
+ * Tiering: a PRO key always receives the full dossier. A FREE key receives it for the first
2752
+ * ten calls each calendar month and a headline-only preview after that, with `isPreview`
2753
+ * true; calls that return a null `data` never spend that allowance.
2754
+ */
2755
+ getOptionsSummary(ticker: string): Promise<PreviewResponse<OptionsSummary | null>>;
2573
2756
  }
2574
2757
 
2575
2758
  /**
@@ -2662,6 +2845,7 @@ declare class SentiSense implements APIClient {
2662
2845
  private apiKey;
2663
2846
  private timeout;
2664
2847
  private maxRetries;
2848
+ private userAgent;
2665
2849
  readonly stocks: Stocks;
2666
2850
  readonly documents: Documents;
2667
2851
  readonly etfs: Etfs;
@@ -2724,6 +2908,6 @@ declare class APIError extends SentiSenseError {
2724
2908
  constructor(message: string, status: number, code?: string);
2725
2909
  }
2726
2910
 
2727
- declare const VERSION = "0.40.0";
2911
+ declare const VERSION = "0.42.0";
2728
2912
 
2729
- export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RecentEarningsEntry, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
2913
+ export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsContext, type OptionsOiWalls, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RecentEarningsEntry, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,17 @@ interface SentiSenseOptions {
3
3
  baseUrl?: string;
4
4
  timeout?: number;
5
5
  maxRetries?: number;
6
+ /**
7
+ * Extra token appended to the `User-Agent`, after `sentisense-node/{version}`.
8
+ *
9
+ * Use it to say what is calling on top of the SDK, so your traffic is legible in your own
10
+ * logs and in ours: a tool name and version (`"my-bot/1.4"`), and optionally an agent
11
+ * label (`"agent/research-desk"`). Node only, since browsers set the header themselves.
12
+ *
13
+ * Carriage returns and newlines are collapsed to spaces before the header is built, and an
14
+ * empty or whitespace-only value is ignored.
15
+ */
16
+ userAgentSuffix?: string;
6
17
  }
7
18
  interface StockPrice {
8
19
  ticker: string;
@@ -378,6 +389,107 @@ interface GetFundamentalsOptions {
378
389
  fiscalPeriod?: string;
379
390
  fiscalYear?: number;
380
391
  }
392
+ /**
393
+ * One session's aggregate options activity for a ticker.
394
+ *
395
+ * Every field is optional because the response omits anything it cannot compute rather than
396
+ * sending a null, so check for presence rather than comparing against `null`. Ratio and
397
+ * implied-volatility fields drop out first: `pcVol` is absent when call volume is zero.
398
+ */
399
+ interface OptionsAggregate {
400
+ /** Session date, ISO calendar day `"YYYY-MM-DD"`. */
401
+ date?: string;
402
+ callVol?: number;
403
+ putVol?: number;
404
+ callOi?: number;
405
+ putOi?: number;
406
+ /** Put/call volume ratio. */
407
+ pcVol?: number;
408
+ /** Put/call open-interest ratio. */
409
+ pcOi?: number;
410
+ /** Volume-weighted implied volatility. */
411
+ vwIv?: number;
412
+ /** At-the-money implied volatility. */
413
+ atmIv?: number;
414
+ /** `iv25p - iv25c`: positive means puts are bid up relative to calls. */
415
+ skew25d?: number;
416
+ /** Roughly 60-day and 90-day at-the-money implied volatility: the term structure. */
417
+ atmIv60?: number;
418
+ atmIv90?: number;
419
+ /** Raw 25-delta call and put implied volatilities. */
420
+ iv25c?: number;
421
+ iv25p?: number;
422
+ netDelta?: number;
423
+ notionalVol?: number;
424
+ contracts?: number;
425
+ }
426
+ /**
427
+ * Percentile context for {@link OptionsAggregate}, against that ticker's own trailing
428
+ * history rather than against other tickers.
429
+ *
430
+ * A percentile whose window holds too few observations is omitted while the baseline builds,
431
+ * which is why a covered ticker can answer with readings and no percentiles.
432
+ */
433
+ interface OptionsContext {
434
+ pcVolPctl1y?: number;
435
+ pcVolPctl5y?: number;
436
+ pcOiPctl1y?: number;
437
+ /** Where today's at-the-money implied volatility sits in its own trailing year. */
438
+ ivRank1y?: number;
439
+ skewPctl1y?: number;
440
+ observations1y?: number;
441
+ }
442
+ /** One open-interest concentration at a strike. */
443
+ interface OptionsWall {
444
+ strike?: number;
445
+ oi?: number;
446
+ }
447
+ /** Open-interest wall structure for the dossier's expiry, up to three walls a side. */
448
+ interface OptionsOiWalls {
449
+ expiry?: string;
450
+ maxPain?: number;
451
+ callWalls?: OptionsWall[];
452
+ putWalls?: OptionsWall[];
453
+ }
454
+ /** A contract whose session volume far exceeds its open interest: fresh positioning. */
455
+ interface OptionsUnusualContract {
456
+ /** Exchange-style option symbol, e.g. `"NVDA260821C00200000"`. */
457
+ contract?: string;
458
+ /** Side of the contract. Arrives lower case (`"call"` / `"put"`), so compare case-insensitively. */
459
+ type?: string;
460
+ strike?: number;
461
+ expiry?: string;
462
+ /** Days to expiry. */
463
+ dte?: number;
464
+ volume?: number;
465
+ oi?: number;
466
+ volOiRatio?: number;
467
+ premium?: number;
468
+ }
469
+ /**
470
+ * The options dossier for one stock or ETF, from `client.stocks.getOptionsSummary()`.
471
+ *
472
+ * End of day, not live: it describes the latest completed session and refreshes the
473
+ * following morning.
474
+ */
475
+ interface OptionsSummary {
476
+ /** Session the dossier describes, ISO calendar day. */
477
+ asOf?: string;
478
+ /**
479
+ * Positioning lean for the session, roughly -1 to 1, negative for put-heavy.
480
+ *
481
+ * A number on the wire, not a label. Sampled across several tickers to confirm that,
482
+ * because the field name reads like it could carry a word.
483
+ */
484
+ sentiment?: number;
485
+ /** Today's aggregate. */
486
+ latest?: OptionsAggregate;
487
+ /** Percentiles of `latest` against this ticker's own history. */
488
+ context?: OptionsContext;
489
+ oiWalls?: OptionsOiWalls;
490
+ /** Top contracts by premium. */
491
+ unusual?: OptionsUnusualContract[];
492
+ }
381
493
  type DocumentSource = "news" | "reddit" | "x" | "substack" | "youtube";
382
494
  /** Per-entity sentiment classification with resolved entity details. */
383
495
  interface SentimentEntry {
@@ -490,6 +602,20 @@ interface Quarter {
490
602
  value: string;
491
603
  label: string;
492
604
  reportDate: string;
605
+ /**
606
+ * True while this quarter's 13F filing window is still open, which is the 45 days after
607
+ * quarter end.
608
+ *
609
+ * Read it before you pick a quarter to query. The list leads with the current quarter, so
610
+ * the newest entry is pending for six weeks of every quarter, and a holders request against
611
+ * a pending quarter answers `200` with few rows or none: correct server behaviour, and
612
+ * indistinguishable from "this stock has no institutional owners" unless you checked here
613
+ * first. For a complete picture take the newest quarter with `pending` false.
614
+ *
615
+ * Typed optional so existing object literals keep compiling; the API sends the key on
616
+ * every row.
617
+ */
618
+ pending?: boolean;
493
619
  }
494
620
  interface InstitutionalFlow {
495
621
  ticker: string;
@@ -776,8 +902,14 @@ interface CongressTrade {
776
902
  firstName: string;
777
903
  lastName: string;
778
904
  chamber: "SENATE" | "HOUSE";
779
- party: string;
780
- state: string;
905
+ /**
906
+ * Party affiliation, or `null` when the disclosure carries none. Nulls are uncommon but
907
+ * real on the ticker-scoped feed, so build a label from what is present rather than
908
+ * interpolating this directly.
909
+ */
910
+ party: string | null;
911
+ /** Two-letter state, or `null` when the disclosure carries none. Same caveat as `party`. */
912
+ state: string | null;
781
913
  bioguideId: string;
782
914
  imageUrl: string | null;
783
915
  ticker: string;
@@ -890,6 +1022,20 @@ interface GetPoliticianActivityOptions extends GetPoliticiansOptions {
890
1022
  */
891
1023
  offset?: number;
892
1024
  }
1025
+ /** Paging over one member's trade history on `getMember`. */
1026
+ interface GetPoliticianMemberOptions {
1027
+ /**
1028
+ * Trades to return. Must be >= 1; the server rejects 0 or negative with HTTP 400
1029
+ * (`invalid_limit`) and caps anything above 500 at 500. Omit for the default 200,
1030
+ * which covers a member's entire history for all but a dozen of them.
1031
+ */
1032
+ limit?: number;
1033
+ /**
1034
+ * Trade offset to start from. Defaults to 0. An offset past the end returns an
1035
+ * empty `recentTrades` array, not an error.
1036
+ */
1037
+ offset?: number;
1038
+ }
893
1039
  /** Generic preview wrapper used by PRO-gated endpoints. */
894
1040
  interface EarningsEvent {
895
1041
  ticker: string;
@@ -2194,8 +2340,23 @@ declare class Politicians {
2194
2340
  * Get detailed profile for a single politician: summary, recent trades, top tickers.
2195
2341
  *
2196
2342
  * PRO-gated. Free users receive a preview-wrapped response.
2343
+ *
2344
+ * `data.recentTrades` is one page of the member's history, not all of it. Most members
2345
+ * have a few dozen disclosures and arrive complete in the default page; a handful have
2346
+ * thousands. `totalCount` on the envelope is the size of the whole history on every
2347
+ * tier, so page with `limit` and `offset` rather than reading `recentTrades.length` as
2348
+ * the total. `data.profile` and `data.topTickers` describe the whole history whatever
2349
+ * page you ask for, so `profile.totalTrades` does not shrink with a small `limit`.
2350
+ *
2351
+ * ```typescript
2352
+ * const first = await client.politicians.getMember("Ro-Khanna", { limit: 500 });
2353
+ * for (let offset = 500; offset < first.totalCount!; offset += 500) {
2354
+ * const page = await client.politicians.getMember("Ro-Khanna", { limit: 500, offset });
2355
+ * // ... page.data.recentTrades
2356
+ * }
2357
+ * ```
2197
2358
  */
2198
- getMember(slug: string): Promise<PreviewResponse<PoliticianDetail>>;
2359
+ getMember(slug: string, options?: GetPoliticianMemberOptions): Promise<PreviewResponse<PoliticianDetail>>;
2199
2360
  }
2200
2361
 
2201
2362
  interface GetStockInsightsRangeOptions {
@@ -2570,6 +2731,28 @@ declare class Stocks {
2570
2731
  * Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
2571
2732
  */
2572
2733
  getKpiTypes(ticker: string): Promise<KpiTypeEntry[]>;
2734
+ /**
2735
+ * Get the end-of-day options dossier for one stock or ETF: the session's aggregate, its
2736
+ * percentile context, the open-interest wall structure with max pain, and the contracts
2737
+ * whose volume ran far ahead of their open interest.
2738
+ *
2739
+ * End of day, not live. `asOf` is the prior trading session and the data refreshes the
2740
+ * following morning, so this is positioning, not a quote feed.
2741
+ *
2742
+ * **`data` is `null` for a ticker outside the covered universe**, which is the most
2743
+ * actively optioned US names plus the tracked ETFs, and for a covered ticker with no
2744
+ * snapshot yet. An unknown symbol behaves the same way rather than answering 404, so treat
2745
+ * a null as "no coverage", never as an error. A covered ticker still building its baseline
2746
+ * returns its raw readings with the percentiles omitted.
2747
+ *
2748
+ * Percentiles compare a ticker to its own trailing history, never to another ticker, so an
2749
+ * ETF's readings are not comparable with a single stock's.
2750
+ *
2751
+ * Tiering: a PRO key always receives the full dossier. A FREE key receives it for the first
2752
+ * ten calls each calendar month and a headline-only preview after that, with `isPreview`
2753
+ * true; calls that return a null `data` never spend that allowance.
2754
+ */
2755
+ getOptionsSummary(ticker: string): Promise<PreviewResponse<OptionsSummary | null>>;
2573
2756
  }
2574
2757
 
2575
2758
  /**
@@ -2662,6 +2845,7 @@ declare class SentiSense implements APIClient {
2662
2845
  private apiKey;
2663
2846
  private timeout;
2664
2847
  private maxRetries;
2848
+ private userAgent;
2665
2849
  readonly stocks: Stocks;
2666
2850
  readonly documents: Documents;
2667
2851
  readonly etfs: Etfs;
@@ -2724,6 +2908,6 @@ declare class APIError extends SentiSenseError {
2724
2908
  constructor(message: string, status: number, code?: string);
2725
2909
  }
2726
2910
 
2727
- declare const VERSION = "0.40.0";
2911
+ declare const VERSION = "0.42.0";
2728
2912
 
2729
- export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RecentEarningsEntry, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
2913
+ export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsContext, type OptionsOiWalls, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RecentEarningsEntry, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
package/dist/index.mjs CHANGED
@@ -398,10 +398,26 @@ var Politicians = class {
398
398
  * Get detailed profile for a single politician: summary, recent trades, top tickers.
399
399
  *
400
400
  * PRO-gated. Free users receive a preview-wrapped response.
401
+ *
402
+ * `data.recentTrades` is one page of the member's history, not all of it. Most members
403
+ * have a few dozen disclosures and arrive complete in the default page; a handful have
404
+ * thousands. `totalCount` on the envelope is the size of the whole history on every
405
+ * tier, so page with `limit` and `offset` rather than reading `recentTrades.length` as
406
+ * the total. `data.profile` and `data.topTickers` describe the whole history whatever
407
+ * page you ask for, so `profile.totalTrades` does not shrink with a small `limit`.
408
+ *
409
+ * ```typescript
410
+ * const first = await client.politicians.getMember("Ro-Khanna", { limit: 500 });
411
+ * for (let offset = 500; offset < first.totalCount!; offset += 500) {
412
+ * const page = await client.politicians.getMember("Ro-Khanna", { limit: 500, offset });
413
+ * // ... page.data.recentTrades
414
+ * }
415
+ * ```
401
416
  */
402
- async getMember(slug) {
417
+ async getMember(slug, options) {
403
418
  return this.client.get(
404
- `/api/v1/politicians/member/${encodeURIComponent(slug)}`
419
+ `/api/v1/politicians/member/${encodeURIComponent(slug)}`,
420
+ options
405
421
  );
406
422
  }
407
423
  };
@@ -881,6 +897,32 @@ var Stocks = class {
881
897
  `/api/v1/stocks/${encodeURIComponent(ticker.toUpperCase())}/kpis/types`
882
898
  );
883
899
  }
900
+ /**
901
+ * Get the end-of-day options dossier for one stock or ETF: the session's aggregate, its
902
+ * percentile context, the open-interest wall structure with max pain, and the contracts
903
+ * whose volume ran far ahead of their open interest.
904
+ *
905
+ * End of day, not live. `asOf` is the prior trading session and the data refreshes the
906
+ * following morning, so this is positioning, not a quote feed.
907
+ *
908
+ * **`data` is `null` for a ticker outside the covered universe**, which is the most
909
+ * actively optioned US names plus the tracked ETFs, and for a covered ticker with no
910
+ * snapshot yet. An unknown symbol behaves the same way rather than answering 404, so treat
911
+ * a null as "no coverage", never as an error. A covered ticker still building its baseline
912
+ * returns its raw readings with the percentiles omitted.
913
+ *
914
+ * Percentiles compare a ticker to its own trailing history, never to another ticker, so an
915
+ * ETF's readings are not comparable with a single stock's.
916
+ *
917
+ * Tiering: a PRO key always receives the full dossier. A FREE key receives it for the first
918
+ * ten calls each calendar month and a headline-only preview after that, with `isPreview`
919
+ * true; calls that return a null `data` never spend that allowance.
920
+ */
921
+ async getOptionsSummary(ticker) {
922
+ return this.client.get(
923
+ `/api/v1/stocks/${encodeURIComponent(ticker.toUpperCase())}/options/summary`
924
+ );
925
+ }
884
926
  };
885
927
 
886
928
  // src/resources/indexes.ts
@@ -960,7 +1002,7 @@ var Trackers = class {
960
1002
  };
961
1003
 
962
1004
  // src/version.ts
963
- var VERSION = "0.40.0";
1005
+ var VERSION = "0.42.0";
964
1006
 
965
1007
  // src/client.ts
966
1008
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";
@@ -990,6 +1032,8 @@ var SentiSense = class {
990
1032
  this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
991
1033
  this.timeout = options.timeout ?? DEFAULT_TIMEOUT;
992
1034
  this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
1035
+ const suffix = options.userAgentSuffix?.replace(/[\r\n]+/g, " ").trim();
1036
+ this.userAgent = suffix ? `sentisense-node/${VERSION} ${suffix}` : `sentisense-node/${VERSION}`;
993
1037
  this.stocks = new Stocks(this);
994
1038
  this.documents = new Documents(this);
995
1039
  this.etfs = new Etfs(this);
@@ -1018,7 +1062,7 @@ var SentiSense = class {
1018
1062
  headers["X-SentiSense-API-Key"] = this.apiKey;
1019
1063
  }
1020
1064
  if (typeof process !== "undefined" && process.versions?.node) {
1021
- headers["User-Agent"] = `sentisense-node/${VERSION}`;
1065
+ headers["User-Agent"] = this.userAgent;
1022
1066
  }
1023
1067
  let delayMs = 0;
1024
1068
  for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
@@ -1099,7 +1143,7 @@ var SentiSense = class {
1099
1143
  headers["X-SentiSense-API-Key"] = this.apiKey;
1100
1144
  }
1101
1145
  if (typeof process !== "undefined" && process.versions?.node) {
1102
- headers["User-Agent"] = `sentisense-node/${VERSION}`;
1146
+ headers["User-Agent"] = this.userAgent;
1103
1147
  }
1104
1148
  const controller = new AbortController();
1105
1149
  const timer = setTimeout(() => controller.abort(), this.timeout);