sentisense 0.41.0 → 0.42.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 +94 -0
- package/dist/cli.cjs +3817 -0
- package/dist/index.cjs +31 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +159 -4
- package/dist/index.d.ts +159 -4
- package/dist/index.mjs +31 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -26,6 +26,85 @@ console.log(price.currentPrice);
|
|
|
26
26
|
const flows = await client.institutional.getFlows();
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
## CLI
|
|
30
|
+
|
|
31
|
+
The same package ships a command line tool. Nothing to install:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx -y sentisense@latest quote NVDA
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Every endpoint needs a key, so set one first. Either works:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export SENTISENSE_API_KEY=<your key>
|
|
41
|
+
# or store it once, owner-readable only, at ~/.config/sentisense/config.json
|
|
42
|
+
npx -y sentisense@latest auth <your key>
|
|
43
|
+
|
|
44
|
+
npx -y sentisense@latest health
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Get a key at [app.sentisense.ai/get-api-key](https://app.sentisense.ai/get-api-key).
|
|
48
|
+
|
|
49
|
+
### Commands
|
|
50
|
+
|
|
51
|
+
| Command | What you get |
|
|
52
|
+
|---------|--------------|
|
|
53
|
+
| `auth [key]` | Store a key, show what is configured, or `--remove` it |
|
|
54
|
+
| `health` | Reachability, key validity, latency, and the resolved base URL |
|
|
55
|
+
| `quote <ticker>...` | Price, day range, 52-week range, market cap, P/E. One request per ticker |
|
|
56
|
+
| `sentiment <ticker>` | SentiSense Score, tone, attention, per-source breakdown, `--days N` history |
|
|
57
|
+
| `mood` | Composite market sentiment, the signals behind it, and the sector map |
|
|
58
|
+
| `analysts <ticker>` | Consensus, price target band, recent upgrades and downgrades |
|
|
59
|
+
| `earnings [ticker]` | Forward calendar with no ticker, per-quarter analysis with one |
|
|
60
|
+
| `insiders <ticker>` | Filed Form 4 transactions, including whether they were pre-planned |
|
|
61
|
+
| `insights <ticker>` | Generated signals, filterable by `--urgency` and `--type` |
|
|
62
|
+
| `congress [ticker]` | Congressional disclosures, market-wide or for one symbol |
|
|
63
|
+
| `news [ticker]` | Clustered news stories with impact and tone |
|
|
64
|
+
| `flows [ticker]` | Institutional 13F flows, or one ticker's holders and notable changes |
|
|
65
|
+
| `options <ticker>` | End-of-day options positioning, IV rank, walls, unusual contracts |
|
|
66
|
+
| `screen --filter ...` | Screen the universe on Score, analyst, technical, and price fields |
|
|
67
|
+
|
|
68
|
+
Run `sentisense help <command>` for its flags and examples.
|
|
69
|
+
|
|
70
|
+
### Output
|
|
71
|
+
|
|
72
|
+
Readable in a terminal, plain text when piped, and exact API JSON on request:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx -y sentisense@latest quote NVDA # terminal layout
|
|
76
|
+
npx -y sentisense@latest quote NVDA | cat # plain text, no escape codes
|
|
77
|
+
npx -y sentisense@latest quote NVDA --json | jq # the API response untouched
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`--json` prints what the API returned, envelope and all, so `isPreview` and `totalCount` stay
|
|
81
|
+
visible. For `quote` that is the exact quote response for one ticker, and an object keyed by
|
|
82
|
+
ticker for several. `--full` widens any command. `--no-color` and `NO_COLOR` drop the colour,
|
|
83
|
+
`--plain` and `--pretty` force a layout, and `--debug` prints stack traces.
|
|
84
|
+
|
|
85
|
+
Commands spend requests on the answer, not on decoration: `quote` looks up the company name
|
|
86
|
+
only for the terminal layout, so piped and `--json` output cost one request per ticker. When
|
|
87
|
+
something supplementary does not come back, such as the Score history behind a sparkline, the
|
|
88
|
+
command still prints its answer and exits 0 with a `note:` line on stderr, so stdout stays
|
|
89
|
+
clean for a pipe and the gap is never silent.
|
|
90
|
+
|
|
91
|
+
### Exit codes
|
|
92
|
+
|
|
93
|
+
Failures print two lines to stderr, what went wrong and what to do about it, and exit with a
|
|
94
|
+
code you can branch on. The CLI does not retry, so a 5 is yours to handle.
|
|
95
|
+
|
|
96
|
+
| Code | Meaning |
|
|
97
|
+
|------|---------|
|
|
98
|
+
| 0 | Success |
|
|
99
|
+
| 1 | API error or unexpected failure |
|
|
100
|
+
| 2 | Bad usage: unknown command, flag, or missing argument |
|
|
101
|
+
| 3 | Missing or rejected API key |
|
|
102
|
+
| 4 | No data for that symbol or identifier |
|
|
103
|
+
| 5 | Rate limited |
|
|
104
|
+
| 6 | Network failure or timeout |
|
|
105
|
+
|
|
106
|
+
Research data, not investment advice.
|
|
107
|
+
|
|
29
108
|
## Features
|
|
30
109
|
|
|
31
110
|
- Full TypeScript support with detailed type definitions
|
|
@@ -107,6 +186,7 @@ client.stocks.getChart("AAPL", { timeframe: "6M" }) // OHLCV chart data
|
|
|
107
186
|
client.stocks.getMarketStatus() // Market open/closed
|
|
108
187
|
client.stocks.getFundamentals("AAPL") // Financial data
|
|
109
188
|
client.stocks.getShortInterest("GME") // Short interest
|
|
189
|
+
client.stocks.getOptionsSummary("NVDA") // End-of-day options dossier
|
|
110
190
|
client.stocks.getAISummary("AAPL", { depth: "deep" }) // AI report (PRO)
|
|
111
191
|
```
|
|
112
192
|
|
|
@@ -398,9 +478,23 @@ const client = new SentiSense({
|
|
|
398
478
|
baseUrl: "https://...", // Default: https://app.sentisense.ai
|
|
399
479
|
timeout: 30000, // Default: 30s (in milliseconds)
|
|
400
480
|
maxRetries: 3, // Default: 3
|
|
481
|
+
userAgentSuffix: "my-bot/1.4", // Default: none
|
|
401
482
|
});
|
|
402
483
|
```
|
|
403
484
|
|
|
485
|
+
| Option | Default | What it does |
|
|
486
|
+
|--------|---------|--------------|
|
|
487
|
+
| `apiKey` | none | Sent as `X-SentiSense-API-Key`. Required by every endpoint. |
|
|
488
|
+
| `baseUrl` | `https://app.sentisense.ai` | Override for a non-production host. |
|
|
489
|
+
| `timeout` | `30000` | Per-request timeout in milliseconds. |
|
|
490
|
+
| `maxRetries` | `3` | Retries on 429 and 5xx, honouring `Retry-After`. Set `0` to fail fast. |
|
|
491
|
+
| `userAgentSuffix` | none | Appended to the User-Agent, after `sentisense-node/{version}`. |
|
|
492
|
+
|
|
493
|
+
`userAgentSuffix` is how you say what is calling on top of the SDK, so your traffic is legible
|
|
494
|
+
in your own logs and in ours. A tool name and version works (`"my-bot/1.4"`), optionally with
|
|
495
|
+
an agent label (`"my-bot/1.4 agent/research-desk"`). Node only, since browsers set the header
|
|
496
|
+
themselves. Newlines are collapsed and an empty value is ignored.
|
|
497
|
+
|
|
404
498
|
Keep the key in the environment rather than in source. Committing a literal key leaks it
|
|
405
499
|
into git history and into every registry security scan that reads your repo.
|
|
406
500
|
|