sentisense 0.9.1 → 0.11.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.cjs +163 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +223 -2
- package/dist/index.d.ts +223 -2
- package/dist/index.mjs +163 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -485,12 +485,157 @@ interface GetInsightsOptions {
|
|
|
485
485
|
/** Filter by insight type (e.g., `"insider_buy_signal"`). */
|
|
486
486
|
insightType?: string;
|
|
487
487
|
}
|
|
488
|
+
/** One period value in a KPI time series. */
|
|
489
|
+
interface KpiDataPoint {
|
|
490
|
+
/** e.g. "Q2 FY2026" */
|
|
491
|
+
period: string;
|
|
492
|
+
/** ISO date, e.g. "2025-12-27" */
|
|
493
|
+
date: string;
|
|
494
|
+
value: number;
|
|
495
|
+
/** Preliminary flag; often null. */
|
|
496
|
+
isEstimate?: boolean | null;
|
|
497
|
+
}
|
|
498
|
+
/** A single KPI time series for a company. */
|
|
499
|
+
interface KpiSeries {
|
|
500
|
+
/** Stable per-ticker identifier, e.g. "iphone_revenue". */
|
|
501
|
+
id: string;
|
|
502
|
+
/** Human-readable name, e.g. "iPhone Revenue". */
|
|
503
|
+
name: string;
|
|
504
|
+
/** Logical category, e.g. "product_revenue", "segment_revenue". */
|
|
505
|
+
category: string;
|
|
506
|
+
/** Unit of measurement, e.g. "USD". */
|
|
507
|
+
unit: string;
|
|
508
|
+
/** Display hint, e.g. "currency_abbreviated". */
|
|
509
|
+
displayFormat: string;
|
|
510
|
+
/** Default chart type, e.g. "bar" or "line". */
|
|
511
|
+
chartType: string;
|
|
512
|
+
/** Time-series data points. */
|
|
513
|
+
values: KpiDataPoint[];
|
|
514
|
+
/** Citation for the source filing. */
|
|
515
|
+
sourceRef?: string;
|
|
516
|
+
/** Set when the company has stopped reporting this metric. */
|
|
517
|
+
discontinued?: boolean;
|
|
518
|
+
/** Optional human-readable note about discontinuation. */
|
|
519
|
+
discontinuedNote?: string;
|
|
520
|
+
}
|
|
521
|
+
/** Full KPI payload for a company. Returned by `client.stocks.getKpis`. */
|
|
522
|
+
interface CompanyKpisData {
|
|
523
|
+
ticker: string;
|
|
524
|
+
companyName: string;
|
|
525
|
+
cik?: string;
|
|
526
|
+
lastUpdated: string;
|
|
527
|
+
kpis: KpiSeries[];
|
|
528
|
+
}
|
|
529
|
+
/** Lightweight coverage entry. Returned by `client.stocks.listKpiCoverage`. */
|
|
530
|
+
interface KpiCoverageEntry {
|
|
531
|
+
ticker: string;
|
|
532
|
+
companyName: string;
|
|
533
|
+
lastUpdated: string;
|
|
534
|
+
kpiCount: number;
|
|
535
|
+
}
|
|
536
|
+
/** Coverage listing envelope: count + list of covered tickers. */
|
|
537
|
+
interface KpiCoverageResponse {
|
|
538
|
+
count: number;
|
|
539
|
+
tickers: KpiCoverageEntry[];
|
|
540
|
+
}
|
|
541
|
+
/** Lightweight KPI metadata tuple. Returned by `client.stocks.getKpiTypes`. */
|
|
542
|
+
interface KpiTypeEntry {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
category: string;
|
|
546
|
+
chartType: string;
|
|
547
|
+
}
|
|
488
548
|
interface KBEntity {
|
|
489
549
|
entityId: string;
|
|
490
550
|
name: string;
|
|
491
551
|
[key: string]: unknown;
|
|
492
552
|
}
|
|
493
553
|
|
|
554
|
+
interface AnalystConsensus {
|
|
555
|
+
ticker: string;
|
|
556
|
+
currentPrice: number | null;
|
|
557
|
+
targetLow: number | null;
|
|
558
|
+
targetMean: number | null;
|
|
559
|
+
targetHigh: number | null;
|
|
560
|
+
targetMedian: number | null;
|
|
561
|
+
numberOfAnalysts: number;
|
|
562
|
+
upsidePercent: number | null;
|
|
563
|
+
consensusLabel: string | null;
|
|
564
|
+
recommendationMean: number | null;
|
|
565
|
+
/** PRO-only; zero in the free preview. */
|
|
566
|
+
strongBuy: number;
|
|
567
|
+
/** PRO-only; zero in the free preview. */
|
|
568
|
+
buy: number;
|
|
569
|
+
/** PRO-only; zero in the free preview. */
|
|
570
|
+
hold: number;
|
|
571
|
+
/** PRO-only; zero in the free preview. */
|
|
572
|
+
sell: number;
|
|
573
|
+
/** PRO-only; zero in the free preview. */
|
|
574
|
+
strongSell: number;
|
|
575
|
+
updatedAt: string | null;
|
|
576
|
+
}
|
|
577
|
+
interface AnalystAction {
|
|
578
|
+
ticker: string;
|
|
579
|
+
actionDate: string;
|
|
580
|
+
firm: string;
|
|
581
|
+
/** UPGRADE, DOWNGRADE, INITIATE, REITERATE, OTHER */
|
|
582
|
+
actionType: string;
|
|
583
|
+
fromGrade: string | null;
|
|
584
|
+
toGrade: string | null;
|
|
585
|
+
}
|
|
586
|
+
interface AnalystEstimate {
|
|
587
|
+
/** Fiscal period descriptor (provider-specific shape). */
|
|
588
|
+
[key: string]: unknown;
|
|
589
|
+
}
|
|
590
|
+
interface AnalystEarningsSurprise {
|
|
591
|
+
/** Past report descriptor (provider-specific shape). */
|
|
592
|
+
[key: string]: unknown;
|
|
593
|
+
}
|
|
594
|
+
interface AnalystEstimatesResponse {
|
|
595
|
+
estimates: AnalystEstimate[];
|
|
596
|
+
surprises: AnalystEarningsSurprise[];
|
|
597
|
+
}
|
|
598
|
+
interface GetAnalystActionsOptions {
|
|
599
|
+
/** Days of history to return. Default 90. */
|
|
600
|
+
lookbackDays?: number;
|
|
601
|
+
}
|
|
602
|
+
interface GetAnalystMarketActivityOptions {
|
|
603
|
+
/** Days of history to return. Default 30. */
|
|
604
|
+
lookbackDays?: number;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Wall Street analyst coverage: aggregate price targets, recommendation distribution,
|
|
608
|
+
* recent upgrade/downgrade actions, and forward EPS estimates with earnings surprise history.
|
|
609
|
+
*
|
|
610
|
+
* Free users receive the price target band (low/mean/high + analyst count + consensus label)
|
|
611
|
+
* in full -- it powers the public projection cone. The buy/hold/sell distribution counts
|
|
612
|
+
* and full action/estimate history are PRO-only.
|
|
613
|
+
*/
|
|
614
|
+
declare class Analyst {
|
|
615
|
+
private client;
|
|
616
|
+
constructor(client: APIClient);
|
|
617
|
+
/**
|
|
618
|
+
* Get the aggregate Wall Street consensus for a ticker. Returns 404 if no
|
|
619
|
+
* coverage exists.
|
|
620
|
+
*/
|
|
621
|
+
consensus(ticker: string): Promise<PreviewResponse<AnalystConsensus>>;
|
|
622
|
+
/**
|
|
623
|
+
* Get recent analyst upgrade/downgrade actions for a ticker, newest first.
|
|
624
|
+
* Free users receive the 3 most recent.
|
|
625
|
+
*/
|
|
626
|
+
actions(ticker: string, options?: GetAnalystActionsOptions): Promise<PreviewResponse<AnalystAction[]>>;
|
|
627
|
+
/**
|
|
628
|
+
* Get forward EPS estimates and earnings surprise history for a ticker.
|
|
629
|
+
* Free users receive 1 estimate (current quarter) plus the 2 most recent surprises.
|
|
630
|
+
*/
|
|
631
|
+
estimates(ticker: string): Promise<PreviewResponse<AnalystEstimatesResponse>>;
|
|
632
|
+
/**
|
|
633
|
+
* Get market-wide recent analyst actions across all covered tickers, newest first.
|
|
634
|
+
* Free users receive the 5 most recent.
|
|
635
|
+
*/
|
|
636
|
+
marketActivity(options?: GetAnalystMarketActivityOptions): Promise<PreviewResponse<AnalystAction[]>>;
|
|
637
|
+
}
|
|
638
|
+
|
|
494
639
|
declare class Documents {
|
|
495
640
|
private client;
|
|
496
641
|
constructor(client: APIClient);
|
|
@@ -610,6 +755,20 @@ declare class Politicians {
|
|
|
610
755
|
getMember(slug: string): Promise<PreviewResponse<PoliticianDetail>>;
|
|
611
756
|
}
|
|
612
757
|
|
|
758
|
+
interface GetStockInsightsRangeOptions {
|
|
759
|
+
startDate: string;
|
|
760
|
+
endDate: string;
|
|
761
|
+
urgency?: "low" | "medium" | "high";
|
|
762
|
+
insightType?: string;
|
|
763
|
+
}
|
|
764
|
+
interface GetLatestInsightsOptions {
|
|
765
|
+
limit?: number;
|
|
766
|
+
urgency?: "low" | "medium" | "high";
|
|
767
|
+
}
|
|
768
|
+
interface GetUserInsightsOptions {
|
|
769
|
+
limit?: number;
|
|
770
|
+
category?: string;
|
|
771
|
+
}
|
|
613
772
|
declare class Insights {
|
|
614
773
|
private client;
|
|
615
774
|
constructor(client: APIClient);
|
|
@@ -622,6 +781,13 @@ declare class Insights {
|
|
|
622
781
|
* (type, urgency, timestamp) showing what additional signals exist.
|
|
623
782
|
*/
|
|
624
783
|
stock(ticker: string, options?: GetInsightsOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
784
|
+
/**
|
|
785
|
+
* Get AI insights for a stock within a date range.
|
|
786
|
+
*
|
|
787
|
+
* Free users receive the top 3; PRO users receive the full list.
|
|
788
|
+
* The server returns 400 if `startDate` is after `endDate`.
|
|
789
|
+
*/
|
|
790
|
+
stockRange(ticker: string, options: GetStockInsightsRangeOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
625
791
|
/**
|
|
626
792
|
* Get AI-generated market-level insights, sorted by urgency then confidence.
|
|
627
793
|
*
|
|
@@ -630,6 +796,19 @@ declare class Insights {
|
|
|
630
796
|
* the top 5 insights in full, and a `locked` array with metadata-only entries.
|
|
631
797
|
*/
|
|
632
798
|
market(): Promise<Insight[] | InsightPreviewResponse>;
|
|
799
|
+
/**
|
|
800
|
+
* Get the latest AI insights across all tracked stocks, newest first.
|
|
801
|
+
*
|
|
802
|
+
* Free users receive the top 5; PRO users receive up to `limit` (clamped to 1-200).
|
|
803
|
+
*/
|
|
804
|
+
latest(options?: GetLatestInsightsOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
805
|
+
/**
|
|
806
|
+
* Get personalized insights for the authenticated user.
|
|
807
|
+
*
|
|
808
|
+
* Biased toward the user's watchlist and portfolio when available; falls back
|
|
809
|
+
* to market-level insights otherwise. API key authentication required.
|
|
810
|
+
*/
|
|
811
|
+
user(options?: GetUserInsightsOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
633
812
|
/**
|
|
634
813
|
* Get available insight types for a specific stock.
|
|
635
814
|
* No authentication required.
|
|
@@ -650,6 +829,15 @@ declare class Institutional {
|
|
|
650
829
|
getHolders(ticker: string, reportDate: string): Promise<Holder[]>;
|
|
651
830
|
/** Get activist investor positions (NEW or INCREASED). */
|
|
652
831
|
getActivists(reportDate: string): Promise<Holder[]>;
|
|
832
|
+
/**
|
|
833
|
+
* Get the full profile, summary stats, and current-quarter holdings for a
|
|
834
|
+
* specific institutional filer.
|
|
835
|
+
*
|
|
836
|
+
* Resolved by URL slug (e.g. `Berkshire-Hathaway`) or numeric SEC CIK.
|
|
837
|
+
* Free users receive the profile and top 10 holdings; PRO users receive the
|
|
838
|
+
* full holdings array. Returns 404 if the slug or CIK is unknown.
|
|
839
|
+
*/
|
|
840
|
+
getInstitutionDetail(slugOrCik: string): Promise<unknown>;
|
|
653
841
|
}
|
|
654
842
|
|
|
655
843
|
declare class KB {
|
|
@@ -732,11 +920,41 @@ declare class Stocks {
|
|
|
732
920
|
getFloat(ticker: string): Promise<FloatInfo>;
|
|
733
921
|
/** Get short volume trading data. */
|
|
734
922
|
getShortVolume(ticker: string): Promise<ShortVolume>;
|
|
923
|
+
/**
|
|
924
|
+
* Get company-specific KPI time-series for a ticker. Returns curated GAAP and
|
|
925
|
+
* non-GAAP metrics from earnings filings (e.g. iPhone unit sales, Tesla deliveries,
|
|
926
|
+
* AWS revenue).
|
|
927
|
+
*
|
|
928
|
+
* Free users receive metadata only with an empty `kpis` list; PRO users receive
|
|
929
|
+
* the full series. Returns 404 for tickers that do not yet have curated coverage.
|
|
930
|
+
*
|
|
931
|
+
* Coverage today: near-complete for the S&P 500 plus extended universe
|
|
932
|
+
* (~500 tickers). Use `listKpiCoverage()` to enumerate.
|
|
933
|
+
*/
|
|
934
|
+
getKpis(ticker: string): Promise<PreviewResponse<CompanyKpisData>>;
|
|
935
|
+
/**
|
|
936
|
+
* List every ticker with curated KPI coverage. Returns `{count, tickers: [...]}`
|
|
937
|
+
* with lightweight metadata (ticker, companyName, lastUpdated, kpiCount).
|
|
938
|
+
* Sorted alphabetically by ticker.
|
|
939
|
+
*
|
|
940
|
+
* Auth: API key required, but the call does NOT consume your monthly quota
|
|
941
|
+
* (rate-limit-per-minute still applies). [COMP-421]
|
|
942
|
+
*/
|
|
943
|
+
listKpiCoverage(): Promise<KpiCoverageResponse>;
|
|
944
|
+
/**
|
|
945
|
+
* List the KPI metadata tuples available for a ticker — `id, name, category,
|
|
946
|
+
* chartType` — without paying the cost of the full series payload. Mirrors
|
|
947
|
+
* the `/api/v1/insights/stock/{ticker}/types` precedent.
|
|
948
|
+
*
|
|
949
|
+
* Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
|
|
950
|
+
*/
|
|
951
|
+
getKpiTypes(ticker: string): Promise<KpiTypeEntry[]>;
|
|
735
952
|
}
|
|
736
953
|
|
|
737
954
|
/** @internal HTTP interface exposed to resource classes. */
|
|
738
955
|
interface APIClient {
|
|
739
956
|
get<T = unknown>(path: string, params?: object): Promise<T>;
|
|
957
|
+
post<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
740
958
|
}
|
|
741
959
|
declare class SentiSense implements APIClient {
|
|
742
960
|
private baseUrl;
|
|
@@ -749,6 +967,7 @@ declare class SentiSense implements APIClient {
|
|
|
749
967
|
readonly insider: Insider;
|
|
750
968
|
readonly politicians: Politicians;
|
|
751
969
|
readonly insights: Insights;
|
|
970
|
+
readonly analyst: Analyst;
|
|
752
971
|
readonly entityMetrics: EntityMetrics;
|
|
753
972
|
readonly marketMood: MarketMoodResource;
|
|
754
973
|
readonly marketSummary: MarketSummaryResource;
|
|
@@ -756,6 +975,8 @@ declare class SentiSense implements APIClient {
|
|
|
756
975
|
constructor(options?: SentiSenseOptions);
|
|
757
976
|
/** @internal */
|
|
758
977
|
get<T = unknown>(path: string, params?: object): Promise<T>;
|
|
978
|
+
/** @internal */
|
|
979
|
+
post<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
759
980
|
private buildUrl;
|
|
760
981
|
private handleErrorResponse;
|
|
761
982
|
}
|
|
@@ -779,6 +1000,6 @@ declare class APIError extends SentiSenseError {
|
|
|
779
1000
|
constructor(message: string, status: number, code?: string);
|
|
780
1001
|
}
|
|
781
1002
|
|
|
782
|
-
declare const VERSION = "0.
|
|
1003
|
+
declare const VERSION = "0.11.0";
|
|
783
1004
|
|
|
784
|
-
export { type AISummary, APIError, AuthenticationError, type ChartData, type ChartDataPoint, type ClusterBuy, type CongressTrade, type Document, type DocumentSource, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type GetInsiderOptions, type GetInsightsOptions, type GetPoliticiansOptions, type Holder, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionalFlow, type InstitutionalFlowsResponse, type KBEntity, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MentionCount, type MentionData, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentData, 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, VERSION, SentiSense as default };
|
|
1005
|
+
export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, AuthenticationError, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, type Document, type DocumentSource, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticiansOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionalFlow, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MentionCount, type MentionData, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentData, 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, VERSION, SentiSense as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -485,12 +485,157 @@ interface GetInsightsOptions {
|
|
|
485
485
|
/** Filter by insight type (e.g., `"insider_buy_signal"`). */
|
|
486
486
|
insightType?: string;
|
|
487
487
|
}
|
|
488
|
+
/** One period value in a KPI time series. */
|
|
489
|
+
interface KpiDataPoint {
|
|
490
|
+
/** e.g. "Q2 FY2026" */
|
|
491
|
+
period: string;
|
|
492
|
+
/** ISO date, e.g. "2025-12-27" */
|
|
493
|
+
date: string;
|
|
494
|
+
value: number;
|
|
495
|
+
/** Preliminary flag; often null. */
|
|
496
|
+
isEstimate?: boolean | null;
|
|
497
|
+
}
|
|
498
|
+
/** A single KPI time series for a company. */
|
|
499
|
+
interface KpiSeries {
|
|
500
|
+
/** Stable per-ticker identifier, e.g. "iphone_revenue". */
|
|
501
|
+
id: string;
|
|
502
|
+
/** Human-readable name, e.g. "iPhone Revenue". */
|
|
503
|
+
name: string;
|
|
504
|
+
/** Logical category, e.g. "product_revenue", "segment_revenue". */
|
|
505
|
+
category: string;
|
|
506
|
+
/** Unit of measurement, e.g. "USD". */
|
|
507
|
+
unit: string;
|
|
508
|
+
/** Display hint, e.g. "currency_abbreviated". */
|
|
509
|
+
displayFormat: string;
|
|
510
|
+
/** Default chart type, e.g. "bar" or "line". */
|
|
511
|
+
chartType: string;
|
|
512
|
+
/** Time-series data points. */
|
|
513
|
+
values: KpiDataPoint[];
|
|
514
|
+
/** Citation for the source filing. */
|
|
515
|
+
sourceRef?: string;
|
|
516
|
+
/** Set when the company has stopped reporting this metric. */
|
|
517
|
+
discontinued?: boolean;
|
|
518
|
+
/** Optional human-readable note about discontinuation. */
|
|
519
|
+
discontinuedNote?: string;
|
|
520
|
+
}
|
|
521
|
+
/** Full KPI payload for a company. Returned by `client.stocks.getKpis`. */
|
|
522
|
+
interface CompanyKpisData {
|
|
523
|
+
ticker: string;
|
|
524
|
+
companyName: string;
|
|
525
|
+
cik?: string;
|
|
526
|
+
lastUpdated: string;
|
|
527
|
+
kpis: KpiSeries[];
|
|
528
|
+
}
|
|
529
|
+
/** Lightweight coverage entry. Returned by `client.stocks.listKpiCoverage`. */
|
|
530
|
+
interface KpiCoverageEntry {
|
|
531
|
+
ticker: string;
|
|
532
|
+
companyName: string;
|
|
533
|
+
lastUpdated: string;
|
|
534
|
+
kpiCount: number;
|
|
535
|
+
}
|
|
536
|
+
/** Coverage listing envelope: count + list of covered tickers. */
|
|
537
|
+
interface KpiCoverageResponse {
|
|
538
|
+
count: number;
|
|
539
|
+
tickers: KpiCoverageEntry[];
|
|
540
|
+
}
|
|
541
|
+
/** Lightweight KPI metadata tuple. Returned by `client.stocks.getKpiTypes`. */
|
|
542
|
+
interface KpiTypeEntry {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
category: string;
|
|
546
|
+
chartType: string;
|
|
547
|
+
}
|
|
488
548
|
interface KBEntity {
|
|
489
549
|
entityId: string;
|
|
490
550
|
name: string;
|
|
491
551
|
[key: string]: unknown;
|
|
492
552
|
}
|
|
493
553
|
|
|
554
|
+
interface AnalystConsensus {
|
|
555
|
+
ticker: string;
|
|
556
|
+
currentPrice: number | null;
|
|
557
|
+
targetLow: number | null;
|
|
558
|
+
targetMean: number | null;
|
|
559
|
+
targetHigh: number | null;
|
|
560
|
+
targetMedian: number | null;
|
|
561
|
+
numberOfAnalysts: number;
|
|
562
|
+
upsidePercent: number | null;
|
|
563
|
+
consensusLabel: string | null;
|
|
564
|
+
recommendationMean: number | null;
|
|
565
|
+
/** PRO-only; zero in the free preview. */
|
|
566
|
+
strongBuy: number;
|
|
567
|
+
/** PRO-only; zero in the free preview. */
|
|
568
|
+
buy: number;
|
|
569
|
+
/** PRO-only; zero in the free preview. */
|
|
570
|
+
hold: number;
|
|
571
|
+
/** PRO-only; zero in the free preview. */
|
|
572
|
+
sell: number;
|
|
573
|
+
/** PRO-only; zero in the free preview. */
|
|
574
|
+
strongSell: number;
|
|
575
|
+
updatedAt: string | null;
|
|
576
|
+
}
|
|
577
|
+
interface AnalystAction {
|
|
578
|
+
ticker: string;
|
|
579
|
+
actionDate: string;
|
|
580
|
+
firm: string;
|
|
581
|
+
/** UPGRADE, DOWNGRADE, INITIATE, REITERATE, OTHER */
|
|
582
|
+
actionType: string;
|
|
583
|
+
fromGrade: string | null;
|
|
584
|
+
toGrade: string | null;
|
|
585
|
+
}
|
|
586
|
+
interface AnalystEstimate {
|
|
587
|
+
/** Fiscal period descriptor (provider-specific shape). */
|
|
588
|
+
[key: string]: unknown;
|
|
589
|
+
}
|
|
590
|
+
interface AnalystEarningsSurprise {
|
|
591
|
+
/** Past report descriptor (provider-specific shape). */
|
|
592
|
+
[key: string]: unknown;
|
|
593
|
+
}
|
|
594
|
+
interface AnalystEstimatesResponse {
|
|
595
|
+
estimates: AnalystEstimate[];
|
|
596
|
+
surprises: AnalystEarningsSurprise[];
|
|
597
|
+
}
|
|
598
|
+
interface GetAnalystActionsOptions {
|
|
599
|
+
/** Days of history to return. Default 90. */
|
|
600
|
+
lookbackDays?: number;
|
|
601
|
+
}
|
|
602
|
+
interface GetAnalystMarketActivityOptions {
|
|
603
|
+
/** Days of history to return. Default 30. */
|
|
604
|
+
lookbackDays?: number;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Wall Street analyst coverage: aggregate price targets, recommendation distribution,
|
|
608
|
+
* recent upgrade/downgrade actions, and forward EPS estimates with earnings surprise history.
|
|
609
|
+
*
|
|
610
|
+
* Free users receive the price target band (low/mean/high + analyst count + consensus label)
|
|
611
|
+
* in full -- it powers the public projection cone. The buy/hold/sell distribution counts
|
|
612
|
+
* and full action/estimate history are PRO-only.
|
|
613
|
+
*/
|
|
614
|
+
declare class Analyst {
|
|
615
|
+
private client;
|
|
616
|
+
constructor(client: APIClient);
|
|
617
|
+
/**
|
|
618
|
+
* Get the aggregate Wall Street consensus for a ticker. Returns 404 if no
|
|
619
|
+
* coverage exists.
|
|
620
|
+
*/
|
|
621
|
+
consensus(ticker: string): Promise<PreviewResponse<AnalystConsensus>>;
|
|
622
|
+
/**
|
|
623
|
+
* Get recent analyst upgrade/downgrade actions for a ticker, newest first.
|
|
624
|
+
* Free users receive the 3 most recent.
|
|
625
|
+
*/
|
|
626
|
+
actions(ticker: string, options?: GetAnalystActionsOptions): Promise<PreviewResponse<AnalystAction[]>>;
|
|
627
|
+
/**
|
|
628
|
+
* Get forward EPS estimates and earnings surprise history for a ticker.
|
|
629
|
+
* Free users receive 1 estimate (current quarter) plus the 2 most recent surprises.
|
|
630
|
+
*/
|
|
631
|
+
estimates(ticker: string): Promise<PreviewResponse<AnalystEstimatesResponse>>;
|
|
632
|
+
/**
|
|
633
|
+
* Get market-wide recent analyst actions across all covered tickers, newest first.
|
|
634
|
+
* Free users receive the 5 most recent.
|
|
635
|
+
*/
|
|
636
|
+
marketActivity(options?: GetAnalystMarketActivityOptions): Promise<PreviewResponse<AnalystAction[]>>;
|
|
637
|
+
}
|
|
638
|
+
|
|
494
639
|
declare class Documents {
|
|
495
640
|
private client;
|
|
496
641
|
constructor(client: APIClient);
|
|
@@ -610,6 +755,20 @@ declare class Politicians {
|
|
|
610
755
|
getMember(slug: string): Promise<PreviewResponse<PoliticianDetail>>;
|
|
611
756
|
}
|
|
612
757
|
|
|
758
|
+
interface GetStockInsightsRangeOptions {
|
|
759
|
+
startDate: string;
|
|
760
|
+
endDate: string;
|
|
761
|
+
urgency?: "low" | "medium" | "high";
|
|
762
|
+
insightType?: string;
|
|
763
|
+
}
|
|
764
|
+
interface GetLatestInsightsOptions {
|
|
765
|
+
limit?: number;
|
|
766
|
+
urgency?: "low" | "medium" | "high";
|
|
767
|
+
}
|
|
768
|
+
interface GetUserInsightsOptions {
|
|
769
|
+
limit?: number;
|
|
770
|
+
category?: string;
|
|
771
|
+
}
|
|
613
772
|
declare class Insights {
|
|
614
773
|
private client;
|
|
615
774
|
constructor(client: APIClient);
|
|
@@ -622,6 +781,13 @@ declare class Insights {
|
|
|
622
781
|
* (type, urgency, timestamp) showing what additional signals exist.
|
|
623
782
|
*/
|
|
624
783
|
stock(ticker: string, options?: GetInsightsOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
784
|
+
/**
|
|
785
|
+
* Get AI insights for a stock within a date range.
|
|
786
|
+
*
|
|
787
|
+
* Free users receive the top 3; PRO users receive the full list.
|
|
788
|
+
* The server returns 400 if `startDate` is after `endDate`.
|
|
789
|
+
*/
|
|
790
|
+
stockRange(ticker: string, options: GetStockInsightsRangeOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
625
791
|
/**
|
|
626
792
|
* Get AI-generated market-level insights, sorted by urgency then confidence.
|
|
627
793
|
*
|
|
@@ -630,6 +796,19 @@ declare class Insights {
|
|
|
630
796
|
* the top 5 insights in full, and a `locked` array with metadata-only entries.
|
|
631
797
|
*/
|
|
632
798
|
market(): Promise<Insight[] | InsightPreviewResponse>;
|
|
799
|
+
/**
|
|
800
|
+
* Get the latest AI insights across all tracked stocks, newest first.
|
|
801
|
+
*
|
|
802
|
+
* Free users receive the top 5; PRO users receive up to `limit` (clamped to 1-200).
|
|
803
|
+
*/
|
|
804
|
+
latest(options?: GetLatestInsightsOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
805
|
+
/**
|
|
806
|
+
* Get personalized insights for the authenticated user.
|
|
807
|
+
*
|
|
808
|
+
* Biased toward the user's watchlist and portfolio when available; falls back
|
|
809
|
+
* to market-level insights otherwise. API key authentication required.
|
|
810
|
+
*/
|
|
811
|
+
user(options?: GetUserInsightsOptions): Promise<Insight[] | InsightPreviewResponse>;
|
|
633
812
|
/**
|
|
634
813
|
* Get available insight types for a specific stock.
|
|
635
814
|
* No authentication required.
|
|
@@ -650,6 +829,15 @@ declare class Institutional {
|
|
|
650
829
|
getHolders(ticker: string, reportDate: string): Promise<Holder[]>;
|
|
651
830
|
/** Get activist investor positions (NEW or INCREASED). */
|
|
652
831
|
getActivists(reportDate: string): Promise<Holder[]>;
|
|
832
|
+
/**
|
|
833
|
+
* Get the full profile, summary stats, and current-quarter holdings for a
|
|
834
|
+
* specific institutional filer.
|
|
835
|
+
*
|
|
836
|
+
* Resolved by URL slug (e.g. `Berkshire-Hathaway`) or numeric SEC CIK.
|
|
837
|
+
* Free users receive the profile and top 10 holdings; PRO users receive the
|
|
838
|
+
* full holdings array. Returns 404 if the slug or CIK is unknown.
|
|
839
|
+
*/
|
|
840
|
+
getInstitutionDetail(slugOrCik: string): Promise<unknown>;
|
|
653
841
|
}
|
|
654
842
|
|
|
655
843
|
declare class KB {
|
|
@@ -732,11 +920,41 @@ declare class Stocks {
|
|
|
732
920
|
getFloat(ticker: string): Promise<FloatInfo>;
|
|
733
921
|
/** Get short volume trading data. */
|
|
734
922
|
getShortVolume(ticker: string): Promise<ShortVolume>;
|
|
923
|
+
/**
|
|
924
|
+
* Get company-specific KPI time-series for a ticker. Returns curated GAAP and
|
|
925
|
+
* non-GAAP metrics from earnings filings (e.g. iPhone unit sales, Tesla deliveries,
|
|
926
|
+
* AWS revenue).
|
|
927
|
+
*
|
|
928
|
+
* Free users receive metadata only with an empty `kpis` list; PRO users receive
|
|
929
|
+
* the full series. Returns 404 for tickers that do not yet have curated coverage.
|
|
930
|
+
*
|
|
931
|
+
* Coverage today: near-complete for the S&P 500 plus extended universe
|
|
932
|
+
* (~500 tickers). Use `listKpiCoverage()` to enumerate.
|
|
933
|
+
*/
|
|
934
|
+
getKpis(ticker: string): Promise<PreviewResponse<CompanyKpisData>>;
|
|
935
|
+
/**
|
|
936
|
+
* List every ticker with curated KPI coverage. Returns `{count, tickers: [...]}`
|
|
937
|
+
* with lightweight metadata (ticker, companyName, lastUpdated, kpiCount).
|
|
938
|
+
* Sorted alphabetically by ticker.
|
|
939
|
+
*
|
|
940
|
+
* Auth: API key required, but the call does NOT consume your monthly quota
|
|
941
|
+
* (rate-limit-per-minute still applies). [COMP-421]
|
|
942
|
+
*/
|
|
943
|
+
listKpiCoverage(): Promise<KpiCoverageResponse>;
|
|
944
|
+
/**
|
|
945
|
+
* List the KPI metadata tuples available for a ticker — `id, name, category,
|
|
946
|
+
* chartType` — without paying the cost of the full series payload. Mirrors
|
|
947
|
+
* the `/api/v1/insights/stock/{ticker}/types` precedent.
|
|
948
|
+
*
|
|
949
|
+
* Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
|
|
950
|
+
*/
|
|
951
|
+
getKpiTypes(ticker: string): Promise<KpiTypeEntry[]>;
|
|
735
952
|
}
|
|
736
953
|
|
|
737
954
|
/** @internal HTTP interface exposed to resource classes. */
|
|
738
955
|
interface APIClient {
|
|
739
956
|
get<T = unknown>(path: string, params?: object): Promise<T>;
|
|
957
|
+
post<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
740
958
|
}
|
|
741
959
|
declare class SentiSense implements APIClient {
|
|
742
960
|
private baseUrl;
|
|
@@ -749,6 +967,7 @@ declare class SentiSense implements APIClient {
|
|
|
749
967
|
readonly insider: Insider;
|
|
750
968
|
readonly politicians: Politicians;
|
|
751
969
|
readonly insights: Insights;
|
|
970
|
+
readonly analyst: Analyst;
|
|
752
971
|
readonly entityMetrics: EntityMetrics;
|
|
753
972
|
readonly marketMood: MarketMoodResource;
|
|
754
973
|
readonly marketSummary: MarketSummaryResource;
|
|
@@ -756,6 +975,8 @@ declare class SentiSense implements APIClient {
|
|
|
756
975
|
constructor(options?: SentiSenseOptions);
|
|
757
976
|
/** @internal */
|
|
758
977
|
get<T = unknown>(path: string, params?: object): Promise<T>;
|
|
978
|
+
/** @internal */
|
|
979
|
+
post<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
759
980
|
private buildUrl;
|
|
760
981
|
private handleErrorResponse;
|
|
761
982
|
}
|
|
@@ -779,6 +1000,6 @@ declare class APIError extends SentiSenseError {
|
|
|
779
1000
|
constructor(message: string, status: number, code?: string);
|
|
780
1001
|
}
|
|
781
1002
|
|
|
782
|
-
declare const VERSION = "0.
|
|
1003
|
+
declare const VERSION = "0.11.0";
|
|
783
1004
|
|
|
784
|
-
export { type AISummary, APIError, AuthenticationError, type ChartData, type ChartDataPoint, type ClusterBuy, type CongressTrade, type Document, type DocumentSource, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type GetInsiderOptions, type GetInsightsOptions, type GetPoliticiansOptions, type Holder, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionalFlow, type InstitutionalFlowsResponse, type KBEntity, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MentionCount, type MentionData, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentData, 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, VERSION, SentiSense as default };
|
|
1005
|
+
export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, AuthenticationError, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, type Document, type DocumentSource, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticiansOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionalFlow, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MentionCount, type MentionData, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentData, 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, VERSION, SentiSense as default };
|