sentisense 0.33.0 → 0.35.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 +105 -6
- package/dist/index.cjs +104 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +350 -27
- package/dist/index.d.ts +350 -27
- package/dist/index.mjs +104 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -6
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,17 @@ interface StockQuote {
|
|
|
49
49
|
dividendYield: number | null;
|
|
50
50
|
/** 200-day simple moving average of daily closes. Null when fewer than 200 trading days of history exist. */
|
|
51
51
|
movingAverage200Day: number | null;
|
|
52
|
+
/**
|
|
53
|
+
* Currency the issuer reports its financials in ("USD", "TWD", "JPY", ...). Absent when
|
|
54
|
+
* the currency is unknown, which is not the same as implicitly USD. Same field and same
|
|
55
|
+
* meaning as {@link Fundamentals.reportedCurrency}.
|
|
56
|
+
*
|
|
57
|
+
* Price fields on this response are always in the listing currency of the quoted symbol,
|
|
58
|
+
* so on an ADR filing in a home currency the price and the per-share statement figures are
|
|
59
|
+
* in different units. The valuation ratios derived from both (`peRatio`, `epsTTM`) are
|
|
60
|
+
* omitted rather than computed in that case, so treat them as possibly absent, not zero.
|
|
61
|
+
*/
|
|
62
|
+
reportedCurrency?: string;
|
|
52
63
|
timestamp: number | null;
|
|
53
64
|
/** Extended-hours view (pre-market or after-hours). Null/absent during RTH, overnight, and weekends. */
|
|
54
65
|
extendedHours?: ExtendedHoursInfo | null;
|
|
@@ -89,10 +100,15 @@ interface StockEntity {
|
|
|
89
100
|
}
|
|
90
101
|
/** Per-source tone for a stock: where the conversation is, and how it leans. */
|
|
91
102
|
interface SentimentSourceTone {
|
|
103
|
+
/** "News", "Reddit", "X", "YouTube", "Substack". */
|
|
92
104
|
source: string;
|
|
93
105
|
/** "Bullish" | "Neutral" | "Bearish". */
|
|
94
106
|
direction: string;
|
|
95
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Whole-number percent of this stock's mentions, not a fraction. Each source's share is
|
|
109
|
+
* rounded independently, so the array sums to about 100 rather than exactly 100: 101 is
|
|
110
|
+
* common and is not a data error. Do not use the shares to reconstruct per-source counts.
|
|
111
|
+
*/
|
|
96
112
|
mentionShare: number;
|
|
97
113
|
/** Exact polarity in [-1, 1]. */
|
|
98
114
|
value?: number;
|
|
@@ -127,7 +143,9 @@ interface StockSentiment {
|
|
|
127
143
|
mentions?: number;
|
|
128
144
|
/** 30-day average mentions per day. */
|
|
129
145
|
mentionsAvg30d?: number;
|
|
146
|
+
/** Latest share of voice, as a fraction (0.021 = 2.1%). Note this is NOT the same unit as `mentionShare`. */
|
|
130
147
|
socialDominance?: number;
|
|
148
|
+
/** Per-source tone, loudest source first. */
|
|
131
149
|
bySource?: SentimentSourceTone[];
|
|
132
150
|
relatedTickers?: Array<{
|
|
133
151
|
ticker: string;
|
|
@@ -263,9 +281,14 @@ interface AISummary {
|
|
|
263
281
|
}
|
|
264
282
|
interface GetChartOptions {
|
|
265
283
|
/**
|
|
266
|
-
* Chart range. "MAX" returns the full available history (up to ~26 years)
|
|
267
|
-
*
|
|
268
|
-
*
|
|
284
|
+
* Chart range. "MAX" returns the full available history (up to ~26 years) as monthly bars;
|
|
285
|
+
* "10Y" and "5Y" return weekly bars.
|
|
286
|
+
*
|
|
287
|
+
* Price basis differs by range, so do not compare closes across two ranges without
|
|
288
|
+
* checking this: "10Y" and "MAX" are split- and dividend-adjusted, while "5Y" and every
|
|
289
|
+
* shorter range are split-adjusted only. A "5Y" weekly close equals the "1Y" daily close of
|
|
290
|
+
* that week's last trading day; the "10Y" bar for the same week is lower by the dividends
|
|
291
|
+
* paid since, and the gap widens the further back you read.
|
|
269
292
|
*
|
|
270
293
|
* "ALL" is a legacy alias of "5Y", retained so existing code keeps compiling.
|
|
271
294
|
*/
|
|
@@ -285,6 +308,11 @@ interface GetProfileOptions {
|
|
|
285
308
|
}
|
|
286
309
|
interface GetAISummaryOptions {
|
|
287
310
|
depth?: "basic" | "deep";
|
|
311
|
+
/**
|
|
312
|
+
* @deprecated Has no effect and is no longer sent. Reports are curated and served
|
|
313
|
+
* as published, so there is nothing for a caller to regenerate on demand. Accepted
|
|
314
|
+
* only so existing code keeps compiling; drop it from your call.
|
|
315
|
+
*/
|
|
288
316
|
forceRefresh?: boolean;
|
|
289
317
|
}
|
|
290
318
|
interface GetMetricsBreakdownOptions {
|
|
@@ -310,6 +338,15 @@ interface Document {
|
|
|
310
338
|
id: string;
|
|
311
339
|
url: string;
|
|
312
340
|
source: "NEWS" | "REDDIT" | "X" | "SUBSTACK" | "YOUTUBE";
|
|
341
|
+
/**
|
|
342
|
+
* Publisher name for a news article, e.g. `"The Motley Fool"`. Null on social sources,
|
|
343
|
+
* where the publisher is the platform already named in `source`, so fall back to
|
|
344
|
+
* `source` for a label rather than printing an empty string.
|
|
345
|
+
*
|
|
346
|
+
* Typed optional so existing object literals keep compiling; the API sends the key on
|
|
347
|
+
* every document row.
|
|
348
|
+
*/
|
|
349
|
+
sourceName?: string | null;
|
|
313
350
|
published: number;
|
|
314
351
|
averageSentiment: number;
|
|
315
352
|
reliability: number;
|
|
@@ -430,7 +467,7 @@ interface InstitutionalFlow {
|
|
|
430
467
|
avgClosePrice?: number | null;
|
|
431
468
|
/**
|
|
432
469
|
* Dollar-weighted net flow: `netSharesChange × avgClosePrice`. 0 when
|
|
433
|
-
* `avgClosePrice` is missing
|
|
470
|
+
* `avgClosePrice` is missing, so fall back to displaying `netSharesChange`.
|
|
434
471
|
*/
|
|
435
472
|
dollarFlowUsd: number;
|
|
436
473
|
}
|
|
@@ -443,6 +480,36 @@ interface Holder {
|
|
|
443
480
|
changeType: "NEW" | "INCREASED" | "DECREASED" | "SOLD_OUT" | "UNCHANGED";
|
|
444
481
|
sharesChange: number;
|
|
445
482
|
sharesChangePct: number;
|
|
483
|
+
/**
|
|
484
|
+
* URL slug for this filer, to pass straight to
|
|
485
|
+
* `institutional.getInstitutionDetail()`. Null when the filer has no curated
|
|
486
|
+
* institution page, so check it before building a link.
|
|
487
|
+
*
|
|
488
|
+
* Typed optional so existing object literals keep compiling; the API sends the key
|
|
489
|
+
* on every holder row.
|
|
490
|
+
*/
|
|
491
|
+
entitySlug?: string | null;
|
|
492
|
+
/**
|
|
493
|
+
* Number of SEC filer CIKs rolled up into this row, when the row aggregates a
|
|
494
|
+
* multi-filer manager. Null for a single-CIK filer, which is the common case, so
|
|
495
|
+
* read it as "1 or unknown" rather than zero.
|
|
496
|
+
*/
|
|
497
|
+
cikCount?: number | null;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* A server-side shortlist of the quarter's significant position changes, so a caller
|
|
501
|
+
* paging through thousands of rows does not have to fetch them all to find the movers.
|
|
502
|
+
*
|
|
503
|
+
* Scoped to the whole ticker, not to the page you asked for: the same values come back
|
|
504
|
+
* whatever `limit` and `offset` you send. The server picks both the threshold behind
|
|
505
|
+
* `count` and the ranking behind `top`, and neither is part of the API contract, so treat
|
|
506
|
+
* this as a display aid and re-derive anything you need to sort or filter on from `holders`.
|
|
507
|
+
*/
|
|
508
|
+
interface HolderNotableChanges {
|
|
509
|
+
/** How many holders the server judged to have changed significantly this quarter. */
|
|
510
|
+
count: number;
|
|
511
|
+
/** The shortlist itself, already ranked. Same row shape as `holders`. */
|
|
512
|
+
top: Holder[];
|
|
446
513
|
}
|
|
447
514
|
/**
|
|
448
515
|
* Institutional ownership for one ticker: the `data` payload of
|
|
@@ -456,8 +523,25 @@ interface TickerHolders {
|
|
|
456
523
|
reportDate: string;
|
|
457
524
|
totalInstitutionalShares: number;
|
|
458
525
|
totalInstitutionalValue: number;
|
|
526
|
+
/** Every institutional holder of this ticker for the quarter, ignoring any paging. */
|
|
459
527
|
holderCount: number;
|
|
460
528
|
holders: Holder[];
|
|
529
|
+
/**
|
|
530
|
+
* Rows actually returned in `holders`. Sent only when you passed `limit`, so use
|
|
531
|
+
* `holders.length` if you need a count that is always there. On the last page it is
|
|
532
|
+
* smaller than the `limit` you asked for, which is how you know to stop.
|
|
533
|
+
*/
|
|
534
|
+
returnedCount?: number;
|
|
535
|
+
/**
|
|
536
|
+
* Row offset these `holders` start at, echoing the request. Sent only when you passed
|
|
537
|
+
* `limit`; the unpaged response omits it rather than sending 0.
|
|
538
|
+
*/
|
|
539
|
+
offset?: number;
|
|
540
|
+
/**
|
|
541
|
+
* Ticker-wide summary of the quarter's biggest position changes. Sent only when you
|
|
542
|
+
* passed `limit`, since it exists to spare a paging caller a full scan.
|
|
543
|
+
*/
|
|
544
|
+
notableChanges?: HolderNotableChanges;
|
|
461
545
|
}
|
|
462
546
|
/**
|
|
463
547
|
* The flows payload inside the response envelope: `institutional.getFlows()` returns
|
|
@@ -494,6 +578,27 @@ type InstitutionalFlowsResponse = InstitutionalFlows;
|
|
|
494
578
|
interface GetFlowsOptions {
|
|
495
579
|
limit?: number;
|
|
496
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* Paging and sort options for `institutional.getHolders`.
|
|
583
|
+
*
|
|
584
|
+
* `limit` is the switch for the whole set: sent on its own it pages, and it is also what
|
|
585
|
+
* turns on `offset`, `sortBy`, `sortDir`, and the `returnedCount` / `offset` /
|
|
586
|
+
* `notableChanges` fields on the response. Send any of the others without `limit` and the
|
|
587
|
+
* server ignores them and returns the full unsorted list, silently, with a 200.
|
|
588
|
+
*/
|
|
589
|
+
interface GetHoldersOptions {
|
|
590
|
+
/**
|
|
591
|
+
* Maximum holder rows to return. Must be >= 1; values above 1000 are capped
|
|
592
|
+
* server-side. Omit to get the full, unbounded holder list.
|
|
593
|
+
*/
|
|
594
|
+
limit?: number;
|
|
595
|
+
/** Row offset to start from. Server default is 0. Requires `limit`. */
|
|
596
|
+
offset?: number;
|
|
597
|
+
/** Sort field. Server default is `"shares"`. Requires `limit`. */
|
|
598
|
+
sortBy?: "shares" | "valueUsd" | "sharesChangePct";
|
|
599
|
+
/** Sort direction. Server default is `"desc"`. Requires `limit`. */
|
|
600
|
+
sortDir?: "asc" | "desc";
|
|
601
|
+
}
|
|
497
602
|
/** A single institution summary from the discovery list. */
|
|
498
603
|
interface InstitutionSummary {
|
|
499
604
|
/** SEC Central Index Key of the (rolled-up) institution. */
|
|
@@ -669,6 +774,26 @@ interface GetPoliticiansOptions {
|
|
|
669
774
|
/** Number of days to look back (1-365). Defaults to 90. */
|
|
670
775
|
lookbackDays?: number;
|
|
671
776
|
}
|
|
777
|
+
/**
|
|
778
|
+
* Options for `politicians.getActivity`, which pages on top of the shared lookback window.
|
|
779
|
+
*
|
|
780
|
+
* The market-wide feed is far longer than one response: a 90-day window is routinely well
|
|
781
|
+
* over a thousand disclosures and the server returns 200 of them by default. Read
|
|
782
|
+
* `totalCount` on the envelope to size the walk, then step through with `limit` and
|
|
783
|
+
* `offset`. Omitting both keeps the original single 200-row request.
|
|
784
|
+
*/
|
|
785
|
+
interface GetPoliticianActivityOptions extends GetPoliticiansOptions {
|
|
786
|
+
/**
|
|
787
|
+
* Rows to return. Must be >= 1; the server rejects 0 or negative with HTTP 400
|
|
788
|
+
* (`invalid_limit`) and caps anything above 500 at 500. Omit for the default 200.
|
|
789
|
+
*/
|
|
790
|
+
limit?: number;
|
|
791
|
+
/**
|
|
792
|
+
* Row offset to start from. Defaults to 0, and unlike the holders endpoint it works
|
|
793
|
+
* without `limit`. An offset past the end returns an empty `data` array, not an error.
|
|
794
|
+
*/
|
|
795
|
+
offset?: number;
|
|
796
|
+
}
|
|
672
797
|
/** Generic preview wrapper used by PRO-gated endpoints. */
|
|
673
798
|
interface EarningsEvent {
|
|
674
799
|
ticker: string;
|
|
@@ -718,9 +843,15 @@ interface PreviewResponse<T> {
|
|
|
718
843
|
isPreview: boolean;
|
|
719
844
|
previewReason: "PRO_REQUIRED" | null;
|
|
720
845
|
/**
|
|
721
|
-
*
|
|
722
|
-
*
|
|
723
|
-
*
|
|
846
|
+
* Size of the full result set, before any truncation your response went through.
|
|
847
|
+
*
|
|
848
|
+
* Sent whenever the server knows that number and the response might not hold all of it:
|
|
849
|
+
* on a preview (`isPreview: true`), so you can render "showing N of totalCount", and on a
|
|
850
|
+
* paged endpoint such as `politicians.getActivity`, where it is the full match count for
|
|
851
|
+
* your filters on every tier, including a PRO response with `isPreview: false`.
|
|
852
|
+
*
|
|
853
|
+
* Absent on the endpoints that simply return everything, so a missing `totalCount` means
|
|
854
|
+
* "ask `data` for the count", never "zero results".
|
|
724
855
|
*/
|
|
725
856
|
totalCount?: number;
|
|
726
857
|
data: T;
|
|
@@ -930,7 +1061,7 @@ interface TrackerListing {
|
|
|
930
1061
|
interface TrackerListResponse {
|
|
931
1062
|
trackers: TrackerListing[];
|
|
932
1063
|
}
|
|
933
|
-
/** One row of a `viewType: "table"` tracker
|
|
1064
|
+
/** One row of a `viewType: "table"` tracker: a ranked leaderboard cell. */
|
|
934
1065
|
interface TrackerTableRow {
|
|
935
1066
|
/** 1-based rank on the sort the tracker is built for; may be null. */
|
|
936
1067
|
rank: number | null;
|
|
@@ -1062,6 +1193,114 @@ interface TrackerSnapshotResponse {
|
|
|
1062
1193
|
totalCount?: number;
|
|
1063
1194
|
data: TrackerSnapshot;
|
|
1064
1195
|
}
|
|
1196
|
+
/** Per-index discovery row returned by `client.indexes.list()`. */
|
|
1197
|
+
interface IndexListing {
|
|
1198
|
+
indexId: string;
|
|
1199
|
+
displayName: string;
|
|
1200
|
+
/** One-sentence summary, suitable for a card subtitle. */
|
|
1201
|
+
description: string;
|
|
1202
|
+
/** Output scale: `"SENTIMENT"` (signed, -1 to +1) or `"PERCENT_0_100"`. Set axis bounds from this, not from the id. */
|
|
1203
|
+
scale: string;
|
|
1204
|
+
/** Access tier: `"free"` or `"pro"`. Every index is `"free"` today; read it rather than assuming. */
|
|
1205
|
+
accessTier?: string;
|
|
1206
|
+
/**
|
|
1207
|
+
* Richest view of this index, which is NOT always the detail route. Market
|
|
1208
|
+
* Mood points at `/api/v2/market-mood`, which carries a phase band, weekly
|
|
1209
|
+
* change, per-signal breakdown and per-sector map that the shared envelope
|
|
1210
|
+
* cannot hold. Every advertised `indexId` still resolves on
|
|
1211
|
+
* {@link Indexes.get}, so a generic client can iterate the listing without
|
|
1212
|
+
* special-casing anything.
|
|
1213
|
+
*/
|
|
1214
|
+
canonicalUrl: string;
|
|
1215
|
+
}
|
|
1216
|
+
/** Discovery envelope returned by `client.indexes.list()`. */
|
|
1217
|
+
interface IndexListResponse {
|
|
1218
|
+
indexes: IndexListing[];
|
|
1219
|
+
}
|
|
1220
|
+
/** One entity's row in a basket index's constituent breakdown. */
|
|
1221
|
+
interface IndexConstituent {
|
|
1222
|
+
/** Ontology entity id, resolvable via the entities API. */
|
|
1223
|
+
kbEntityId: string;
|
|
1224
|
+
displayName: string;
|
|
1225
|
+
/** The entity's role in this basket; the role is what carries the weight. */
|
|
1226
|
+
role: string;
|
|
1227
|
+
/** Relative weight on this date. `0` when `staleness` is `"OUT_OF_SEGMENT"`. */
|
|
1228
|
+
weight: number;
|
|
1229
|
+
/** The entity's own reading. */
|
|
1230
|
+
value: number | null;
|
|
1231
|
+
/** Mentions behind that reading in the lookback window. */
|
|
1232
|
+
mentionsCount: number | null;
|
|
1233
|
+
/**
|
|
1234
|
+
* `"FRESH"` (mentioned inside the lookback), `"CARRIED_FORWARD"` (last known
|
|
1235
|
+
* value standing in), `"EXCLUDED"` (no usable reading, renormalized out), or
|
|
1236
|
+
* `"OUT_OF_SEGMENT"` (not in the basket on this date, reported only for
|
|
1237
|
+
* transparency).
|
|
1238
|
+
*/
|
|
1239
|
+
staleness: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* Reserved. The API currently returns `null` here on every constituent, so do
|
|
1242
|
+
* not build on it. To get the same number today, compute `weight * value`
|
|
1243
|
+
* over the sum of `weight` across constituents whose `staleness` is not
|
|
1244
|
+
* `"EXCLUDED"`.
|
|
1245
|
+
*/
|
|
1246
|
+
contribution: number | null;
|
|
1247
|
+
/** Detail page for the entity, or `null` when there is no resolvable target. */
|
|
1248
|
+
link: string | null;
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Latest reading for one index, returned by `client.indexes.get()`.
|
|
1252
|
+
*
|
|
1253
|
+
* Two archetypes share this envelope, and the difference is load-bearing. A
|
|
1254
|
+
* **basket** index (`fed-sentiment`, `ai-sentiment`) weight-averages tracked
|
|
1255
|
+
* entities, so `constituents`, `basketSize`, `coverage` and `totalMentions`
|
|
1256
|
+
* describe how the headline was built. A **composite** index (`market-mood`) is
|
|
1257
|
+
* built from signals rather than entities, so those four are `null` *by
|
|
1258
|
+
* construction*, not because data is missing. Branch on them; never treat
|
|
1259
|
+
* `null` there as an error.
|
|
1260
|
+
*/
|
|
1261
|
+
interface IndexSnapshot {
|
|
1262
|
+
indexId: string;
|
|
1263
|
+
displayName: string;
|
|
1264
|
+
/** Date the reading covers, `"YYYY-MM-DD"`. Bucket start for weekly indexes. */
|
|
1265
|
+
asOf: string;
|
|
1266
|
+
/** The headline scalar, on `scale`. */
|
|
1267
|
+
value: number | null;
|
|
1268
|
+
scale: string;
|
|
1269
|
+
/** Constituents that actually contributed. `null` on a composite index. */
|
|
1270
|
+
coverage: number | null;
|
|
1271
|
+
/** Constituents in the basket on this date. `null` on a composite index. */
|
|
1272
|
+
basketSize: number | null;
|
|
1273
|
+
/** Mentions behind the reading. `null` on a composite index. */
|
|
1274
|
+
totalMentions: number | null;
|
|
1275
|
+
/** How the value was computed, and what any `null` fields mean. */
|
|
1276
|
+
methodologyNote: string;
|
|
1277
|
+
/** Per-entity breakdown. `null` on a composite index. */
|
|
1278
|
+
constituents: IndexConstituent[] | null;
|
|
1279
|
+
}
|
|
1280
|
+
/** One point on an index's scalar series. */
|
|
1281
|
+
interface IndexHistoryPoint {
|
|
1282
|
+
/** `"YYYY-MM-DD"`. */
|
|
1283
|
+
date: string;
|
|
1284
|
+
value: number | null;
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Historical series returned by `client.indexes.history()`.
|
|
1288
|
+
*
|
|
1289
|
+
* Point spacing follows the index, not the calendar: a weekly index emits one
|
|
1290
|
+
* point per Monday-Sunday bucket, a daily index one per day, and Market Mood
|
|
1291
|
+
* trading days only. Thin or low-coverage buckets are withheld rather than
|
|
1292
|
+
* published, so `history` can be shorter than `days` and can contain gaps. Plot
|
|
1293
|
+
* against `date`; never assume a fixed interval, and never read a missing date
|
|
1294
|
+
* as zero.
|
|
1295
|
+
*/
|
|
1296
|
+
interface IndexHistoryResponse {
|
|
1297
|
+
indexId: string;
|
|
1298
|
+
displayName: string;
|
|
1299
|
+
scale: string;
|
|
1300
|
+
/** The window you requested, echoed back. */
|
|
1301
|
+
days: number;
|
|
1302
|
+
history: IndexHistoryPoint[];
|
|
1303
|
+
}
|
|
1065
1304
|
|
|
1066
1305
|
interface AnalystConsensus {
|
|
1067
1306
|
ticker: string;
|
|
@@ -1218,18 +1457,18 @@ interface EtfHolding {
|
|
|
1218
1457
|
name: string | null;
|
|
1219
1458
|
/** Weight in the fund as a percentage (0-100). */
|
|
1220
1459
|
weightPct: number;
|
|
1221
|
-
/** ISO date "YYYY-MM-DD"
|
|
1460
|
+
/** ISO date "YYYY-MM-DD". First date this holding appeared in the composition. */
|
|
1222
1461
|
firstSeen: string | null;
|
|
1223
1462
|
}
|
|
1224
1463
|
interface EtfHoldings {
|
|
1225
1464
|
ticker: string;
|
|
1226
1465
|
issuer: string;
|
|
1227
1466
|
issuerEndpoint: string | null;
|
|
1228
|
-
/** ISO date "YYYY-MM-DD"
|
|
1467
|
+
/** ISO date "YYYY-MM-DD". Composition snapshot date from the issuer. */
|
|
1229
1468
|
asOfDate: string;
|
|
1230
1469
|
/** Epoch seconds when SentiSense refreshed the composition. */
|
|
1231
1470
|
fetchedAt: number | null;
|
|
1232
|
-
/** ISO date "YYYY-MM-DD"
|
|
1471
|
+
/** ISO date "YYYY-MM-DD". When the composition is scheduled to be refreshed next. */
|
|
1233
1472
|
nextRefreshDue: string;
|
|
1234
1473
|
totalHoldings: number;
|
|
1235
1474
|
holdings: EtfHolding[];
|
|
@@ -1263,7 +1502,7 @@ interface EtfAnalystContributor {
|
|
|
1263
1502
|
}
|
|
1264
1503
|
interface EtfAnalystAggregate {
|
|
1265
1504
|
ticker: string;
|
|
1266
|
-
/** ISO date "YYYY-MM-DD"
|
|
1505
|
+
/** ISO date "YYYY-MM-DD". Composition snapshot date. */
|
|
1267
1506
|
asOfDate: string | null;
|
|
1268
1507
|
/** Epoch seconds when this rollup was computed. */
|
|
1269
1508
|
computedAt: number;
|
|
@@ -1294,7 +1533,7 @@ interface EtfInsiderContributor {
|
|
|
1294
1533
|
}
|
|
1295
1534
|
interface EtfInsiderAggregate {
|
|
1296
1535
|
ticker: string;
|
|
1297
|
-
/** ISO date "YYYY-MM-DD"
|
|
1536
|
+
/** ISO date "YYYY-MM-DD". Composition snapshot date. */
|
|
1298
1537
|
asOfDate: string | null;
|
|
1299
1538
|
/** Epoch seconds when this rollup was computed. */
|
|
1300
1539
|
computedAt: number;
|
|
@@ -1313,7 +1552,7 @@ interface EtfSentimentReading {
|
|
|
1313
1552
|
}
|
|
1314
1553
|
interface EtfSentimentAggregate {
|
|
1315
1554
|
ticker: string;
|
|
1316
|
-
/** ISO date "YYYY-MM-DD"
|
|
1555
|
+
/** ISO date "YYYY-MM-DD". Composition snapshot date. */
|
|
1317
1556
|
asOfDate: string | null;
|
|
1318
1557
|
/** Epoch seconds when this aggregate was assembled. */
|
|
1319
1558
|
computedAt: number;
|
|
@@ -1402,8 +1641,21 @@ declare class Politicians {
|
|
|
1402
1641
|
*
|
|
1403
1642
|
* PRO-gated. Free/unauthenticated users receive a preview (top 5 trades)
|
|
1404
1643
|
* with `isPreview: true` in the response.
|
|
1644
|
+
*
|
|
1645
|
+
* The feed is longer than one response: a default 90-day window is routinely well over a
|
|
1646
|
+
* thousand disclosures, and without `limit` the server sends the first 200 with no marker
|
|
1647
|
+
* that it stopped. `totalCount` on the envelope is the real size on every tier, so page
|
|
1648
|
+
* with `limit` and `offset` rather than reading `data.length` as the total.
|
|
1649
|
+
*
|
|
1650
|
+
* ```typescript
|
|
1651
|
+
* const first = await client.politicians.getActivity({ limit: 100 });
|
|
1652
|
+
* for (let offset = 100; offset < first.totalCount!; offset += 100) {
|
|
1653
|
+
* const page = await client.politicians.getActivity({ limit: 100, offset });
|
|
1654
|
+
* // ... page.data
|
|
1655
|
+
* }
|
|
1656
|
+
* ```
|
|
1405
1657
|
*/
|
|
1406
|
-
getActivity(options?:
|
|
1658
|
+
getActivity(options?: GetPoliticianActivityOptions): Promise<PreviewResponse<CongressTrade[]>>;
|
|
1407
1659
|
/**
|
|
1408
1660
|
* Get congressional trades for a specific stock.
|
|
1409
1661
|
*
|
|
@@ -1512,8 +1764,17 @@ declare class Institutional {
|
|
|
1512
1764
|
* are two levels down: `(await getHolders(t, d)).data.holders`, alongside ticker-level
|
|
1513
1765
|
* totals like `holderCount`. Free callers get a truncated `holders` array with
|
|
1514
1766
|
* `isPreview: true`.
|
|
1767
|
+
*
|
|
1768
|
+
* A widely held ticker returns thousands of rows: a megacap quarter is about
|
|
1769
|
+
* 6,000 holders and 1.5 MB. Pass `limit` unless you really want all of them.
|
|
1770
|
+
* Omitting `options` sends the original unbounded request.
|
|
1771
|
+
*
|
|
1772
|
+
* `limit` is the switch for the whole option set. With it, the response also carries
|
|
1773
|
+
* `returnedCount`, `offset`, and a `notableChanges` summary, so you can walk the list
|
|
1774
|
+
* without re-counting it. Without it, `offset` / `sortBy` / `sortDir` are ignored by the
|
|
1775
|
+
* server and you get the full unsorted list back with a 200.
|
|
1515
1776
|
*/
|
|
1516
|
-
getHolders(ticker: string, reportDate: string): Promise<PreviewResponse<TickerHolders>>;
|
|
1777
|
+
getHolders(ticker: string, reportDate: string, options?: GetHoldersOptions): Promise<PreviewResponse<TickerHolders>>;
|
|
1517
1778
|
/**
|
|
1518
1779
|
* Get activist investor positions (NEW or INCREASED).
|
|
1519
1780
|
*
|
|
@@ -1607,7 +1868,14 @@ declare class Stocks {
|
|
|
1607
1868
|
getSentiment(ticker: string): Promise<PreviewResponse<StockSentiment>>;
|
|
1608
1869
|
/** Get related KB entities (people, products, partners). */
|
|
1609
1870
|
getEntities(ticker: string): Promise<StockEntity[]>;
|
|
1610
|
-
/**
|
|
1871
|
+
/**
|
|
1872
|
+
* Get AI-generated stock analysis report. Requires PRO tier.
|
|
1873
|
+
*
|
|
1874
|
+
* `depth: "deep"` returns the full curated report and consumes one report view on
|
|
1875
|
+
* metered tiers; the default `"basic"` returns the one-paragraph summary.
|
|
1876
|
+
*
|
|
1877
|
+
* The deprecated `forceRefresh` option is accepted and discarded, not forwarded.
|
|
1878
|
+
*/
|
|
1611
1879
|
getAISummary(ticker: string, options?: GetAISummaryOptions): Promise<AISummary>;
|
|
1612
1880
|
/** Get sentiment/mention metrics breakdown by entity. */
|
|
1613
1881
|
getMetricsBreakdown(ticker: string, metricType: string, options?: GetMetricsBreakdownOptions): Promise<MetricsBreakdown>;
|
|
@@ -1666,8 +1934,8 @@ declare class Stocks {
|
|
|
1666
1934
|
*/
|
|
1667
1935
|
listKpiCoverage(): Promise<KpiCoverageResponse>;
|
|
1668
1936
|
/**
|
|
1669
|
-
* List the KPI metadata tuples available for a ticker
|
|
1670
|
-
* chartType`
|
|
1937
|
+
* List the KPI metadata tuples available for a ticker (`id, name, category,
|
|
1938
|
+
* chartType`) without paying the cost of the full series payload. Mirrors
|
|
1671
1939
|
* the `/api/v1/insights/stock/{ticker}/types` precedent.
|
|
1672
1940
|
*
|
|
1673
1941
|
* Auth: API key required, no quota cost. 404 if the ticker has no curated KPIs.
|
|
@@ -1676,10 +1944,58 @@ declare class Stocks {
|
|
|
1676
1944
|
}
|
|
1677
1945
|
|
|
1678
1946
|
/**
|
|
1679
|
-
*
|
|
1947
|
+
* Indexes: composite scalars tracked over time, each blending its own inputs
|
|
1948
|
+
* into one number on a stated scale. Every index answers on the same envelope,
|
|
1949
|
+
* so you write one renderer and get every current and future SentiSense index.
|
|
1950
|
+
*
|
|
1951
|
+
* Two archetypes share that envelope. A **basket** index weight-averages
|
|
1952
|
+
* tracked entities and fills `constituents` / `basketSize` / `coverage` /
|
|
1953
|
+
* `totalMentions`; a **composite** index is built from signals instead and
|
|
1954
|
+
* returns `null` for all four by construction. See {@link IndexSnapshot}.
|
|
1955
|
+
*
|
|
1956
|
+
* @see IndexSnapshot
|
|
1957
|
+
*/
|
|
1958
|
+
declare class Indexes {
|
|
1959
|
+
private client;
|
|
1960
|
+
constructor(client: APIClient);
|
|
1961
|
+
/**
|
|
1962
|
+
* List every index the platform publishes: id, display name, one-line
|
|
1963
|
+
* description, the scale it lives on, its access tier, and where its richest
|
|
1964
|
+
* view lives.
|
|
1965
|
+
*
|
|
1966
|
+
* Iterate this rather than hardcoding ids. Every `indexId` it advertises
|
|
1967
|
+
* resolves on {@link get} and {@link history}.
|
|
1968
|
+
*/
|
|
1969
|
+
list(): Promise<IndexListResponse>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Latest reading for one index.
|
|
1972
|
+
*
|
|
1973
|
+
* Check `constituents` for `null` before iterating: it is `null` on a
|
|
1974
|
+
* composite index like `market-mood`, which has no constituents by
|
|
1975
|
+
* construction. For Market Mood this is the narrowed view; the phase band,
|
|
1976
|
+
* weekly change, per-signal breakdown and per-sector map live on
|
|
1977
|
+
* `client.marketMood.get()`, and both report the same headline number.
|
|
1978
|
+
*
|
|
1979
|
+
* @param indexId slug from {@link list}, e.g. `"fed-sentiment"`.
|
|
1980
|
+
*/
|
|
1981
|
+
get(indexId: string): Promise<IndexSnapshot>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Historical scalar series for one index, for charting.
|
|
1984
|
+
*
|
|
1985
|
+
* Thin or low-coverage buckets are withheld, so the series can be shorter
|
|
1986
|
+
* than `days` and can contain gaps. Plot against each point's `date`.
|
|
1987
|
+
*
|
|
1988
|
+
* @param indexId slug from {@link list}.
|
|
1989
|
+
* @param days days of history to return. Defaults to the API's own 180.
|
|
1990
|
+
*/
|
|
1991
|
+
history(indexId: string, days?: number): Promise<IndexHistoryResponse>;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* Trackers: observational data products published as a standardized
|
|
1680
1996
|
* `TrackerSnapshot` envelope. Every tracker (institution rankings,
|
|
1681
1997
|
* hedge-fund reported returns, social trackers, surveillance dashboards)
|
|
1682
|
-
* returns the same shape
|
|
1998
|
+
* returns the same shape, so consumers write one renderer per `viewType` and
|
|
1683
1999
|
* get every current and future SentiSense tracker for free.
|
|
1684
2000
|
*
|
|
1685
2001
|
* @see TrackerSnapshot
|
|
@@ -1688,7 +2004,7 @@ declare class Trackers {
|
|
|
1688
2004
|
private client;
|
|
1689
2005
|
constructor(client: APIClient);
|
|
1690
2006
|
/**
|
|
1691
|
-
* List every publicly-visible tracker
|
|
2007
|
+
* List every publicly-visible tracker: id, display name, category,
|
|
1692
2008
|
* one-line description, and the methodology anchor to link out to.
|
|
1693
2009
|
*/
|
|
1694
2010
|
list(): Promise<TrackerListResponse>;
|
|
@@ -1700,8 +2016,8 @@ declare class Trackers {
|
|
|
1700
2016
|
* `"choropleth"` they live at `data.geo[]`; etc. Dispatch on `viewType`
|
|
1701
2017
|
* in your renderer.
|
|
1702
2018
|
*
|
|
1703
|
-
* @param trackerId
|
|
1704
|
-
* @param params
|
|
2019
|
+
* @param trackerId slug from {@link list}, e.g. `"institution-concentration"`.
|
|
2020
|
+
* @param params provider-specific query params (e.g. `{ scope: "us" }` for
|
|
1705
2021
|
* geographically-scoped trackers like hantavirus). Unknown keys are ignored.
|
|
1706
2022
|
*/
|
|
1707
2023
|
get(trackerId: string, params?: Record<string, string | number | boolean>): Promise<TrackerSnapshotResponse>;
|
|
@@ -1729,6 +2045,7 @@ declare class SentiSense implements APIClient {
|
|
|
1729
2045
|
readonly marketMood: MarketMoodResource;
|
|
1730
2046
|
readonly marketSummary: MarketSummaryResource;
|
|
1731
2047
|
readonly kb: KB;
|
|
2048
|
+
readonly indexes: Indexes;
|
|
1732
2049
|
readonly trackers: Trackers;
|
|
1733
2050
|
readonly calendar: Calendar;
|
|
1734
2051
|
constructor(options?: SentiSenseOptions);
|
|
@@ -1763,6 +2080,12 @@ declare class DeepHistoryUnavailableError extends SentiSenseError {
|
|
|
1763
2080
|
constructor(message: string, retryAfter?: number);
|
|
1764
2081
|
}
|
|
1765
2082
|
declare class RateLimitError extends SentiSenseError {
|
|
2083
|
+
/**
|
|
2084
|
+
* Seconds to wait before retrying, from the server's `Retry-After` header, clamped to
|
|
2085
|
+
* `[0.5, 120]`. Always either a finite number or `undefined`: an absent header, or one
|
|
2086
|
+
* carrying an HTTP-date instead of a number of seconds, leaves it undefined rather than
|
|
2087
|
+
* `NaN`, so `setTimeout(fn, err.retryAfter * 1000)` can never fire immediately.
|
|
2088
|
+
*/
|
|
1766
2089
|
retryAfter?: number;
|
|
1767
2090
|
constructor(message: string, code?: string, retryAfter?: number);
|
|
1768
2091
|
}
|
|
@@ -1770,6 +2093,6 @@ declare class APIError extends SentiSenseError {
|
|
|
1770
2093
|
constructor(message: string, status: number, code?: string);
|
|
1771
2094
|
}
|
|
1772
2095
|
|
|
1773
|
-
declare const VERSION = "0.
|
|
2096
|
+
declare const VERSION = "0.35.0";
|
|
1774
2097
|
|
|
1775
|
-
export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfSentimentAggregate, type EtfSentimentReading, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEtfInsiderAggregateOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticiansOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
|
|
2098
|
+
export { type AISummary, APIError, type AnalystAction, type AnalystConsensus, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfSentimentAggregate, type EtfSentimentReading, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetPoliticianActivityOptions, type GetPoliticiansOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type PoliticianDetail, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
|