sentisense 0.41.0 → 0.43.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/README.md +94 -0
- package/dist/cli.cjs +3904 -0
- package/dist/index.cjs +31 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +159 -4
- package/dist/index.d.ts +159 -4
- package/dist/index.mjs +31 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
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
|
-
|
|
780
|
-
|
|
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;
|
|
@@ -2599,6 +2731,28 @@ declare class Stocks {
|
|
|
2599
2731
|
* Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
|
|
2600
2732
|
*/
|
|
2601
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>>;
|
|
2602
2756
|
}
|
|
2603
2757
|
|
|
2604
2758
|
/**
|
|
@@ -2691,6 +2845,7 @@ declare class SentiSense implements APIClient {
|
|
|
2691
2845
|
private apiKey;
|
|
2692
2846
|
private timeout;
|
|
2693
2847
|
private maxRetries;
|
|
2848
|
+
private userAgent;
|
|
2694
2849
|
readonly stocks: Stocks;
|
|
2695
2850
|
readonly documents: Documents;
|
|
2696
2851
|
readonly etfs: Etfs;
|
|
@@ -2753,6 +2908,6 @@ declare class APIError extends SentiSenseError {
|
|
|
2753
2908
|
constructor(message: string, status: number, code?: string);
|
|
2754
2909
|
}
|
|
2755
2910
|
|
|
2756
|
-
declare const VERSION = "0.
|
|
2911
|
+
declare const VERSION = "0.43.0";
|
|
2757
2912
|
|
|
2758
|
-
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 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
|
-
|
|
780
|
-
|
|
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;
|
|
@@ -2599,6 +2731,28 @@ declare class Stocks {
|
|
|
2599
2731
|
* Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
|
|
2600
2732
|
*/
|
|
2601
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>>;
|
|
2602
2756
|
}
|
|
2603
2757
|
|
|
2604
2758
|
/**
|
|
@@ -2691,6 +2845,7 @@ declare class SentiSense implements APIClient {
|
|
|
2691
2845
|
private apiKey;
|
|
2692
2846
|
private timeout;
|
|
2693
2847
|
private maxRetries;
|
|
2848
|
+
private userAgent;
|
|
2694
2849
|
readonly stocks: Stocks;
|
|
2695
2850
|
readonly documents: Documents;
|
|
2696
2851
|
readonly etfs: Etfs;
|
|
@@ -2753,6 +2908,6 @@ declare class APIError extends SentiSenseError {
|
|
|
2753
2908
|
constructor(message: string, status: number, code?: string);
|
|
2754
2909
|
}
|
|
2755
2910
|
|
|
2756
|
-
declare const VERSION = "0.
|
|
2911
|
+
declare const VERSION = "0.43.0";
|
|
2757
2912
|
|
|
2758
|
-
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 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
|
@@ -897,6 +897,32 @@ var Stocks = class {
|
|
|
897
897
|
`/api/v1/stocks/${encodeURIComponent(ticker.toUpperCase())}/kpis/types`
|
|
898
898
|
);
|
|
899
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
|
+
}
|
|
900
926
|
};
|
|
901
927
|
|
|
902
928
|
// src/resources/indexes.ts
|
|
@@ -976,7 +1002,7 @@ var Trackers = class {
|
|
|
976
1002
|
};
|
|
977
1003
|
|
|
978
1004
|
// src/version.ts
|
|
979
|
-
var VERSION = "0.
|
|
1005
|
+
var VERSION = "0.43.0";
|
|
980
1006
|
|
|
981
1007
|
// src/client.ts
|
|
982
1008
|
var DEFAULT_BASE_URL = "https://app.sentisense.ai";
|
|
@@ -1006,6 +1032,8 @@ var SentiSense = class {
|
|
|
1006
1032
|
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
1007
1033
|
this.timeout = options.timeout ?? DEFAULT_TIMEOUT;
|
|
1008
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}`;
|
|
1009
1037
|
this.stocks = new Stocks(this);
|
|
1010
1038
|
this.documents = new Documents(this);
|
|
1011
1039
|
this.etfs = new Etfs(this);
|
|
@@ -1034,7 +1062,7 @@ var SentiSense = class {
|
|
|
1034
1062
|
headers["X-SentiSense-API-Key"] = this.apiKey;
|
|
1035
1063
|
}
|
|
1036
1064
|
if (typeof process !== "undefined" && process.versions?.node) {
|
|
1037
|
-
headers["User-Agent"] =
|
|
1065
|
+
headers["User-Agent"] = this.userAgent;
|
|
1038
1066
|
}
|
|
1039
1067
|
let delayMs = 0;
|
|
1040
1068
|
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
@@ -1115,7 +1143,7 @@ var SentiSense = class {
|
|
|
1115
1143
|
headers["X-SentiSense-API-Key"] = this.apiKey;
|
|
1116
1144
|
}
|
|
1117
1145
|
if (typeof process !== "undefined" && process.versions?.node) {
|
|
1118
|
-
headers["User-Agent"] =
|
|
1146
|
+
headers["User-Agent"] = this.userAgent;
|
|
1119
1147
|
}
|
|
1120
1148
|
const controller = new AbortController();
|
|
1121
1149
|
const timer = setTimeout(() => controller.abort(), this.timeout);
|