sentisense 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/sentisense.svg)](https://www.npmjs.com/package/sentisense)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- Official JavaScript/TypeScript SDK and CLI for the [SentiSense](https://sentisense.ai) market intelligence API: stock prices, news and social sentiment, the SentiSense Score, insider and congressional trading, institutional 13F flows, options positioning, analyst ratings, earnings analysis, and a cross-signal screener.
6
+ Official JavaScript/TypeScript SDK and CLI for the [SentiSense](https://sentisense.ai) market intelligence API: stock prices, news and social sentiment, the SentiSense Score, the SentiSense Rating, insider and congressional trading, institutional 13F flows, options positioning, analyst ratings, earnings analysis, and a cross-signal screener.
7
7
 
8
8
  - Full TypeScript support with detailed type definitions
9
9
  - Works in Node.js 18+, Deno, Bun, and browsers
@@ -212,6 +212,7 @@ client.stocks.getFundamentals("AAPL") // Financial data
212
212
  client.stocks.getShortInterest("GME") // Short interest
213
213
  client.stocks.getOptionsSummary("NVDA") // End-of-day options dossier
214
214
  client.stocks.getOptionsHistory("NVDA", { window: "2y" }) // Daily options aggregates over time
215
+ client.stocks.getRating("AAPL") // SentiSense Rating: letter, percentile, dimensions
215
216
  client.stocks.getAISummary("AAPL", { depth: "deep" }) // AI report (PRO)
216
217
  ```
217
218
 
@@ -332,6 +333,11 @@ const { data: book } = await client.analyst.coverage("NVDA");
332
333
  console.log(`${book.firmCount} firms, ${book.namedAnalystCount} named analysts`);
333
334
  console.log(`${book.attributedNoteCount} of ${book.noteCount} notes name someone`);
334
335
 
336
+ const buckets = book.ratingBuckets;
337
+ if (buckets) {
338
+ console.log(`${buckets.buy} buy, ${buckets.hold} hold, ${buckets.sell} sell, ${buckets.unrated} unrated of ${buckets.total}`);
339
+ }
340
+
335
341
  for (const row of book.coverage.slice(0, 5)) {
336
342
  if (row.noteCount === 0) {
337
343
  // A desk can cover a stock on rating actions alone, with no price target.
@@ -351,6 +357,8 @@ for (const row of book.coverage.slice(0, 5)) {
351
357
 
352
358
  Two shapes to read rather than assume. A firm can appear with `noteCount: 0`, a `null` `latestNote` and a populated `firmRating`, because coverage means a price target **or** a rating action in the window. And a large, publisher-dependent share of notes name no individual, so an empty `analysts` array alongside a non-zero `noteCount` is normal: read `attributedNoteCount` and `unattributedNoteCount` off the response rather than hardcoding a rate. The response-level counts survive the free truncation, so they describe the whole window even when only 5 rows come back. An unknown slug throws `NotFoundError`, which keeps "published nothing we hold" distinguishable from "does not exist".
353
359
 
360
+ `ratingBuckets` sizes the same book by rating tier: `buy`, `hold`, `sell`, `unrated` and `total`, counted over every covering firm before the free truncation, so `buy + hold + sell + unrated === total` and a free key reads the same numbers as a PRO one. `unrated` is a desk with no current rating on record, such as a price-target-only firm. These count the firms in this coverage book, a different population from the `strongBuy` through `strongSell` figures on `client.analyst.consensus`, which come from the provider's analyst survey. Read one or the other, do not reconcile them.
361
+
354
362
  ### Earnings
355
363
 
356
364
  The earnings analysis report is the assembled version of a quarter: one object per fiscal period carrying the editorial headline, the KPI cards with year-over-year deltas, the guidance language as management phrased it, and a summary of the earnings call. Pair it with the recent-reporters feed to drive a post-earnings sweep. Both return the preview envelope.
@@ -418,7 +426,7 @@ client.entityMetrics.getDistribution("AAPL", "sentiment")
418
426
  client.entityMetrics.getDistribution("AAPL", "mentions", { dimension: "source" })
419
427
  ```
420
428
 
421
- Available metric types: `mentions`, `sentiment`, `sentisense`, `social_dominance`, `creators`.
429
+ Available metric types: `mentions`, `sentiment`, `sentisense_score`, `sentisense_rating`, `social_dominance`, `creators`. `sentisense_rating` is the SentiSense Rating percentile and is a time series only: it has no source breakdown, so `getDistribution` answers with an empty distribution for it.
422
430
 
423
431
  ### Options
424
432
 
@@ -434,6 +442,28 @@ The radar carries two separately-ranked boards: `data.rows` for stocks and `data
434
442
 
435
443
  A row whose baseline is still building carries its raw readings with the percentiles and `interestScore` omitted, which means "not enough history yet" rather than "nothing interesting". `getOptionsSummary` reports an uncovered ticker as a `null` payload; `getOptionsHistory` reports it as an empty `series` instead, so check the array rather than null-checking there.
436
444
 
445
+ ### SentiSense Rating
446
+
447
+ Where a stock ranks against the other stocks rated that day, as a letter and a percentile, plus the six dimensions the rank is blended from. It is a relative research signal for informational and educational purposes, not financial, investment or trading advice, and not a recommendation about any security. Every response carries the wording to display alongside a grade in `disclaimer`. [Methodology](https://sentisense.ai/methodology/#sentisense-rating).
448
+
449
+ ```typescript
450
+ const rating = await client.stocks.getRating("AAPL");
451
+ if (rating.rated) {
452
+ console.log(rating.letter, rating.percentile, "of", rating.ratedCount, "rated stocks");
453
+ for (const dim of rating.dimensions.filter((d) => d.present)) {
454
+ console.log(" ", dim.label, dim.percentile);
455
+ }
456
+ } else {
457
+ console.log("no grade today:", rating.reason);
458
+ }
459
+ ```
460
+
461
+ `StockRating` is a discriminated union on `rated`, so the `if` narrows to `letter`, `percentile`, `composite`, `ratedCount` and `methodologyVersion`, and the `else` narrows to `reason`, `dimensionsPresent` and `presentDimensions`. Branch on that flag rather than testing a field for `undefined`.
462
+
463
+ Having no grade is a normal 200, not a 404: ETFs and tickers outside the swept universe answer that way, and `reason` is one of `stale`, `not_rated_today`, `insufficient_dimensions` or `insufficient_coverage_weight`. Only a ticker that resolves to nothing we track rejects with `NotFoundError`.
464
+
465
+ `dimensions` always holds all six rows in a fixed order, including the ones with no data, which arrive with `present` false and a `null` percentile. Read `present` first and never substitute zero for a missing percentile: zero is the bottom of the cross-section, absence is not a position on it. Only the smart-money dimension carries `subLegs`. `letter` is served as stored rather than derived from `percentile`, so read it instead of computing your own bucket edges. For the daily history of a stock's percentile, ask `entityMetrics.getMetrics` for the `sentisense_rating` metric.
466
+
437
467
  ### Market mood & knowledge base
438
468
 
439
469
  ```typescript
package/dist/cli.cjs CHANGED
@@ -1037,7 +1037,7 @@ var flowsCommand = {
1037
1037
  };
1038
1038
 
1039
1039
  // src/version.ts
1040
- var VERSION = "0.49.0";
1040
+ var VERSION = "0.50.0";
1041
1041
 
1042
1042
  // src/resources/analyst.ts
1043
1043
  var Analyst = class {
@@ -2069,6 +2069,38 @@ var Stocks = class {
2069
2069
  options
2070
2070
  );
2071
2071
  }
2072
+ /**
2073
+ * Get the SentiSense Rating for one stock: where it ranks against the other stocks rated
2074
+ * that day, and the six dimensions the rank is blended from.
2075
+ *
2076
+ * The Rating is a *relative*, automatically generated research signal, for informational
2077
+ * and educational purposes only. It ranks a stock against its cross-section; it is not
2078
+ * financial, investment or trading advice and it is not a recommendation about any
2079
+ * security. `disclaimer` carries the wording to display alongside a grade. Methodology:
2080
+ * https://sentisense.ai/methodology/#sentisense-rating
2081
+ *
2082
+ * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `letter`,
2083
+ * `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the `else` branch
2084
+ * narrows to `reason`, `dimensionsPresent` and `presentDimensions`. Branch on the flag
2085
+ * rather than testing a field for `undefined`.
2086
+ *
2087
+ * **Having no grade is a normal 200, not a 404.** ETFs and tickers outside the swept
2088
+ * universe answer with `rated` false, and the composition still arrives so a card can
2089
+ * render. Only a ticker that resolves to nothing we track rejects with
2090
+ * {@link NotFoundError}; a request with no usable key rejects with
2091
+ * {@link AuthenticationError}.
2092
+ *
2093
+ * `dimensions` always holds all six rows in a fixed order, including the ones with no
2094
+ * data, which arrive with `present` false and a `null` percentile. Read `present` first
2095
+ * and never read a missing percentile as zero. `letter` is served as stored rather than
2096
+ * derived from `percentile`, so read it instead of computing your own bucket edges.
2097
+ *
2098
+ * For the daily history of a stock's percentile, ask `client.entityMetrics.getMetrics`
2099
+ * for the `sentisense_rating` metric.
2100
+ */
2101
+ async getRating(ticker) {
2102
+ return this.client.get(`/api/v1/rating/${encodeURIComponent(ticker.toUpperCase())}`);
2103
+ }
2072
2104
  };
2073
2105
 
2074
2106
  // src/resources/indexes.ts
package/dist/index.cjs CHANGED
@@ -1104,6 +1104,38 @@ var Stocks = class {
1104
1104
  options
1105
1105
  );
1106
1106
  }
