sentisense 0.73.0 → 0.74.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 +31 -1
- package/dist/cli.cjs +64 -3
- package/dist/index.cjs +64 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +233 -4
- package/dist/index.d.ts +233 -4
- package/dist/index.mjs +64 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -193,7 +193,7 @@ Affected: every method whose declared return type is `PreviewResponse<T>`. A tes
|
|
|
193
193
|
| `etfs` | `analystAggregate` `insiderAggregate` `sentimentAggregate` |
|
|
194
194
|
| `insider` | `getActivity` `getTrades` `getClusterBuys` |
|
|
195
195
|
| `insights` | `stock` `stockRange` `market` `latest` `user` |
|
|
196
|
-
| `institutional` | `getFlows` `getHolders` `getHoldersHistory` `getActivists` |
|
|
196
|
+
| `institutional` | `getFlows` `getHolders` `getHoldersHistory` `getInstitutionHistory` `getActivists` |
|
|
197
197
|
| `options` | `getOverview` |
|
|
198
198
|
| `politicians` | `getActivity` `getFilings` `getMembers` `getMember` |
|
|
199
199
|
| `stocks` | `getSentiment` `getKpis` `getOptionsSummary` `getOptionsHistory` `getOptionsIntradayHistory` |
|
|
@@ -307,6 +307,8 @@ client.institutional.getFlows("2025-02-14", { limit: 20 })
|
|
|
307
307
|
client.institutional.getHolders("AAPL", "2025-02-14")
|
|
308
308
|
client.institutional.getHolders("AAPL") // no date: the ticker's latest settled quarter
|
|
309
309
|
client.institutional.getHoldersHistory("AAPL", { quarters: 8 })
|
|
310
|
+
client.institutional.getInstitutionDetail("Berkshire-Hathaway", { limit: 10, sortBy: "estimatedFlowUsd" })
|
|
311
|
+
client.institutional.getInstitutionHistory("Renaissance-Technologies", { quarters: 8, tickers: ["NVDA"] })
|
|
310
312
|
client.institutional.getActivists("2025-02-14")
|
|
311
313
|
```
|
|
312
314
|
|
|
@@ -348,6 +350,34 @@ const detail = await client.institutional.getInstitutionDetail("1067983") as Pre
|
|
|
348
350
|
console.log(detail.data.positionsHeld); // undefined when an older response omits it
|
|
349
351
|
```
|
|
350
352
|
|
|
353
|
+
Institution detail compares each filing with the quarter before it. When `comparisonStatus` is `AVAILABLE`, the payload carries `priorTotalValueUsd` and `priorPositionsHeld`, and each holding carries `priorValueUsd`, `priorPortfolioWeight` and `estimatedFlowUsd` (dollars bought, positive, or sold, negative, estimated from two quarter-end snapshots rather than a reported trade). Every one of these is absent when it does not apply. Pass `limit` to get a sorted page of holdings, with `sortBy`, `sortDir`, `changeType` (a value or an array; `"HELD"` keeps every position still held, whatever its change), `q` and `minWeight` to sort and filter it; those only take effect together with `limit`. When a filter is set, `data.matchTotals` sums every matching holding, not just the page:
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
// The ten biggest estimated buys of the latest quarter
|
|
357
|
+
const page = await client.institutional.getInstitutionDetail("Berkshire-Hathaway", {
|
|
358
|
+
limit: 10,
|
|
359
|
+
sortBy: "estimatedFlowUsd",
|
|
360
|
+
changeType: ["NEW", "INCREASED"],
|
|
361
|
+
}) as PreviewResponse<InstitutionDetail>;
|
|
362
|
+
for (const h of page.data.holdings ?? []) console.log(h.ticker, h.estimatedFlowUsd);
|
|
363
|
+
console.log(page.data.matchTotals?.estimatedFlowUsd); // every matching holding, not only these ten
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**Institution history.** `getInstitutionHistory()` returns one row per filing, newest first (`quarters` up to 40, 12 by default). Free keys see the newest four, with `totalCount` naming the window. The comparison fields (`newPositions`, `boughtUsd`, `netFlowUsd` and the rest) are absent unless that filing's `comparisonStatus` is `AVAILABLE`, never zero. Pass `tickers` (up to 100) to also get `positions`: each ticker's shares and value per filing, newest first, with filings where the institution did not hold it left out. Free keys receive `positions` only for the institution's ten largest holdings. `priceEffectUsd` is the remainder after `netFlowUsd`, mostly price moves; it also absorbs rounding, the different price bases of exits and trades, and positions whose change could not be restated:
|
|
367
|
+
|
|
368
|
+
```typescript
|
|
369
|
+
const { data } = await client.institutional.getInstitutionHistory("Renaissance-Technologies", {
|
|
370
|
+
quarters: 8,
|
|
371
|
+
tickers: ["NVDA", "META"],
|
|
372
|
+
});
|
|
373
|
+
for (const q of data.quarters) {
|
|
374
|
+
console.log(q.label, q.totalValueUsd, q.netFlowUsd, q.priceEffectUsd);
|
|
375
|
+
}
|
|
376
|
+
for (const point of data.positions?.NVDA ?? []) {
|
|
377
|
+
console.log(point.reportDate, point.shares, point.valueUsd);
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
351
381
|
**Paging the holder list.** A widely held ticker returns thousands of rows: a megacap quarter is roughly 6,000 holders and 1.5 MB on the wire. Pass `limit` unless you really want the whole list; omitting the options object sends the original unbounded request, so existing code keeps working.
|
|
352
382
|
|
|
353
383
|
| Option | Values |
|
package/dist/cli.cjs
CHANGED
|
@@ -1432,7 +1432,7 @@ var flowsCommand = {
|
|
|
1432
1432
|
};
|
|
1433
1433
|
|
|
1434
1434
|
// src/version.ts
|
|
1435
|
-
var VERSION = "0.
|
|
1435
|
+
var VERSION = "0.74.0";
|
|
1436
1436
|
|
|
1437
1437
|
// src/resources/analyst.ts
|
|
1438
1438
|
var Analyst = class {
|
|
@@ -2226,10 +2226,71 @@ var Institutional = class {
|
|
|
2226
2226
|
* The signature remains unknown for compatibility. Opt in to the exported
|
|
2227
2227
|
* PreviewResponse<InstitutionDetail> type to read data.positionsHeld, the full
|
|
2228
2228
|
* portfolio count excluding SOLD_OUT rows, even on a truncated holdings list.
|
|
2229
|
+
*
|
|
2230
|
+
* When the filing compares with the preceding quarter (`comparisonStatus` is `AVAILABLE`),
|
|
2231
|
+
* the payload also carries `priorTotalValueUsd` and `priorPositionsHeld`, and each holding
|
|
2232
|
+
* carries `priorValueUsd`, `priorPortfolioWeight` and `estimatedFlowUsd` (an estimate from
|
|
2233
|
+
* two quarter-end snapshots, not a reported trade). Each is absent when it does not apply.
|
|
2234
|
+
*
|
|
2235
|
+
* `options.limit` returns a sorted page of holdings and adds `returnedCount` and `offset` to
|
|
2236
|
+
* `data` and `totalCount` to the envelope; `sortBy`, `sortDir`, `changeType`, `q` and
|
|
2237
|
+
* `minWeight` only take effect together with it (PRO only). `changeType` also accepts `"HELD"`,
|
|
2238
|
+
* every position still held whatever its change; values combine as a union. With a filter set, `data.matchTotals`
|
|
2239
|
+
* sums every matching holding, not just the page. Calling without `options` is unchanged.
|
|
2240
|
+
*
|
|
2241
|
+
* @example
|
|
2242
|
+
* const page = await client.institutional.getInstitutionDetail("Berkshire-Hathaway", {
|
|
2243
|
+
* limit: 10,
|
|
2244
|
+
* sortBy: "estimatedFlowUsd",
|
|
2245
|
+
* changeType: ["NEW", "INCREASED"],
|
|
2246
|
+
* }) as PreviewResponse<InstitutionDetail>;
|
|
2229
2247
|
*/
|
|
2230
|
-
async getInstitutionDetail(slugOrCik) {
|
|
2248
|
+
async getInstitutionDetail(slugOrCik, options) {
|
|
2249
|
+
const { changeType, ...rest } = options ?? {};
|
|
2231
2250
|
return this.client.get(
|
|
2232
|
-
`/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}
|
|
2251
|
+
`/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}`,
|
|
2252
|
+
{
|
|
2253
|
+
...rest,
|
|
2254
|
+
changeType: typeof changeType === "string" ? changeType : changeType?.join(",") || void 0
|
|
2255
|
+
}
|
|
2256
|
+
);
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Get an institution's 13F book filing by filing, newest first.
|
|
2260
|
+
*
|
|
2261
|
+
* Returns the preview envelope wrapping an {@link InstitutionHistory}, so the rows are two
|
|
2262
|
+
* levels down: `(await getInstitutionHistory(s)).data.quarters`. Each row carries the
|
|
2263
|
+
* filing's reported value, positions held and top-10 concentration, and, when it compares
|
|
2264
|
+
* with the quarter before (`comparisonStatus: "AVAILABLE"`), the position counts and the
|
|
2265
|
+
* estimated dollars bought, trimmed and exited. Those comparison fields are absent
|
|
2266
|
+
* otherwise, never zero. The flows are estimates from two quarter-end snapshots, not
|
|
2267
|
+
* reported cash flow. A 13F covers long US-listed equity only.
|
|
2268
|
+
*
|
|
2269
|
+
* Pass `tickers` to also get `data.positions`: each ticker maps to its shares and value per
|
|
2270
|
+
* filing, newest first. A filing in which the institution did not hold the ticker is absent
|
|
2271
|
+
* from its list. Free keys receive positions only for the institution's ten largest
|
|
2272
|
+
* holdings; other tickers are left out.
|
|
2273
|
+
*
|
|
2274
|
+
* Free keys receive the newest four filings with `isPreview: true` and `totalCount` holding
|
|
2275
|
+
* the number of filings in the requested window. The first request for a large multi-filer
|
|
2276
|
+
* institution can take a few seconds; when too many such computations run at once the API
|
|
2277
|
+
* answers 503 with a `Retry-After` header.
|
|
2278
|
+
*
|
|
2279
|
+
* @example
|
|
2280
|
+
* const { data } = await client.institutional.getInstitutionHistory("Renaissance-Technologies", {
|
|
2281
|
+
* quarters: 8,
|
|
2282
|
+
* tickers: ["NVDA", "META"],
|
|
2283
|
+
* });
|
|
2284
|
+
* for (const q of data.quarters) console.log(q.label, q.totalValueUsd, q.netFlowUsd);
|
|
2285
|
+
*/
|
|
2286
|
+
async getInstitutionHistory(slugOrCik, options) {
|
|
2287
|
+
const { tickers, ...rest } = options ?? {};
|
|
2288
|
+
return this.client.get(
|
|
2289
|
+
`/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}/history`,
|
|
2290
|
+
{
|
|
2291
|
+
...rest,
|
|
2292
|
+
tickers: typeof tickers === "string" ? tickers : tickers?.join(",") || void 0
|
|
2293
|
+
}
|
|
2233
2294
|
);
|
|
2234
2295
|
}
|
|
2235
2296
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -874,10 +874,71 @@ var Institutional = class {
|
|
|
874
874
|
* The signature remains unknown for compatibility. Opt in to the exported
|
|
875
875
|
* PreviewResponse<InstitutionDetail> type to read data.positionsHeld, the full
|
|
876
876
|
* portfolio count excluding SOLD_OUT rows, even on a truncated holdings list.
|
|
877
|
+
*
|
|
878
|
+
* When the filing compares with the preceding quarter (`comparisonStatus` is `AVAILABLE`),
|
|
879
|
+
* the payload also carries `priorTotalValueUsd` and `priorPositionsHeld`, and each holding
|
|
880
|
+
* carries `priorValueUsd`, `priorPortfolioWeight` and `estimatedFlowUsd` (an estimate from
|
|
881
|
+
* two quarter-end snapshots, not a reported trade). Each is absent when it does not apply.
|
|
882
|
+
*
|
|
883
|
+
* `options.limit` returns a sorted page of holdings and adds `returnedCount` and `offset` to
|
|
884
|
+
* `data` and `totalCount` to the envelope; `sortBy`, `sortDir`, `changeType`, `q` and
|
|
885
|
+
* `minWeight` only take effect together with it (PRO only). `changeType` also accepts `"HELD"`,
|
|
886
|
+
* every position still held whatever its change; values combine as a union. With a filter set, `data.matchTotals`
|
|
887
|
+
* sums every matching holding, not just the page. Calling without `options` is unchanged.
|
|
888
|
+
*
|
|
889
|
+
* @example
|
|
890
|
+
* const page = await client.institutional.getInstitutionDetail("Berkshire-Hathaway", {
|
|
891
|
+
* limit: 10,
|
|
892
|
+
* sortBy: "estimatedFlowUsd",
|
|
893
|
+
* changeType: ["NEW", "INCREASED"],
|
|
894
|
+
* }) as PreviewResponse<InstitutionDetail>;
|
|
895
|
+
*/
|
|
896
|
+
async getInstitutionDetail(slugOrCik, options) {
|
|
897
|
+
const { changeType, ...rest } = options ?? {};
|
|
898
|
+
return this.client.get(
|
|
899
|
+
`/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}`,
|
|
900
|
+
{
|
|
901
|
+
...rest,
|
|
902
|
+
changeType: typeof changeType === "string" ? changeType : changeType?.join(",") || void 0
|
|
903
|
+
}
|
|
904
|
+
);
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Get an institution's 13F book filing by filing, newest first.
|
|
908
|
+
*
|
|
909
|
+
* Returns the preview envelope wrapping an {@link InstitutionHistory}, so the rows are two
|
|
910
|
+
* levels down: `(await getInstitutionHistory(s)).data.quarters`. Each row carries the
|
|
911
|
+
* filing's reported value, positions held and top-10 concentration, and, when it compares
|
|
912
|
+
* with the quarter before (`comparisonStatus: "AVAILABLE"`), the position counts and the
|
|
913
|
+
* estimated dollars bought, trimmed and exited. Those comparison fields are absent
|
|
914
|
+
* otherwise, never zero. The flows are estimates from two quarter-end snapshots, not
|
|
915
|
+
* reported cash flow. A 13F covers long US-listed equity only.
|
|
916
|
+
*
|
|
917
|
+
* Pass `tickers` to also get `data.positions`: each ticker maps to its shares and value per
|
|
918
|
+
* filing, newest first. A filing in which the institution did not hold the ticker is absent
|
|
919
|
+
* from its list. Free keys receive positions only for the institution's ten largest
|
|
920
|
+
* holdings; other tickers are left out.
|
|
921
|
+
*
|
|
922
|
+
* Free keys receive the newest four filings with `isPreview: true` and `totalCount` holding
|
|
923
|
+
* the number of filings in the requested window. The first request for a large multi-filer
|
|
924
|
+
* institution can take a few seconds; when too many such computations run at once the API
|
|
925
|
+
* answers 503 with a `Retry-After` header.
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* const { data } = await client.institutional.getInstitutionHistory("Renaissance-Technologies", {
|
|
929
|
+
* quarters: 8,
|
|
930
|
+
* tickers: ["NVDA", "META"],
|
|
931
|
+
* });
|
|
932
|
+
* for (const q of data.quarters) console.log(q.label, q.totalValueUsd, q.netFlowUsd);
|
|
877
933
|
*/
|
|
878
|
-
async
|
|
934
|
+
async getInstitutionHistory(slugOrCik, options) {
|
|
935
|
+
const { tickers, ...rest } = options ?? {};
|
|
879
936
|
return this.client.get(
|
|
880
|
-
`/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}
|
|
937
|
+
`/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}/history`,
|
|
938
|
+
{
|
|
939
|
+
...rest,
|
|
940
|
+
tickers: typeof tickers === "string" ? tickers : tickers?.join(",") || void 0
|
|
941
|
+
}
|
|
881
942
|
);
|
|
882
943
|
}
|
|
883
944
|
};
|
|
@@ -1475,7 +1536,7 @@ var Trackers = class {
|
|
|
1475
1536
|
};
|
|
1476
1537
|
|
|
1477
1538
|
// src/version.ts
|
|
1478
|
-
var VERSION = "0.
|
|
1539
|
+
var VERSION = "0.74.0";
|
|
1479
1540
|
|
|
1480
1541
|
// src/client.ts
|
|
1481
1542
|
var DEFAULT_BASE_URL = "https://app.sentisense.ai";
|