finance-sentiment 1.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Adanos Finance Sentiment API — TypeScript SDK\n *\n * Analyze stock sentiment across News, Reddit, X/Twitter, and Polymarket.\n *\n * @example\n * ```ts\n * import { AdanosClient } from 'finance-sentiment';\n *\n * const client = new AdanosClient({ apiKey: 'adanos_api_key_here' });\n * const trending = await client.reddit.trending({ days: 7 });\n * ```\n */\n\n// ── Errors ──────────────────────────────────────────────────────────\n\nexport class StockSentimentError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'StockSentimentError';\n }\n}\n\nexport class ApiError extends StockSentimentError {\n status: number;\n detail: string;\n\n constructor(status: number, detail: string) {\n super(`${status}: ${detail}`);\n this.name = 'ApiError';\n this.status = status;\n this.detail = detail;\n }\n}\n\n// ── Option types ────────────────────────────────────────────────────\n\nexport interface ClientOptions {\n apiKey: string;\n baseUrl?: string;\n /** Request timeout in milliseconds. Default: 30000 */\n timeout?: number;\n}\n\nexport interface TrendingOptions {\n /** Time period in days (1-90). Free tier limited to 30. */\n days?: number;\n /** Max results (1-100). Default: 20. */\n limit?: number;\n /** Pagination offset. Default: 0. */\n offset?: number;\n /** Filter by \"stock\", \"etf\", \"all\", or undefined for all. */\n type?: string;\n}\n\nexport interface TrendingGroupOptions {\n days?: number;\n limit?: number;\n offset?: number;\n}\n\nexport interface StockOptions {\n /** Time period in days (1-90). Default: 7. */\n days?: number;\n}\n\n/** Alias — compare accepts the same options as a single-stock lookup. */\nexport type CompareOptions = StockOptions;\n\nexport interface NewsSourceOptions {\n /** Optional strict source filter (canonical source id or known alias). */\n source?: string;\n}\n\nexport interface NewsTrendingOptions extends TrendingOptions, NewsSourceOptions {}\nexport interface NewsTrendingGroupOptions extends TrendingGroupOptions, NewsSourceOptions {}\nexport type NewsStockOptions = StockOptions;\nexport type NewsCompareOptions = CompareOptions;\n\n// ── Response types (snake_case — matches API JSON exactly) ──────────\n\n// Reddit response types\n\nexport interface TrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_posts: number;\n subreddit_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n total_upvotes: number;\n company_name?: string | null;\n trend_history?: number[];\n}\n\nexport interface StockSentiment {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n total_upvotes?: number | null;\n unique_posts?: number | null;\n subreddit_count?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n top_subreddits?: SubredditCount[] | null;\n daily_trend?: DailyTrendItem[] | null;\n top_mentions?: TopMention[] | null;\n}\n\nexport interface SubredditCount {\n subreddit: string;\n count: number;\n}\n\nexport interface DailyTrendItem {\n date: string;\n mentions: number;\n sentiment?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface TopMention {\n text_snippet: string;\n sentiment_score: number;\n sentiment_label: string;\n upvotes: number;\n subreddit: string;\n created_utc: string;\n}\n\nexport interface StockExplanationResponse {\n ticker: string;\n company_name?: string | null;\n explanation: string;\n cached: boolean;\n generated_at: string;\n model?: string | null;\n}\n\nexport interface SchedulerStatus {\n running: boolean;\n last_scrape?: string | null;\n scrape_count?: number;\n error_count?: number;\n success_rate?: number | null;\n note?: string | null;\n}\n\nexport interface HealthResponse {\n status: string;\n service?: string | null;\n version?: string | null;\n total_mentions?: number;\n tickers_tracked?: number;\n scheduler?: SchedulerStatus | null;\n error?: string | null;\n}\n\nexport interface StatsResponse {\n total_mentions: number;\n unique_tickers: number;\n tickers: string[];\n supported_tickers: number;\n}\n\nexport interface SearchResponse {\n query: string;\n count: number;\n results: SearchResultItem[];\n}\n\nexport interface SearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases?: string[] | null;\n mention_count?: number | null;\n}\n\nexport interface CompareResponse {\n period_days: number;\n stocks: CompareStockItem[];\n}\n\nexport interface CompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n mentions: number;\n sentiment?: number | null;\n upvotes: number;\n}\n\ninterface TrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n total_upvotes: number;\n top_tickers: string[];\n}\n\nexport interface TrendingSector extends TrendingGroupBase {\n sector: string;\n subreddit_count: number;\n}\n\nexport interface TrendingCountry extends TrendingGroupBase {\n country: string;\n subreddit_count: number;\n}\n\n// News response types\n\nexport interface NewsTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n source_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n company_name?: string | null;\n trend_history?: number[];\n}\n\nexport interface NewsSourceCount {\n source: string;\n count: number;\n}\n\nexport interface NewsTopMention {\n text_snippet: string;\n sentiment_score: number;\n sentiment_label: string;\n source: string;\n created_utc: string;\n}\n\nexport interface NewsStockSentiment {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n source_count?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n top_sources?: NewsSourceCount[] | null;\n daily_trend?: DailyTrendItem[] | null;\n top_mentions?: NewsTopMention[] | null;\n}\n\ninterface NewsTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n source_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n top_tickers: string[];\n}\n\nexport interface NewsTrendingSector extends NewsTrendingGroupBase {\n sector: string;\n}\n\nexport interface NewsTrendingCountry extends NewsTrendingGroupBase {\n country: string;\n}\n\nexport interface NewsCompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n mentions: number;\n source_count: number;\n sentiment?: number | null;\n}\n\nexport interface NewsCompareResponse {\n period_days: number;\n stocks: NewsCompareStockItem[];\n}\n\n// X/Twitter response types\n\nexport interface XTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: string;\n mentions: number;\n company_name?: string | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes?: number | null;\n unique_tweets?: number | null;\n is_validated: boolean;\n trend_history?: number[];\n}\n\nexport interface XStockDetail {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n total_upvotes?: number | null;\n unique_tweets?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n daily_trend?: XDailyTrendItem[] | null;\n top_tweets?: XTopTweet[] | null;\n is_validated: boolean;\n}\n\nexport interface XDailyTrendItem {\n date: string;\n mentions: number;\n sentiment?: number | null;\n avg_rank?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface XTopTweet {\n text_snippet: string;\n sentiment_score?: number | null;\n sentiment_label?: string | null;\n likes: number;\n retweets: number;\n views?: number | null;\n author?: string | null;\n created_at?: string | null;\n}\n\ninterface XTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n unique_authors: number;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes?: number | null;\n top_tickers: string[];\n}\n\nexport interface XTrendingSector extends XTrendingGroupBase {\n sector: string;\n}\n\nexport interface XTrendingCountry extends XTrendingGroupBase {\n country: string;\n}\n\n// Polymarket response types\n\nexport interface PolymarketTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n bullish_pct: number;\n bearish_pct: number;\n total_liquidity: number;\n company_name?: string | null;\n sentiment_score?: number | null;\n trend_history?: number[];\n}\n\nexport interface PolymarketDailyTrendItem {\n date: string;\n trade_count: number;\n sentiment?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface PolymarketTopMention {\n condition_id: string;\n question: string;\n market_type: string;\n trade_count?: number | null;\n sentiment_score?: number | null;\n yes_price?: number | null;\n no_price?: number | null;\n liquidity: number;\n volume_24h: number;\n end_date?: string | null;\n active: boolean;\n}\n\nexport interface PolymarketStockDetail {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n period_days?: number | null;\n trade_count?: number | null;\n market_count?: number | null;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_liquidity?: number | null;\n daily_trend?: PolymarketDailyTrendItem[] | null;\n top_mentions?: PolymarketTopMention[] | null;\n}\n\ninterface PolymarketTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n trade_count: number;\n market_count: number;\n unique_tickers: number;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n bullish_pct: number;\n bearish_pct: number;\n total_liquidity: number;\n top_tickers: string[];\n}\n\nexport interface PolymarketTrendingSector extends PolymarketTrendingGroupBase {\n sector: string;\n}\n\nexport interface PolymarketTrendingCountry extends PolymarketTrendingGroupBase {\n country: string;\n}\n\nexport interface PolymarketCompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n sentiment?: number | null;\n total_liquidity: number;\n}\n\nexport interface PolymarketCompareResponse {\n period_days: number;\n stocks: PolymarketCompareStockItem[];\n}\n\nexport interface PolymarketSearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases: string[];\n trade_count: number;\n}\n\nexport interface PolymarketSearchResponse {\n query: string;\n count: number;\n results: PolymarketSearchResultItem[];\n}\n\n// ── Internal HTTP client ────────────────────────────────────────────\n\ntype QueryParams = Record<string, string | number | undefined>;\n\nclass HttpClient {\n private baseUrl: string;\n private apiKey: string;\n private timeout: number;\n\n constructor(baseUrl: string, apiKey: string, timeout: number) {\n this.baseUrl = baseUrl.replace(/\\/+$/, '');\n this.apiKey = apiKey;\n this.timeout = timeout;\n }\n\n async get<T>(path: string, params?: QueryParams): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: {\n 'X-API-Key': this.apiKey,\n 'Accept': 'application/json',\n },\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n let detail: string;\n try {\n const body = await response.json();\n detail = body.detail ?? JSON.stringify(body);\n } catch {\n detail = response.statusText || `HTTP ${response.status}`;\n }\n throw new ApiError(response.status, detail);\n }\n\n return response.json() as Promise<T>;\n }\n}\n\n// ── Platform namespaces ─────────────────────────────────────────────\n\nclass PlatformNamespace {\n protected http: HttpClient;\n protected prefix: string;\n\n constructor(http: HttpClient, prefix: string) {\n this.http = http;\n this.prefix = prefix;\n }\n\n protected request<T>(path: string, params?: QueryParams): Promise<T> {\n return this.http.get<T>(`${this.prefix}${path}`, params);\n }\n}\n\nexport class RedditNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/reddit/stocks/v1');\n }\n\n /** Get trending stocks on Reddit. */\n async trending(options: TrendingOptions = {}): Promise<TrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on Reddit. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<TrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on Reddit. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<TrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<StockSentiment> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Get AI-generated explanation for a stock's trend. */\n async explain(ticker: string): Promise<StockExplanationResponse> {\n return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);\n }\n\n /** Search for stocks by name or ticker. */\n async search(query: string): Promise<SearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<CompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n}\n\nexport class NewsNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/news/stocks/v1');\n }\n\n /** Get trending stocks from news. */\n async trending(options: NewsTrendingOptions = {}): Promise<NewsTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n source: options.source,\n });\n }\n\n /** Get trending sectors from news. */\n async trendingSectors(options: NewsTrendingGroupOptions = {}): Promise<NewsTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n source: options.source,\n });\n }\n\n /** Get trending countries from news. */\n async trendingCountries(options: NewsTrendingGroupOptions = {}): Promise<NewsTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n source: options.source,\n });\n }\n\n /** Get sentiment for a specific stock ticker from news. */\n async stock(ticker: string, options: StockOptions = {}): Promise<NewsStockSentiment> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Get AI-generated explanation for a stock's news trend. */\n async explain(ticker: string): Promise<StockExplanationResponse> {\n return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);\n }\n\n /** Search for stocks by name or ticker in news. */\n async search(query: string): Promise<SearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side using news sentiment. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<NewsCompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n\n /** Get news data statistics. */\n async stats(): Promise<StatsResponse> {\n return this.request('/stats');\n }\n\n /** Get public news service health (no auth required on server side). */\n async health(): Promise<HealthResponse> {\n return this.request('/health');\n }\n}\n\nexport class XNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/x/stocks/v1');\n }\n\n /** Get trending stocks on X/Twitter. */\n async trending(options: TrendingOptions = {}): Promise<XTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on X/Twitter. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<XTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on X/Twitter. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<XTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get X/Twitter sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<XStockDetail> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Search for stocks by name or ticker on X/Twitter. */\n async search(query: string): Promise<SearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side on X/Twitter. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<CompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n}\n\nexport class PolymarketNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/polymarket/stocks/v1');\n }\n\n /** Get trending stocks on Polymarket. */\n async trending(options: TrendingOptions = {}): Promise<PolymarketTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on Polymarket. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<PolymarketTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on Polymarket. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<PolymarketTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get Polymarket sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<PolymarketStockDetail> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Search for stocks by name or ticker on Polymarket. */\n async search(query: string): Promise<PolymarketSearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side on Polymarket. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<PolymarketCompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n}\n\n// ── Client ──────────────────────────────────────────────────────────\n\nexport class AdanosClient {\n readonly news: NewsNamespace;\n readonly reddit: RedditNamespace;\n readonly x: XNamespace;\n readonly polymarket: PolymarketNamespace;\n\n /**\n * Create a new Finance Sentiment API client.\n *\n * @param options.apiKey - Your API key (`adanos_api_key_here`).\n * @param options.baseUrl - API base URL. Default: `https://api.adanos.org`.\n * @param options.timeout - Request timeout in ms. Default: 30000.\n */\n constructor(options: ClientOptions) {\n const baseUrl = options.baseUrl ?? 'https://api.adanos.org';\n const timeout = options.timeout ?? 30_000;\n const http = new HttpClient(baseUrl, options.apiKey, timeout);\n\n this.news = new NewsNamespace(http);\n this.reddit = new RedditNamespace(http);\n this.x = new XNamespace(http);\n this.polymarket = new PolymarketNamespace(http);\n }\n}\n\nexport const StockSentimentClient = AdanosClient;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC7C,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,WAAN,cAAuB,oBAAoB;AAAA,EAChD;AAAA,EACA;AAAA,EAEA,YAAY,QAAgB,QAAgB;AAC1C,UAAM,GAAG,MAAM,KAAK,MAAM,EAAE;AAC5B,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,SAAS;AAAA,EAChB;AACF;AA0dA,IAAM,aAAN,MAAiB;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,SAAiB,QAAgB,SAAiB;AAC5D,SAAK,UAAU,QAAQ,QAAQ,QAAQ,EAAE;AACzC,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,IAAO,MAAc,QAAkC;AAC3D,UAAM,MAAM,IAAI,IAAI,GAAG,KAAK,OAAO,GAAG,IAAI,EAAE;AAE5C,QAAI,QAAQ;AACV,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,YAAI,UAAU,QAAW;AACvB,cAAI,aAAa,IAAI,KAAK,OAAO,KAAK,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AAE5D,SAAK,OAAO,IAAI,cAAc,IAAI;AAClC,SAAK,SAAS,IAAI,gBAAgB,IAAI;AACtC,SAAK,IAAI,IAAI,WAAW,IAAI;AAC5B,SAAK,aAAa,IAAI,oBAAoB,IAAI;AAAA,EAChD;AACF;AAEO,IAAM,uBAAuB;","names":[]}
@@ -0,0 +1,532 @@
1
+ /**
2
+ * Adanos Finance Sentiment API — TypeScript SDK
3
+ *
4
+ * Analyze stock sentiment across News, Reddit, X/Twitter, and Polymarket.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { AdanosClient } from 'finance-sentiment';
9
+ *
10
+ * const client = new AdanosClient({ apiKey: 'adanos_api_key_here' });
11
+ * const trending = await client.reddit.trending({ days: 7 });
12
+ * ```
13
+ */
14
+ declare class StockSentimentError extends Error {
15
+ constructor(message: string);
16
+ }
17
+ declare class ApiError extends StockSentimentError {
18
+ status: number;
19
+ detail: string;
20
+ constructor(status: number, detail: string);
21
+ }
22
+ interface ClientOptions {
23
+ apiKey: string;
24
+ baseUrl?: string;
25
+ /** Request timeout in milliseconds. Default: 30000 */
26
+ timeout?: number;
27
+ }
28
+ interface TrendingOptions {
29
+ /** Time period in days (1-90). Free tier limited to 30. */
30
+ days?: number;
31
+ /** Max results (1-100). Default: 20. */
32
+ limit?: number;
33
+ /** Pagination offset. Default: 0. */
34
+ offset?: number;
35
+ /** Filter by "stock", "etf", "all", or undefined for all. */
36
+ type?: string;
37
+ }
38
+ interface TrendingGroupOptions {
39
+ days?: number;
40
+ limit?: number;
41
+ offset?: number;
42
+ }
43
+ interface StockOptions {
44
+ /** Time period in days (1-90). Default: 7. */
45
+ days?: number;
46
+ }
47
+ /** Alias — compare accepts the same options as a single-stock lookup. */
48
+ type CompareOptions = StockOptions;
49
+ interface NewsSourceOptions {
50
+ /** Optional strict source filter (canonical source id or known alias). */
51
+ source?: string;
52
+ }
53
+ interface NewsTrendingOptions extends TrendingOptions, NewsSourceOptions {
54
+ }
55
+ interface NewsTrendingGroupOptions extends TrendingGroupOptions, NewsSourceOptions {
56
+ }
57
+ type NewsStockOptions = StockOptions;
58
+ type NewsCompareOptions = CompareOptions;
59
+ interface TrendingStock {
60
+ ticker: string;
61
+ buzz_score: number;
62
+ trend: 'rising' | 'falling' | 'stable';
63
+ mentions: number;
64
+ unique_posts: number;
65
+ subreddit_count: number;
66
+ sentiment_score: number;
67
+ bullish_pct: number;
68
+ bearish_pct: number;
69
+ total_upvotes: number;
70
+ company_name?: string | null;
71
+ trend_history?: number[];
72
+ }
73
+ interface StockSentiment {
74
+ ticker: string;
75
+ found: boolean;
76
+ company_name?: string | null;
77
+ buzz_score?: number | null;
78
+ total_mentions?: number | null;
79
+ sentiment_score?: number | null;
80
+ positive_count?: number | null;
81
+ negative_count?: number | null;
82
+ neutral_count?: number | null;
83
+ total_upvotes?: number | null;
84
+ unique_posts?: number | null;
85
+ subreddit_count?: number | null;
86
+ trend?: 'rising' | 'falling' | 'stable' | null;
87
+ bullish_pct?: number | null;
88
+ bearish_pct?: number | null;
89
+ period_days?: number | null;
90
+ top_subreddits?: SubredditCount[] | null;
91
+ daily_trend?: DailyTrendItem[] | null;
92
+ top_mentions?: TopMention[] | null;
93
+ }
94
+ interface SubredditCount {
95
+ subreddit: string;
96
+ count: number;
97
+ }
98
+ interface DailyTrendItem {
99
+ date: string;
100
+ mentions: number;
101
+ sentiment?: number | null;
102
+ buzz_score?: number | null;
103
+ }
104
+ interface TopMention {
105
+ text_snippet: string;
106
+ sentiment_score: number;
107
+ sentiment_label: string;
108
+ upvotes: number;
109
+ subreddit: string;
110
+ created_utc: string;
111
+ }
112
+ interface StockExplanationResponse {
113
+ ticker: string;
114
+ company_name?: string | null;
115
+ explanation: string;
116
+ cached: boolean;
117
+ generated_at: string;
118
+ model?: string | null;
119
+ }
120
+ interface SchedulerStatus {
121
+ running: boolean;
122
+ last_scrape?: string | null;
123
+ scrape_count?: number;
124
+ error_count?: number;
125
+ success_rate?: number | null;
126
+ note?: string | null;
127
+ }
128
+ interface HealthResponse {
129
+ status: string;
130
+ service?: string | null;
131
+ version?: string | null;
132
+ total_mentions?: number;
133
+ tickers_tracked?: number;
134
+ scheduler?: SchedulerStatus | null;
135
+ error?: string | null;
136
+ }
137
+ interface StatsResponse {
138
+ total_mentions: number;
139
+ unique_tickers: number;
140
+ tickers: string[];
141
+ supported_tickers: number;
142
+ }
143
+ interface SearchResponse {
144
+ query: string;
145
+ count: number;
146
+ results: SearchResultItem[];
147
+ }
148
+ interface SearchResultItem {
149
+ ticker: string;
150
+ name: string;
151
+ type?: string | null;
152
+ exchange?: string | null;
153
+ sector?: string | null;
154
+ country?: string | null;
155
+ aliases?: string[] | null;
156
+ mention_count?: number | null;
157
+ }
158
+ interface CompareResponse {
159
+ period_days: number;
160
+ stocks: CompareStockItem[];
161
+ }
162
+ interface CompareStockItem {
163
+ ticker: string;
164
+ company_name?: string | null;
165
+ buzz_score: number;
166
+ mentions: number;
167
+ sentiment?: number | null;
168
+ upvotes: number;
169
+ }
170
+ interface TrendingGroupBase {
171
+ buzz_score: number;
172
+ trend: 'rising' | 'falling' | 'stable';
173
+ mentions: number;
174
+ unique_tickers: number;
175
+ sentiment_score: number;
176
+ bullish_pct: number;
177
+ bearish_pct: number;
178
+ total_upvotes: number;
179
+ top_tickers: string[];
180
+ }
181
+ interface TrendingSector extends TrendingGroupBase {
182
+ sector: string;
183
+ subreddit_count: number;
184
+ }
185
+ interface TrendingCountry extends TrendingGroupBase {
186
+ country: string;
187
+ subreddit_count: number;
188
+ }
189
+ interface NewsTrendingStock {
190
+ ticker: string;
191
+ buzz_score: number;
192
+ trend: 'rising' | 'falling' | 'stable';
193
+ mentions: number;
194
+ source_count: number;
195
+ sentiment_score: number;
196
+ bullish_pct: number;
197
+ bearish_pct: number;
198
+ company_name?: string | null;
199
+ trend_history?: number[];
200
+ }
201
+ interface NewsSourceCount {
202
+ source: string;
203
+ count: number;
204
+ }
205
+ interface NewsTopMention {
206
+ text_snippet: string;
207
+ sentiment_score: number;
208
+ sentiment_label: string;
209
+ source: string;
210
+ created_utc: string;
211
+ }
212
+ interface NewsStockSentiment {
213
+ ticker: string;
214
+ found: boolean;
215
+ company_name?: string | null;
216
+ buzz_score?: number | null;
217
+ total_mentions?: number | null;
218
+ sentiment_score?: number | null;
219
+ positive_count?: number | null;
220
+ negative_count?: number | null;
221
+ neutral_count?: number | null;
222
+ source_count?: number | null;
223
+ trend?: 'rising' | 'falling' | 'stable' | null;
224
+ bullish_pct?: number | null;
225
+ bearish_pct?: number | null;
226
+ period_days?: number | null;
227
+ top_sources?: NewsSourceCount[] | null;
228
+ daily_trend?: DailyTrendItem[] | null;
229
+ top_mentions?: NewsTopMention[] | null;
230
+ }
231
+ interface NewsTrendingGroupBase {
232
+ buzz_score: number;
233
+ trend: 'rising' | 'falling' | 'stable';
234
+ mentions: number;
235
+ unique_tickers: number;
236
+ source_count: number;
237
+ sentiment_score: number;
238
+ bullish_pct: number;
239
+ bearish_pct: number;
240
+ top_tickers: string[];
241
+ }
242
+ interface NewsTrendingSector extends NewsTrendingGroupBase {
243
+ sector: string;
244
+ }
245
+ interface NewsTrendingCountry extends NewsTrendingGroupBase {
246
+ country: string;
247
+ }
248
+ interface NewsCompareStockItem {
249
+ ticker: string;
250
+ company_name?: string | null;
251
+ buzz_score: number;
252
+ mentions: number;
253
+ source_count: number;
254
+ sentiment?: number | null;
255
+ }
256
+ interface NewsCompareResponse {
257
+ period_days: number;
258
+ stocks: NewsCompareStockItem[];
259
+ }
260
+ interface XTrendingStock {
261
+ ticker: string;
262
+ buzz_score: number;
263
+ trend: string;
264
+ mentions: number;
265
+ company_name?: string | null;
266
+ sentiment_score?: number | null;
267
+ bullish_pct?: number | null;
268
+ bearish_pct?: number | null;
269
+ total_upvotes?: number | null;
270
+ unique_tweets?: number | null;
271
+ is_validated: boolean;
272
+ trend_history?: number[];
273
+ }
274
+ interface XStockDetail {
275
+ ticker: string;
276
+ found: boolean;
277
+ company_name?: string | null;
278
+ buzz_score?: number | null;
279
+ total_mentions?: number | null;
280
+ sentiment_score?: number | null;
281
+ positive_count?: number | null;
282
+ negative_count?: number | null;
283
+ neutral_count?: number | null;
284
+ total_upvotes?: number | null;
285
+ unique_tweets?: number | null;
286
+ trend?: 'rising' | 'falling' | 'stable' | null;
287
+ bullish_pct?: number | null;
288
+ bearish_pct?: number | null;
289
+ period_days?: number | null;
290
+ daily_trend?: XDailyTrendItem[] | null;
291
+ top_tweets?: XTopTweet[] | null;
292
+ is_validated: boolean;
293
+ }
294
+ interface XDailyTrendItem {
295
+ date: string;
296
+ mentions: number;
297
+ sentiment?: number | null;
298
+ avg_rank?: number | null;
299
+ buzz_score?: number | null;
300
+ }
301
+ interface XTopTweet {
302
+ text_snippet: string;
303
+ sentiment_score?: number | null;
304
+ sentiment_label?: string | null;
305
+ likes: number;
306
+ retweets: number;
307
+ views?: number | null;
308
+ author?: string | null;
309
+ created_at?: string | null;
310
+ }
311
+ interface XTrendingGroupBase {
312
+ buzz_score: number;
313
+ trend: 'rising' | 'falling' | 'stable';
314
+ mentions: number;
315
+ unique_tickers: number;
316
+ unique_authors: number;
317
+ sentiment_score?: number | null;
318
+ bullish_pct?: number | null;
319
+ bearish_pct?: number | null;
320
+ total_upvotes?: number | null;
321
+ top_tickers: string[];
322
+ }
323
+ interface XTrendingSector extends XTrendingGroupBase {
324
+ sector: string;
325
+ }
326
+ interface XTrendingCountry extends XTrendingGroupBase {
327
+ country: string;
328
+ }
329
+ interface PolymarketTrendingStock {
330
+ ticker: string;
331
+ buzz_score: number;
332
+ trend: 'rising' | 'falling' | 'stable';
333
+ trade_count: number;
334
+ market_count: number;
335
+ unique_traders?: number | null;
336
+ bullish_pct: number;
337
+ bearish_pct: number;
338
+ total_liquidity: number;
339
+ company_name?: string | null;
340
+ sentiment_score?: number | null;
341
+ trend_history?: number[];
342
+ }
343
+ interface PolymarketDailyTrendItem {
344
+ date: string;
345
+ trade_count: number;
346
+ sentiment?: number | null;
347
+ buzz_score?: number | null;
348
+ }
349
+ interface PolymarketTopMention {
350
+ condition_id: string;
351
+ question: string;
352
+ market_type: string;
353
+ trade_count?: number | null;
354
+ sentiment_score?: number | null;
355
+ yes_price?: number | null;
356
+ no_price?: number | null;
357
+ liquidity: number;
358
+ volume_24h: number;
359
+ end_date?: string | null;
360
+ active: boolean;
361
+ }
362
+ interface PolymarketStockDetail {
363
+ ticker: string;
364
+ found: boolean;
365
+ company_name?: string | null;
366
+ buzz_score?: number | null;
367
+ trend?: 'rising' | 'falling' | 'stable' | null;
368
+ period_days?: number | null;
369
+ trade_count?: number | null;
370
+ market_count?: number | null;
371
+ unique_traders?: number | null;
372
+ sentiment_score?: number | null;
373
+ positive_count?: number | null;
374
+ negative_count?: number | null;
375
+ neutral_count?: number | null;
376
+ bullish_pct?: number | null;
377
+ bearish_pct?: number | null;
378
+ total_liquidity?: number | null;
379
+ daily_trend?: PolymarketDailyTrendItem[] | null;
380
+ top_mentions?: PolymarketTopMention[] | null;
381
+ }
382
+ interface PolymarketTrendingGroupBase {
383
+ buzz_score: number;
384
+ trend: 'rising' | 'falling' | 'stable';
385
+ trade_count: number;
386
+ market_count: number;
387
+ unique_tickers: number;
388
+ unique_traders?: number | null;
389
+ sentiment_score?: number | null;
390
+ bullish_pct: number;
391
+ bearish_pct: number;
392
+ total_liquidity: number;
393
+ top_tickers: string[];
394
+ }
395
+ interface PolymarketTrendingSector extends PolymarketTrendingGroupBase {
396
+ sector: string;
397
+ }
398
+ interface PolymarketTrendingCountry extends PolymarketTrendingGroupBase {
399
+ country: string;
400
+ }
401
+ interface PolymarketCompareStockItem {
402
+ ticker: string;
403
+ company_name?: string | null;
404
+ buzz_score: number;
405
+ trade_count: number;
406
+ market_count: number;
407
+ unique_traders?: number | null;
408
+ sentiment?: number | null;
409
+ total_liquidity: number;
410
+ }
411
+ interface PolymarketCompareResponse {
412
+ period_days: number;
413
+ stocks: PolymarketCompareStockItem[];
414
+ }
415
+ interface PolymarketSearchResultItem {
416
+ ticker: string;
417
+ name: string;
418
+ type?: string | null;
419
+ exchange?: string | null;
420
+ sector?: string | null;
421
+ country?: string | null;
422
+ aliases: string[];
423
+ trade_count: number;
424
+ }
425
+ interface PolymarketSearchResponse {
426
+ query: string;
427
+ count: number;
428
+ results: PolymarketSearchResultItem[];
429
+ }
430
+ type QueryParams = Record<string, string | number | undefined>;
431
+ declare class HttpClient {
432
+ private baseUrl;
433
+ private apiKey;
434
+ private timeout;
435
+ constructor(baseUrl: string, apiKey: string, timeout: number);
436
+ get<T>(path: string, params?: QueryParams): Promise<T>;
437
+ }
438
+ declare class PlatformNamespace {
439
+ protected http: HttpClient;
440
+ protected prefix: string;
441
+ constructor(http: HttpClient, prefix: string);
442
+ protected request<T>(path: string, params?: QueryParams): Promise<T>;
443
+ }
444
+ declare class RedditNamespace extends PlatformNamespace {
445
+ /** @internal */
446
+ constructor(http: HttpClient);
447
+ /** Get trending stocks on Reddit. */
448
+ trending(options?: TrendingOptions): Promise<TrendingStock[]>;
449
+ /** Get trending sectors on Reddit. */
450
+ trendingSectors(options?: TrendingGroupOptions): Promise<TrendingSector[]>;
451
+ /** Get trending countries on Reddit. */
452
+ trendingCountries(options?: TrendingGroupOptions): Promise<TrendingCountry[]>;
453
+ /** Get sentiment for a specific stock ticker. */
454
+ stock(ticker: string, options?: StockOptions): Promise<StockSentiment>;
455
+ /** Get AI-generated explanation for a stock's trend. */
456
+ explain(ticker: string): Promise<StockExplanationResponse>;
457
+ /** Search for stocks by name or ticker. */
458
+ search(query: string): Promise<SearchResponse>;
459
+ /** Compare multiple stocks side-by-side. */
460
+ compare(tickers: string[], options?: CompareOptions): Promise<CompareResponse>;
461
+ }
462
+ declare class NewsNamespace extends PlatformNamespace {
463
+ /** @internal */
464
+ constructor(http: HttpClient);
465
+ /** Get trending stocks from news. */
466
+ trending(options?: NewsTrendingOptions): Promise<NewsTrendingStock[]>;
467
+ /** Get trending sectors from news. */
468
+ trendingSectors(options?: NewsTrendingGroupOptions): Promise<NewsTrendingSector[]>;
469
+ /** Get trending countries from news. */
470
+ trendingCountries(options?: NewsTrendingGroupOptions): Promise<NewsTrendingCountry[]>;
471
+ /** Get sentiment for a specific stock ticker from news. */
472
+ stock(ticker: string, options?: StockOptions): Promise<NewsStockSentiment>;
473
+ /** Get AI-generated explanation for a stock's news trend. */
474
+ explain(ticker: string): Promise<StockExplanationResponse>;
475
+ /** Search for stocks by name or ticker in news. */
476
+ search(query: string): Promise<SearchResponse>;
477
+ /** Compare multiple stocks side-by-side using news sentiment. */
478
+ compare(tickers: string[], options?: CompareOptions): Promise<NewsCompareResponse>;
479
+ /** Get news data statistics. */
480
+ stats(): Promise<StatsResponse>;
481
+ /** Get public news service health (no auth required on server side). */
482
+ health(): Promise<HealthResponse>;
483
+ }
484
+ declare class XNamespace extends PlatformNamespace {
485
+ /** @internal */
486
+ constructor(http: HttpClient);
487
+ /** Get trending stocks on X/Twitter. */
488
+ trending(options?: TrendingOptions): Promise<XTrendingStock[]>;
489
+ /** Get trending sectors on X/Twitter. */
490
+ trendingSectors(options?: TrendingGroupOptions): Promise<XTrendingSector[]>;
491
+ /** Get trending countries on X/Twitter. */
492
+ trendingCountries(options?: TrendingGroupOptions): Promise<XTrendingCountry[]>;
493
+ /** Get X/Twitter sentiment for a specific stock ticker. */
494
+ stock(ticker: string, options?: StockOptions): Promise<XStockDetail>;
495
+ /** Search for stocks by name or ticker on X/Twitter. */
496
+ search(query: string): Promise<SearchResponse>;
497
+ /** Compare multiple stocks side-by-side on X/Twitter. */
498
+ compare(tickers: string[], options?: CompareOptions): Promise<CompareResponse>;
499
+ }
500
+ declare class PolymarketNamespace extends PlatformNamespace {
501
+ /** @internal */
502
+ constructor(http: HttpClient);
503
+ /** Get trending stocks on Polymarket. */
504
+ trending(options?: TrendingOptions): Promise<PolymarketTrendingStock[]>;
505
+ /** Get trending sectors on Polymarket. */
506
+ trendingSectors(options?: TrendingGroupOptions): Promise<PolymarketTrendingSector[]>;
507
+ /** Get trending countries on Polymarket. */
508
+ trendingCountries(options?: TrendingGroupOptions): Promise<PolymarketTrendingCountry[]>;
509
+ /** Get Polymarket sentiment for a specific stock ticker. */
510
+ stock(ticker: string, options?: StockOptions): Promise<PolymarketStockDetail>;
511
+ /** Search for stocks by name or ticker on Polymarket. */
512
+ search(query: string): Promise<PolymarketSearchResponse>;
513
+ /** Compare multiple stocks side-by-side on Polymarket. */
514
+ compare(tickers: string[], options?: CompareOptions): Promise<PolymarketCompareResponse>;
515
+ }
516
+ declare class AdanosClient {
517
+ readonly news: NewsNamespace;
518
+ readonly reddit: RedditNamespace;
519
+ readonly x: XNamespace;
520
+ readonly polymarket: PolymarketNamespace;
521
+ /**
522
+ * Create a new Finance Sentiment API client.
523
+ *
524
+ * @param options.apiKey - Your API key (`adanos_api_key_here`).
525
+ * @param options.baseUrl - API base URL. Default: `https://api.adanos.org`.
526
+ * @param options.timeout - Request timeout in ms. Default: 30000.
527
+ */
528
+ constructor(options: ClientOptions);
529
+ }
530
+ declare const StockSentimentClient: typeof AdanosClient;
531
+
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 };