1107
+ /**
1108
+ * Get the SentiSense Rating for one stock: where it ranks against the other stocks rated
1109
+ * that day, and the six dimensions the rank is blended from.
1110
+ *
1111
+ * The Rating is a *relative*, automatically generated research signal, for informational
1112
+ * and educational purposes only. It ranks a stock against its cross-section; it is not
1113
+ * financial, investment or trading advice and it is not a recommendation about any
1114
+ * security. `disclaimer` carries the wording to display alongside a grade. Methodology:
1115
+ * https://sentisense.ai/methodology/#sentisense-rating
1116
+ *
1117
+ * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `letter`,
1118
+ * `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the `else` branch
1119
+ * narrows to `reason`, `dimensionsPresent` and `presentDimensions`. Branch on the flag
1120
+ * rather than testing a field for `undefined`.
1121
+ *
1122
+ * **Having no grade is a normal 200, not a 404.** ETFs and tickers outside the swept
1123
+ * universe answer with `rated` false, and the composition still arrives so a card can
1124
+ * render. Only a ticker that resolves to nothing we track rejects with
1125
+ * {@link NotFoundError}; a request with no usable key rejects with
1126
+ * {@link AuthenticationError}.
1127
+ *
1128
+ * `dimensions` always holds all six rows in a fixed order, including the ones with no
1129
+ * data, which arrive with `present` false and a `null` percentile. Read `present` first
1130
+ * and never read a missing percentile as zero. `letter` is served as stored rather than
1131
+ * derived from `percentile`, so read it instead of computing your own bucket edges.
1132
+ *
1133
+ * For the daily history of a stock's percentile, ask `client.entityMetrics.getMetrics`
1134
+ * for the `sentisense_rating` metric.
1135
+ */
1136
+ async getRating(ticker) {
1137
+ return this.client.get(`/api/v1/rating/${encodeURIComponent(ticker.toUpperCase())}`);
1138
+ }
1107
1139
  };
1108
1140
 
1109
1141
  // src/resources/indexes.ts
@@ -1183,7 +1215,7 @@ var Trackers = class {
1183
1215
  };
1184
1216
 
1185
1217
  // src/version.ts
1186
- var VERSION = "0.49.0";
1218
+ var VERSION = "0.50.0";
1187
1219
 
1188
1220
  // src/client.ts
1189
1221
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";