finance-sentiment 1.0.0 → 1.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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Adanos Finance Sentiment API — TypeScript SDK
2
+ * Adanos Market Sentiment API — TypeScript SDK
3
3
  *
4
4
  * Analyze stock sentiment across News, Reddit, X/Twitter, and Polymarket.
5
5
  *
@@ -46,6 +46,8 @@ interface StockOptions {
46
46
  }
47
47
  /** Alias — compare accepts the same options as a single-stock lookup. */
48
48
  type CompareOptions = StockOptions;
49
+ type SearchOptions = Pick<TrendingGroupOptions, 'days' | 'limit'>;
50
+ type MarketSentimentOptions = Pick<TrendingGroupOptions, 'days'>;
49
51
  interface NewsSourceOptions {
50
52
  /** Optional strict source filter (canonical source id or known alias). */
51
53
  source?: string;
@@ -75,6 +77,7 @@ interface StockSentiment {
75
77
  found: boolean;
76
78
  company_name?: string | null;
77
79
  buzz_score?: number | null;
80
+ mentions?: number | null;
78
81
  total_mentions?: number | null;
79
82
  sentiment_score?: number | null;
80
83
  positive_count?: number | null;
@@ -98,6 +101,7 @@ interface SubredditCount {
98
101
  interface DailyTrendItem {
99
102
  date: string;
100
103
  mentions: number;
104
+ sentiment_score?: number | null;
101
105
  sentiment?: number | null;
102
106
  buzz_score?: number | null;
103
107
  }
@@ -140,10 +144,16 @@ interface StatsResponse {
140
144
  tickers: string[];
141
145
  supported_tickers: number;
142
146
  }
143
- interface SearchResponse {
144
- query: string;
145
- count: number;
146
- results: SearchResultItem[];
147
+ interface StockSearchSummary {
148
+ mentions: number;
149
+ buzz_score: number;
150
+ trend?: 'rising' | 'falling' | 'stable' | null;
151
+ sentiment_score?: number | null;
152
+ bullish_pct?: number | null;
153
+ bearish_pct?: number | null;
154
+ unique_posts: number;
155
+ subreddit_count: number;
156
+ total_upvotes: number;
147
157
  }
148
158
  interface SearchResultItem {
149
159
  ticker: string;
@@ -153,7 +163,13 @@ interface SearchResultItem {
153
163
  sector?: string | null;
154
164
  country?: string | null;
155
165
  aliases?: string[] | null;
156
- mention_count?: number | null;
166
+ summary: StockSearchSummary;
167
+ }
168
+ interface SearchResponse<T = SearchResultItem> {
169
+ query: string;
170
+ count: number;
171
+ period_days: number;
172
+ results: T[];
157
173
  }
158
174
  interface CompareResponse {
159
175
  period_days: number;
@@ -163,9 +179,40 @@ interface CompareStockItem {
163
179
  ticker: string;
164
180
  company_name?: string | null;
165
181
  buzz_score: number;
182
+ trend?: 'rising' | 'falling' | 'stable' | null;
166
183
  mentions: number;
184
+ unique_posts: number;
185
+ subreddit_count: number;
186
+ sentiment_score?: number | null;
167
187
  sentiment?: number | null;
168
- upvotes: number;
188
+ bullish_pct?: number | null;
189
+ bearish_pct?: number | null;
190
+ total_upvotes: number;
191
+ upvotes?: number | null;
192
+ trend_history: number[];
193
+ }
194
+ interface MarketSentimentDriver {
195
+ ticker: string;
196
+ buzz_score: number;
197
+ sentiment_score?: number | null;
198
+ mentions: number;
199
+ }
200
+ interface RedditMarketSentiment {
201
+ buzz_score: number;
202
+ trend?: 'rising' | 'falling' | 'stable' | null;
203
+ mentions: number;
204
+ unique_posts: number;
205
+ subreddit_count: number;
206
+ total_upvotes: number;
207
+ active_tickers: number;
208
+ sentiment_score?: number | null;
209
+ positive_count: number;
210
+ negative_count: number;
211
+ neutral_count: number;
212
+ bullish_pct: number;
213
+ bearish_pct: number;
214
+ trend_history: number[];
215
+ drivers: MarketSentimentDriver[];
169
216
  }
170
217
  interface TrendingGroupBase {
171
218
  buzz_score: number;
@@ -209,11 +256,31 @@ interface NewsTopMention {
209
256
  source: string;
210
257
  created_utc: string;
211
258
  }
259
+ interface NewsSearchSummary {
260
+ mentions: number;
261
+ buzz_score: number;
262
+ trend?: 'rising' | 'falling' | 'stable' | null;
263
+ sentiment_score?: number | null;
264
+ bullish_pct?: number | null;
265
+ bearish_pct?: number | null;
266
+ source_count: number;
267
+ }
268
+ interface NewsSearchResultItem {
269
+ ticker: string;
270
+ name: string;
271
+ type?: string | null;
272
+ exchange?: string | null;
273
+ sector?: string | null;
274
+ country?: string | null;
275
+ aliases?: string[] | null;
276
+ summary: NewsSearchSummary;
277
+ }
212
278
  interface NewsStockSentiment {
213
279
  ticker: string;
214
280
  found: boolean;
215
281
  company_name?: string | null;
216
282
  buzz_score?: number | null;
283
+ mentions?: number | null;
217
284
  total_mentions?: number | null;
218
285
  sentiment_score?: number | null;
219
286
  positive_count?: number | null;
@@ -249,14 +316,35 @@ interface NewsCompareStockItem {
249
316
  ticker: string;
250
317
  company_name?: string | null;
251
318
  buzz_score: number;
319
+ trend?: 'rising' | 'falling' | 'stable' | null;
252
320
  mentions: number;
253
321
  source_count: number;
322
+ sentiment_score?: number | null;
254
323
  sentiment?: number | null;
324
+ bullish_pct?: number | null;
325
+ bearish_pct?: number | null;
326
+ trend_history: number[];
255
327
  }
256
328
  interface NewsCompareResponse {
257
329
  period_days: number;
258
330
  stocks: NewsCompareStockItem[];
259
331
  }
332
+ interface NewsMarketSentiment {
333
+ buzz_score: number;
334
+ trend?: 'rising' | 'falling' | 'stable' | null;
335
+ mentions: number;
336
+ unique_articles: number;
337
+ source_count: number;
338
+ active_tickers: number;
339
+ sentiment_score?: number | null;
340
+ positive_count: number;
341
+ negative_count: number;
342
+ neutral_count: number;
343
+ bullish_pct: number;
344
+ bearish_pct: number;
345
+ trend_history: number[];
346
+ drivers: MarketSentimentDriver[];
347
+ }
260
348
  interface XTrendingStock {
261
349
  ticker: string;
262
350
  buzz_score: number;
@@ -276,6 +364,7 @@ interface XStockDetail {
276
364
  found: boolean;
277
365
  company_name?: string | null;
278
366
  buzz_score?: number | null;
367
+ mentions?: number | null;
279
368
  total_mentions?: number | null;
280
369
  sentiment_score?: number | null;
281
370
  positive_count?: number | null;
@@ -294,10 +383,32 @@ interface XStockDetail {
294
383
  interface XDailyTrendItem {
295
384
  date: string;
296
385
  mentions: number;
386
+ sentiment_score?: number | null;
297
387
  sentiment?: number | null;
298
388
  avg_rank?: number | null;
299
389
  buzz_score?: number | null;
300
390
  }
391
+ interface XSearchSummary {
392
+ mentions: number;
393
+ buzz_score: number;
394
+ trend?: 'rising' | 'falling' | 'stable' | null;
395
+ sentiment_score?: number | null;
396
+ bullish_pct?: number | null;
397
+ bearish_pct?: number | null;
398
+ unique_tweets: number;
399
+ total_upvotes: number;
400
+ }
401
+ interface XSearchResultItem {
402
+ ticker: string;
403
+ name: string;
404
+ type?: string | null;
405
+ exchange?: string | null;
406
+ sector?: string | null;
407
+ country?: string | null;
408
+ aliases?: string[] | null;
409
+ summary: XSearchSummary;
410
+ }
411
+ type XSearchResponse = SearchResponse<XSearchResultItem>;
301
412
  interface XTopTweet {
302
413
  text_snippet: string;
303
414
  sentiment_score?: number | null;
@@ -326,6 +437,23 @@ interface XTrendingSector extends XTrendingGroupBase {
326
437
  interface XTrendingCountry extends XTrendingGroupBase {
327
438
  country: string;
328
439
  }
440
+ interface XMarketSentiment {
441
+ buzz_score: number;
442
+ trend?: 'rising' | 'falling' | 'stable' | null;
443
+ mentions: number;
444
+ unique_tweets: number;
445
+ unique_authors: number;
446
+ total_upvotes: number;
447
+ active_tickers: number;
448
+ sentiment_score?: number | null;
449
+ positive_count: number;
450
+ negative_count: number;
451
+ neutral_count: number;
452
+ bullish_pct: number;
453
+ bearish_pct: number;
454
+ trend_history: number[];
455
+ drivers: MarketSentimentDriver[];
456
+ }
329
457
  interface PolymarketTrendingStock {
330
458
  ticker: string;
331
459
  buzz_score: number;
@@ -343,6 +471,7 @@ interface PolymarketTrendingStock {
343
471
  interface PolymarketDailyTrendItem {
344
472
  date: string;
345
473
  trade_count: number;
474
+ sentiment_score?: number | null;
346
475
  sentiment?: number | null;
347
476
  buzz_score?: number | null;
348
477
  }
@@ -402,16 +531,55 @@ interface PolymarketCompareStockItem {
402
531
  ticker: string;
403
532
  company_name?: string | null;
404
533
  buzz_score: number;
534
+ trend?: 'rising' | 'falling' | 'stable' | null;
405
535
  trade_count: number;
406
536
  market_count: number;
407
537
  unique_traders?: number | null;
538
+ sentiment_score?: number | null;
408
539
  sentiment?: number | null;
540
+ bullish_pct?: number | null;
541
+ bearish_pct?: number | null;
409
542
  total_liquidity: number;
543
+ trend_history: number[];
410
544
  }
411
545
  interface PolymarketCompareResponse {
412
546
  period_days: number;
413
547
  stocks: PolymarketCompareStockItem[];
414
548
  }
549
+ interface PolymarketMarketSentimentDriver {
550
+ ticker: string;
551
+ trade_count: number;
552
+ buzz_score: number;
553
+ sentiment_score?: number | null;
554
+ }
555
+ interface PolymarketMarketSentiment {
556
+ buzz_score: number;
557
+ trend?: 'rising' | 'falling' | 'stable' | null;
558
+ trade_count: number;
559
+ market_count: number;
560
+ unique_traders: number;
561
+ total_liquidity: number;
562
+ active_tickers: number;
563
+ sentiment_score?: number | null;
564
+ positive_count: number;
565
+ negative_count: number;
566
+ neutral_count: number;
567
+ bullish_pct: number;
568
+ bearish_pct: number;
569
+ trend_history: number[];
570
+ drivers: PolymarketMarketSentimentDriver[];
571
+ }
572
+ interface PolymarketSearchSummary {
573
+ buzz_score: number;
574
+ trend?: 'rising' | 'falling' | 'stable' | null;
575
+ trade_count: number;
576
+ market_count: number;
577
+ unique_traders?: number | null;
578
+ sentiment_score?: number | null;
579
+ bullish_pct?: number | null;
580
+ bearish_pct?: number | null;
581
+ total_liquidity: number;
582
+ }
415
583
  interface PolymarketSearchResultItem {
416
584
  ticker: string;
417
585
  name: string;
@@ -420,11 +588,12 @@ interface PolymarketSearchResultItem {
420
588
  sector?: string | null;
421
589
  country?: string | null;
422
590
  aliases: string[];
423
- trade_count: number;
591
+ summary: PolymarketSearchSummary;
424
592
  }
425
593
  interface PolymarketSearchResponse {
426
594
  query: string;
427
595
  count: number;
596
+ period_days: number;
428
597
  results: PolymarketSearchResultItem[];
429
598
  }
430
599
  type QueryParams = Record<string, string | number | undefined>;
@@ -455,9 +624,11 @@ declare class RedditNamespace extends PlatformNamespace {
455
624
  /** Get AI-generated explanation for a stock's trend. */
456
625
  explain(ticker: string): Promise<StockExplanationResponse>;
457
626
  /** Search for stocks by name or ticker. */
458
- search(query: string): Promise<SearchResponse>;
627
+ search(query: string, options?: SearchOptions): Promise<SearchResponse>;
459
628
  /** Compare multiple stocks side-by-side. */
460
629
  compare(tickers: string[], options?: CompareOptions): Promise<CompareResponse>;
630
+ /** Get the service-level Reddit market sentiment snapshot. */
631
+ marketSentiment(options?: MarketSentimentOptions): Promise<RedditMarketSentiment>;
461
632
  }
462
633
  declare class NewsNamespace extends PlatformNamespace {
463
634
  /** @internal */
@@ -473,9 +644,11 @@ declare class NewsNamespace extends PlatformNamespace {
473
644
  /** Get AI-generated explanation for a stock's news trend. */
474
645
  explain(ticker: string): Promise<StockExplanationResponse>;
475
646
  /** Search for stocks by name or ticker in news. */
476
- search(query: string): Promise<SearchResponse>;
647
+ search(query: string, options?: SearchOptions): Promise<SearchResponse<NewsSearchResultItem>>;
477
648
  /** Compare multiple stocks side-by-side using news sentiment. */
478
649
  compare(tickers: string[], options?: CompareOptions): Promise<NewsCompareResponse>;
650
+ /** Get the service-level News market sentiment snapshot. */
651
+ marketSentiment(options?: MarketSentimentOptions): Promise<NewsMarketSentiment>;
479
652
  /** Get news data statistics. */
480
653
  stats(): Promise<StatsResponse>;
481
654
  /** Get public news service health (no auth required on server side). */
@@ -493,9 +666,11 @@ declare class XNamespace extends PlatformNamespace {
493
666
  /** Get X/Twitter sentiment for a specific stock ticker. */
494
667
  stock(ticker: string, options?: StockOptions): Promise<XStockDetail>;
495
668
  /** Search for stocks by name or ticker on X/Twitter. */
496
- search(query: string): Promise<SearchResponse>;
669
+ search(query: string, options?: SearchOptions): Promise<XSearchResponse>;
497
670
  /** Compare multiple stocks side-by-side on X/Twitter. */
498
671
  compare(tickers: string[], options?: CompareOptions): Promise<CompareResponse>;
672
+ /** Get the service-level X/Twitter market sentiment snapshot. */
673
+ marketSentiment(options?: MarketSentimentOptions): Promise<XMarketSentiment>;
499
674
  }
500
675
  declare class PolymarketNamespace extends PlatformNamespace {
501
676
  /** @internal */
@@ -509,9 +684,11 @@ declare class PolymarketNamespace extends PlatformNamespace {
509
684
  /** Get Polymarket sentiment for a specific stock ticker. */
510
685
  stock(ticker: string, options?: StockOptions): Promise<PolymarketStockDetail>;
511
686
  /** Search for stocks by name or ticker on Polymarket. */
512
- search(query: string): Promise<PolymarketSearchResponse>;
687
+ search(query: string, options?: SearchOptions): Promise<PolymarketSearchResponse>;
513
688
  /** Compare multiple stocks side-by-side on Polymarket. */
514
689
  compare(tickers: string[], options?: CompareOptions): Promise<PolymarketCompareResponse>;
690
+ /** Get the service-level Polymarket market sentiment snapshot. */
691
+ marketSentiment(options?: MarketSentimentOptions): Promise<PolymarketMarketSentiment>;
515
692
  }
516
693
  declare class AdanosClient {
517
694
  readonly news: NewsNamespace;
@@ -519,7 +696,7 @@ declare class AdanosClient {
519
696
  readonly x: XNamespace;
520
697
  readonly polymarket: PolymarketNamespace;
521
698
  /**
522
- * Create a new Finance Sentiment API client.
699
+ * Create a new Adanos Market Sentiment API client.
523
700
  *
524
701
  * @param options.apiKey - Your API key (`adanos_api_key_here`).
525
702
  * @param options.baseUrl - API base URL. Default: `https://api.adanos.org`.
@@ -529,4 +706,4 @@ declare class AdanosClient {
529
706
  }
530
707
  declare const StockSentimentClient: typeof AdanosClient;
531
708
 
532
- export { AdanosClient, ApiError, type ClientOptions, type CompareOptions, type CompareResponse, type CompareStockItem, type DailyTrendItem, type HealthResponse, type NewsCompareOptions, type NewsCompareResponse, type NewsCompareStockItem, NewsNamespace, 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, PolymarketNamespace, type PolymarketSearchResponse, type PolymarketSearchResultItem, type PolymarketStockDetail, type PolymarketTopMention, type PolymarketTrendingCountry, type PolymarketTrendingSector, type PolymarketTrendingStock, RedditNamespace, type SchedulerStatus, type SearchResponse, type SearchResultItem, type StatsResponse, type StockExplanationResponse, type StockOptions, type StockSentiment, StockSentimentClient, StockSentimentError, type SubredditCount, type TopMention, type TrendingCountry, type TrendingGroupOptions, type TrendingOptions, type TrendingSector, type TrendingStock, type XDailyTrendItem, XNamespace, type XStockDetail, type XTopTweet, type XTrendingCountry, type XTrendingSector, type XTrendingStock };
709
+ export { AdanosClient, ApiError, type ClientOptions, type CompareOptions, type CompareResponse, type CompareStockItem, type DailyTrendItem, type HealthResponse, type MarketSentimentDriver, type MarketSentimentOptions, type NewsCompareOptions, type NewsCompareResponse, type NewsCompareStockItem, type NewsMarketSentiment, NewsNamespace, 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 PolymarketSearchResponse, type PolymarketSearchResultItem, type PolymarketSearchSummary, type PolymarketStockDetail, type PolymarketTopMention, type PolymarketTrendingCountry, type PolymarketTrendingSector, type PolymarketTrendingStock, type RedditMarketSentiment, RedditNamespace, 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 XSearchResponse, type XSearchResultItem, type XSearchSummary, type XStockDetail, type XTopTweet, type XTrendingCountry, type XTrendingSector, type XTrendingStock };