finance-sentiment 2.1.0 → 2.2.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.cts CHANGED
@@ -53,6 +53,8 @@ interface RawMentionsOptions {
53
53
  days?: number;
54
54
  /** Max raw rows to return. */
55
55
  limit?: number;
56
+ /** Pagination offset. Default: 0. */
57
+ offset?: number;
56
58
  /** Include inherited Reddit thread context where supported. */
57
59
  includeInherited?: boolean;
58
60
  }
@@ -135,6 +137,9 @@ interface SchedulerStatus {
135
137
  success_rate?: number | null;
136
138
  note?: string | null;
137
139
  }
140
+ interface CryptoSchedulerStatus extends SchedulerStatus {
141
+ timed_out_scrape_threads?: number;
142
+ }
138
143
  interface HealthResponse {
139
144
  status: string;
140
145
  service?: string | null;
@@ -144,12 +149,67 @@ interface HealthResponse {
144
149
  scheduler?: SchedulerStatus | null;
145
150
  error?: string | null;
146
151
  }
152
+ interface CryptoHealthResponse {
153
+ status: string;
154
+ service?: string | null;
155
+ version?: string | null;
156
+ total_mentions?: number;
157
+ tokens_tracked?: number;
158
+ scheduler?: CryptoSchedulerStatus | null;
159
+ error?: string | null;
160
+ }
161
+ interface XSchedulerStatus {
162
+ running: boolean;
163
+ last_scrape?: string | null;
164
+ scrape_count?: number;
165
+ error_count?: number;
166
+ success_rate?: number;
167
+ note?: string | null;
168
+ }
169
+ interface XHealthResponse {
170
+ status: string;
171
+ service: string;
172
+ version: string;
173
+ total_mentions: number;
174
+ tickers_tracked: number;
175
+ scheduler?: XSchedulerStatus | null;
176
+ error?: string | null;
177
+ }
178
+ type PolymarketSchedulerStatus = XSchedulerStatus;
179
+ interface PolymarketHealthResponse {
180
+ status: string;
181
+ service: string;
182
+ version: string;
183
+ total_mentions: number;
184
+ tickers_tracked: number;
185
+ scheduler?: PolymarketSchedulerStatus | null;
186
+ error?: string | null;
187
+ }
188
+ interface RootHealthSummary {
189
+ total: number;
190
+ healthy: number;
191
+ unhealthy: number;
192
+ unhealthy_services: string[];
193
+ }
194
+ interface RootHealthResponse {
195
+ status: string;
196
+ service?: string | null;
197
+ version: string;
198
+ summary: RootHealthSummary;
199
+ services: Record<string, unknown>;
200
+ }
147
201
  interface StatsResponse {
148
202
  total_mentions: number;
149
203
  unique_tickers: number;
150
- tickers: string[];
204
+ mentions_today?: number;
205
+ unique_tickers_today?: number;
206
+ tickers?: string[];
151
207
  supported_tickers: number;
152
208
  }
209
+ type RedditStatsResponse = StatsResponse;
210
+ interface NewsStatsResponse extends StatsResponse {
211
+ tickers: string[];
212
+ }
153
213
  interface StockSearchSummary {
154
214
  mentions: number;
155
215
  buzz_score: number;
@@ -445,6 +505,23 @@ interface XSearchResultItem {
445
505
  summary: XSearchSummary;
446
506
  }
447
507
  type XSearchResponse = SearchResponse<XSearchResultItem>;
508
+ interface XCompareStockItem {
509
+ ticker: string;
510
+ company_name?: string | null;
511
+ buzz_score: number;
512
+ trend?: 'rising' | 'falling' | 'stable' | null;
513
+ mentions: number;
514
+ unique_tweets: number;
515
+ sentiment_score?: number | null;
516
+ bullish_pct?: number | null;
517
+ bearish_pct?: number | null;
518
+ total_upvotes: number;
519
+ trend_history?: number[];
520
+ }
521
+ interface XCompareResponse {
522
+ period_days: number;
523
+ stocks: XCompareStockItem[];
524
+ }
448
525
  interface XTopTweet {
449
526
  text_snippet: string;
450
527
  sentiment_score?: number | null;
@@ -509,12 +586,22 @@ interface XRawMentionsResponse {
509
586
  count: number;
510
587
  results: XRawMentionItem[];
511
588
  }
589
+ interface XStatsResponse {
590
+ total_appearances?: number;
591
+ unique_tickers?: number;
592
+ mentions_today?: number;
593
+ unique_tickers_today?: number;
594
+ tickers?: string[];
595
+ supported_tickers?: number;
596
+ last_fetch?: string | null;
597
+ }
512
598
  interface PolymarketTrendingStock {
513
599
  ticker: string;
514
600
  buzz_score: number;
515
601
  trend: 'rising' | 'falling' | 'stable';
516
602
  trade_count: number;
517
603
  market_count: number;
604
+ current_market_count: number;
518
605
  unique_traders?: number | null;
519
606
  bullish_pct: number;
520
607
  bearish_pct: number;
@@ -551,6 +638,7 @@ interface PolymarketStockDetail {
551
638
  period_days?: number | null;
552
639
  trade_count?: number | null;
553
640
  market_count?: number | null;
641
+ current_market_count?: number | null;
554
642
  unique_traders?: number | null;
555
643
  sentiment_score?: number | null;
556
644
  positive_count?: number | null;
@@ -567,6 +655,7 @@ interface PolymarketTrendingGroupBase {
567
655
  trend: 'rising' | 'falling' | 'stable';
568
656
  trade_count: number;
569
657
  market_count: number;
658
+ current_market_count: number;
570
659
  unique_tickers: number;
571
660
  unique_traders?: number | null;
572
661
  sentiment_score?: number | null;
@@ -588,6 +677,7 @@ interface PolymarketCompareStockItem {
588
677
  trend?: 'rising' | 'falling' | 'stable' | null;
589
678
  trade_count: number;
590
679
  market_count: number;
680
+ current_market_count: number;
591
681
  unique_traders?: number | null;
592
682
  sentiment_score?: number | null;
593
683
  bullish_pct?: number | null;
@@ -610,6 +700,7 @@ interface PolymarketMarketSentiment {
610
700
  trend?: 'rising' | 'falling' | 'stable' | null;
611
701
  trade_count: number;
612
702
  market_count: number;
703
+ current_market_count: number;
613
704
  unique_traders: number;
614
705
  total_liquidity: number;
615
706
  active_tickers: number;
@@ -627,6 +718,7 @@ interface PolymarketSearchSummary {
627
718
  trend?: 'rising' | 'falling' | 'stable' | null;
628
719
  trade_count: number;
629
720
  market_count: number;
721
+ current_market_count: number;
630
722
  unique_traders?: number | null;
631
723
  sentiment_score?: number | null;
632
724
  bullish_pct?: number | null;
@@ -678,6 +770,15 @@ interface PolymarketRawMentionsResponse {
678
770
  count: number;
679
771
  results: PolymarketRawMentionItem[];
680
772
  }
773
+ interface PolymarketStatsResponse {
774
+ total_trades: number;
775
+ total_markets: number;
776
+ unique_tickers: number;
777
+ mentions_today?: number;
778
+ unique_tickers_today?: number;
779
+ tickers: string[];
780
+ supported_tickers: number;
781
+ }
681
782
  interface CryptoTrendingToken {
682
783
  symbol: string;
683
784
  name?: string | null;
@@ -692,6 +793,24 @@ interface CryptoTrendingToken {
692
793
  total_upvotes: number;
693
794
  trend_history?: number[];
694
795
  }
796
+ interface CryptoSubredditCount {
797
+ subreddit: string;
798
+ count: number;
799
+ }
800
+ interface CryptoDailyTrendItem {
801
+ date: string;
802
+ mentions: number;
803
+ sentiment_score?: number | null;
804
+ buzz_score?: number | null;
805
+ }
806
+ interface CryptoTopMention {
807
+ text_snippet: string;
808
+ sentiment_score?: number | null;
809
+ sentiment_label?: string | null;
810
+ upvotes: number;
811
+ subreddit?: string | null;
812
+ created_utc: string;
813
+ }
695
814
  interface CryptoTokenSentiment {
696
815
  symbol: string;
697
816
  name?: string | null;
@@ -709,15 +828,28 @@ interface CryptoTokenSentiment {
709
828
  bullish_pct?: number | null;
710
829
  bearish_pct?: number | null;
711
830
  period_days?: number | null;
712
- top_subreddits?: SubredditCount[] | null;
713
- daily_trend?: DailyTrendItem[] | null;
714
- top_mentions?: TopMention[] | null;
831
+ top_subreddits?: CryptoSubredditCount[] | null;
832
+ daily_trend?: CryptoDailyTrendItem[] | null;
833
+ top_mentions?: CryptoTopMention[] | null;
834
+ }
835
+ interface CryptoSearchSummary {
836
+ mentions: number;
837
+ buzz_score: number;
838
+ trend?: 'rising' | 'falling' | 'stable' | null;
839
+ sentiment_score?: number | null;
840
+ bullish_pct?: number | null;
841
+ bearish_pct?: number | null;
842
+ unique_posts: number;
843
+ subreddit_count: number;
844
+ total_upvotes: number;
715
845
  }
716
846
  interface CryptoSearchItem {
717
847
  symbol: string;
718
848
  name: string;
719
- aliases?: string[] | null;
720
- summary: StockSearchSummary;
849
+ market_cap_rank?: number | null;
850
+ market_cap_usd?: number | null;
851
+ aliases?: string[];
852
+ summary: CryptoSearchSummary;
721
853
  }
722
854
  interface CryptoSearchResponse {
723
855
  query: string;
@@ -725,13 +857,24 @@ interface CryptoSearchResponse {
725
857
  period_days: number;
726
858
  results: CryptoSearchItem[];
727
859
  }
728
- interface CryptoCompareTokenItem extends CryptoTokenSentiment {
729
- trend_history?: number[];
730
- }
731
860
  interface CryptoCompareResponse {
732
861
  period_days: number;
733
862
  tokens: CryptoCompareTokenItem[];
734
863
  }
864
+ interface CryptoCompareTokenItem {
865
+ symbol: string;
866
+ name?: string | null;
867
+ buzz_score: number;
868
+ trend?: 'rising' | 'falling' | 'stable' | null;
869
+ mentions: number;
870
+ unique_posts: number;
871
+ subreddit_count: number;
872
+ sentiment_score?: number | null;
873
+ bullish_pct?: number | null;
874
+ bearish_pct?: number | null;
875
+ total_upvotes: number;
876
+ trend_history?: number[];
877
+ }
735
878
  interface CryptoRawMentionItem extends RedditRawMentionItem {
736
879
  }
737
880
  interface CryptoRawMentionsResponse {
@@ -747,7 +890,7 @@ interface CryptoMarketSentiment {
747
890
  unique_posts: number;
748
891
  subreddit_count: number;
749
892
  total_upvotes: number;
750
- active_tokens: number;
893
+ active_tickers: number;
751
894
  sentiment_score?: number | null;
752
895
  positive_count: number;
753
896
  negative_count: number;
@@ -755,16 +898,19 @@ interface CryptoMarketSentiment {
755
898
  bullish_pct: number;
756
899
  bearish_pct: number;
757
900
  trend_history: number[];
758
- drivers: Array<{
759
- symbol: string;
760
- buzz_score: number;
761
- sentiment_score?: number | null;
762
- mentions: number;
763
- }>;
901
+ drivers: CryptoMarketSentimentDriver[];
902
+ }
903
+ interface CryptoMarketSentimentDriver {
904
+ symbol: string;
905
+ mentions: number;
906
+ buzz_score: number;
907
+ sentiment_score?: number | null;
764
908
  }
765
909
  interface CryptoStatsResponse {
766
910
  total_mentions: number;
767
911
  unique_tokens: number;
912
+ mentions_today?: number;
913
+ unique_tokens_today?: number;
768
914
  tokens: string[];
769
915
  supported_tokens: number;
770
916
  }
@@ -804,7 +950,7 @@ declare class RedditNamespace extends PlatformNamespace {
804
950
  /** Get the service-level Reddit market sentiment snapshot. */
805
951
  marketSentiment(options?: MarketSentimentOptions): Promise<RedditMarketSentiment>;
806
952
  /** Get Reddit stock data statistics. */
807
- stats(): Promise<StatsResponse>;
953
+ stats(): Promise<RedditStatsResponse>;
808
954
  /** Get public Reddit stock service health. */
809
955
  health(): Promise<HealthResponse>;
810
956
  }
@@ -830,7 +976,7 @@ declare class NewsNamespace extends PlatformNamespace {
830
976
  /** Get the service-level News market sentiment snapshot. */
831
977
  marketSentiment(options?: MarketSentimentOptions): Promise<NewsMarketSentiment>;
832
978
  /** Get news data statistics. */
833
- stats(): Promise<StatsResponse>;
979
+ stats(): Promise<NewsStatsResponse>;
834
980
  /** Get public news service health (no auth required on server side). */
835
981
  health(): Promise<HealthResponse>;
836
982
  }
@@ -852,13 +998,13 @@ declare class XNamespace extends PlatformNamespace {
852
998
  /** Search for stocks by name or ticker on X/Twitter. */
853
999
  search(query: string, options?: SearchOptions): Promise<XSearchResponse>;
854
1000
  /** Compare multiple stocks side-by-side on X/Twitter. */
855
- compare(tickers: string[], options?: CompareOptions): Promise<CompareResponse>;
1001
+ compare(tickers: string[], options?: CompareOptions): Promise<XCompareResponse>;
856
1002
  /** Get the service-level X/Twitter market sentiment snapshot. */
857
1003
  marketSentiment(options?: MarketSentimentOptions): Promise<XMarketSentiment>;
858
1004
  /** Get X/Twitter data statistics. */
859
- stats(): Promise<StatsResponse>;
1005
+ stats(): Promise<XStatsResponse>;
860
1006
  /** Get public X/Twitter service health. */
861
- health(): Promise<HealthResponse>;
1007
+ health(): Promise<XHealthResponse>;
862
1008
  }
863
1009
  declare class PolymarketNamespace extends PlatformNamespace {
864
1010
  /** @internal */
@@ -880,9 +1026,9 @@ declare class PolymarketNamespace extends PlatformNamespace {
880
1026
  /** Get the service-level Polymarket market sentiment snapshot. */
881
1027
  marketSentiment(options?: MarketSentimentOptions): Promise<PolymarketMarketSentiment>;
882
1028
  /** Get Polymarket data statistics. */
883
- stats(): Promise<StatsResponse>;
1029
+ stats(): Promise<PolymarketStatsResponse>;
884
1030
  /** Get public Polymarket service health. */
885
- health(): Promise<HealthResponse>;
1031
+ health(): Promise<PolymarketHealthResponse>;
886
1032
  }
887
1033
  declare class RedditCryptoNamespace extends PlatformNamespace {
888
1034
  /** @internal */
@@ -902,7 +1048,7 @@ declare class RedditCryptoNamespace extends PlatformNamespace {
902
1048
  /** Get Reddit crypto data statistics. */
903
1049
  stats(): Promise<CryptoStatsResponse>;
904
1050
  /** Get public Reddit crypto service health. */
905
- health(): Promise<HealthResponse>;
1051
+ health(): Promise<CryptoHealthResponse>;
906
1052
  }
907
1053
  declare class AdanosClient {
908
1054
  readonly news: NewsNamespace;
@@ -911,6 +1057,7 @@ declare class AdanosClient {
911
1057
  readonly redditCrypto: RedditCryptoNamespace;
912
1058
  readonly x: XNamespace;
913
1059
  readonly polymarket: PolymarketNamespace;
1060
+ private readonly http;
914
1061
  /**
915
1062
  * Create a new Adanos Market Sentiment API client.
916
1063
  *
@@ -919,7 +1066,9 @@ declare class AdanosClient {
919
1066
  * @param options.timeout - Request timeout in ms. Default: 30000.
920
1067
  */
921
1068
  constructor(options: ClientOptions);
1069
+ /** Get aggregate API health across all public market sentiment services. */
1070
+ health(): Promise<RootHealthResponse>;
922
1071
  }
923
1072
  declare const StockSentimentClient: typeof AdanosClient;
924
1073
 
925
- export { AdanosClient, ApiError, type ClientOptions, type CompareOptions, type CompareResponse, type CompareStockItem, type CryptoCompareResponse, type CryptoCompareTokenItem, type CryptoMarketSentiment, type CryptoRawMentionItem, type CryptoRawMentionsResponse, type CryptoSearchItem, type CryptoSearchResponse, type CryptoStatsResponse, type CryptoTokenSentiment, type CryptoTrendingToken, type DailyTrendItem, type HealthResponse, type MarketSentimentDriver, type MarketSentimentOptions, type NewsCompareOptions, type NewsCompareResponse, type NewsCompareStockItem, type NewsMarketSentiment, NewsNamespace, type NewsRawMentionItem, type NewsRawMentionsResponse, type NewsSearchResultItem, type NewsSearchSummary, type NewsSourceCount, type NewsSourceOptions, type NewsStockOptions, type NewsStockSentiment, type NewsTopMention, type NewsTrendingCountry, type NewsTrendingGroupOptions, type NewsTrendingOptions, type NewsTrendingSector, type NewsTrendingStock, type PolymarketCompareResponse, type PolymarketCompareStockItem, type PolymarketDailyTrendItem, type PolymarketMarketSentiment, type PolymarketMarketSentimentDriver, PolymarketNamespace, type PolymarketRawMentionItem, type PolymarketRawMentionsResponse, type PolymarketSearchResponse, type PolymarketSearchResultItem, type PolymarketSearchSummary, type PolymarketStockDetail, type PolymarketTopMention, type PolymarketTrendingCountry, type PolymarketTrendingSector, type PolymarketTrendingStock, type RawMentionsOptions, RedditCryptoNamespace, type RedditMarketSentiment, RedditNamespace, type RedditRawMentionItem, type RedditRawMentionsResponse, type SchedulerStatus, type SearchOptions, type SearchResponse, type SearchResultItem, type StatsResponse, type StockExplanationResponse, type StockOptions, type StockSearchSummary, type StockSentiment, StockSentimentClient, StockSentimentError, type SubredditCount, type TopMention, type TrendingCountry, type TrendingGroupOptions, type TrendingOptions, type TrendingSector, type TrendingStock, type XDailyTrendItem, type XMarketSentiment, XNamespace, type XRawMentionItem, type XRawMentionsResponse, type XSearchResponse, type XSearchResultItem, type XSearchSummary, type XStockDetail, type XTopTweet, type XTrendingCountry, type XTrendingSector, type XTrendingStock };
1074
+ export { AdanosClient, ApiError, type ClientOptions, type CompareOptions, type CompareResponse, type CompareStockItem, type CryptoCompareResponse, type CryptoCompareTokenItem, type CryptoDailyTrendItem, type CryptoHealthResponse, type CryptoMarketSentiment, type CryptoMarketSentimentDriver, type CryptoRawMentionItem, type CryptoRawMentionsResponse, type CryptoSchedulerStatus, type CryptoSearchItem, type CryptoSearchResponse, type CryptoSearchSummary, type CryptoStatsResponse, type CryptoSubredditCount, type CryptoTokenSentiment, type CryptoTopMention, type CryptoTrendingToken, type DailyTrendItem, type HealthResponse, type MarketSentimentDriver, type MarketSentimentOptions, type NewsCompareOptions, type NewsCompareResponse, type NewsCompareStockItem, type NewsMarketSentiment, NewsNamespace, type NewsRawMentionItem, type NewsRawMentionsResponse, type NewsSearchResultItem, type NewsSearchSummary, type NewsSourceCount, type NewsSourceOptions, type NewsStatsResponse, type NewsStockOptions, type NewsStockSentiment, type NewsTopMention, type NewsTrendingCountry, type NewsTrendingGroupOptions, type NewsTrendingOptions, type NewsTrendingSector, type NewsTrendingStock, type PolymarketCompareResponse, type PolymarketCompareStockItem, type PolymarketDailyTrendItem, type PolymarketHealthResponse, type PolymarketMarketSentiment, type PolymarketMarketSentimentDriver, PolymarketNamespace, type PolymarketRawMentionItem, type PolymarketRawMentionsResponse, type PolymarketSchedulerStatus, type PolymarketSearchResponse, type PolymarketSearchResultItem, type PolymarketSearchSummary, type PolymarketStatsResponse, type PolymarketStockDetail, type PolymarketTopMention, type PolymarketTrendingCountry, type PolymarketTrendingSector, type PolymarketTrendingStock, type RawMentionsOptions, RedditCryptoNamespace, type RedditMarketSentiment, RedditNamespace, type RedditRawMentionItem, type RedditRawMentionsResponse, type RedditStatsResponse, type RootHealthResponse, type RootHealthSummary, type SchedulerStatus, type SearchOptions, type SearchResponse, type SearchResultItem, type StatsResponse, type StockExplanationResponse, type StockOptions, type StockSearchSummary, type StockSentiment, StockSentimentClient, StockSentimentError, type SubredditCount, type TopMention, type TrendingCountry, type TrendingGroupOptions, type TrendingOptions, type TrendingSector, type TrendingStock, type XCompareResponse, type XCompareStockItem, type XDailyTrendItem, type XHealthResponse, type XMarketSentiment, XNamespace, type XRawMentionItem, type XRawMentionsResponse, type XSchedulerStatus, type XSearchResponse, type XSearchResultItem, type XSearchSummary, type XStatsResponse, type XStockDetail, type XTopTweet, type XTrendingCountry, type XTrendingSector, type XTrendingStock };