@secapi/cli 0.3.0 → 0.4.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/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/index.js +18499 -9711
- package/package.json +11 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SEC API
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# SEC API CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for SEC API factor data, SEC filings, financial statements, ownership data, and agent workflows.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @secapi/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
export SECAPI_API_KEY="ods_..."
|
|
15
|
+
export SECAPI_BASE_URL="https://api.secapi.ai"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`SECAPI_BASE_URL` is optional. The CLI defaults to `https://api.secapi.ai`.
|
|
19
|
+
|
|
20
|
+
Two binaries are installed: the preferred `secapi` and the compatibility alias `omni-sec`.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
secapi --version # prints the bare package version, e.g. 0.4.0
|
|
24
|
+
secapi --help # lists every command group
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Five-minute Quickstart
|
|
28
|
+
|
|
29
|
+
Five copy-paste examples that exercise the core surfaces. Each reads
|
|
30
|
+
`SECAPI_API_KEY` from the environment — credentials are never accepted as
|
|
31
|
+
argv flags (they leak through shell history); pipe them via `--api-key-stdin`
|
|
32
|
+
if you cannot set an env var.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# 1. Confirm auth and see your plan/limits
|
|
36
|
+
secapi me
|
|
37
|
+
|
|
38
|
+
# 2. Pull the latest 10-K for a ticker
|
|
39
|
+
secapi filings latest --ticker AAPL --form 10-K
|
|
40
|
+
|
|
41
|
+
# 3. Full-text search filing content (Typesense)
|
|
42
|
+
secapi search fulltext --q "supply chain disruption" --form 10-K --limit 10
|
|
43
|
+
|
|
44
|
+
# 4. Hybrid semantic search with citation fields (Voyage AI + Pinecone)
|
|
45
|
+
secapi search semantic --q "revenue concentration risk" --ticker AAPL --mode hybrid --view agent
|
|
46
|
+
|
|
47
|
+
# 5. A single XBRL fact across filings
|
|
48
|
+
secapi facts get --ticker AAPL --tag Assets --form 10-K
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Search
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Keyword/full-text search across filing + section text
|
|
55
|
+
secapi search fulltext --q "going concern" --ticker BBBB --limit 25
|
|
56
|
+
|
|
57
|
+
# Vector / hybrid semantic search; --view agent drops score + retrievalMode
|
|
58
|
+
secapi search semantic --q "material weakness in internal controls" --mode hybrid --filing-year 2025
|
|
59
|
+
|
|
60
|
+
# Section-scoped keyword search
|
|
61
|
+
secapi sections search --ticker AAPL --q risk --form 10-K
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Factor Quickstart
|
|
65
|
+
|
|
66
|
+
Use `--response-mode compact` when you are feeding an agent, LLM, notebook, or UI card and want the smallest useful payload. Add `--include trust` when you need freshness, methodology, and materialization metadata for citations or launch checks.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Factor catalog for picker UIs and agent tool discovery
|
|
70
|
+
secapi factors catalog --category style --response-mode compact --include trust
|
|
71
|
+
|
|
72
|
+
# 1D through MAX style return history for charts and tables
|
|
73
|
+
secapi factors history --factor VALUE --range 1y --response-mode compact --include trust,series
|
|
74
|
+
|
|
75
|
+
# Factor opportunity screen for valuation-led workflows
|
|
76
|
+
secapi factors valuations \
|
|
77
|
+
--keys VALUE,QUALITY,MOMENTUM \
|
|
78
|
+
--side all \
|
|
79
|
+
--sort opportunity_score \
|
|
80
|
+
--limit 25 \
|
|
81
|
+
--response-mode compact \
|
|
82
|
+
--include trust
|
|
83
|
+
|
|
84
|
+
# Extreme moves and pairs for dashboard surfaces
|
|
85
|
+
secapi factors dashboard --country US --category style --ticker AAPL --response-mode compact --include trust
|
|
86
|
+
secapi factors extreme-moves --category style --window 1d --min-z-score 2 --response-mode compact --include trust
|
|
87
|
+
secapi factors extreme-pairs --category style --window 1m --min-z-score 1 --response-mode compact --include trust
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Portfolio Factor Workflows
|
|
91
|
+
|
|
92
|
+
Portfolio and model workflows accept JSON because they carry holdings and constraints.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cat > holdings.json <<'JSON'
|
|
96
|
+
[
|
|
97
|
+
{ "symbol": "AAPL", "weight": 0.4 },
|
|
98
|
+
{ "symbol": "MSFT", "weight": 0.35 },
|
|
99
|
+
{ "symbol": "NVDA", "weight": 0.25 }
|
|
100
|
+
]
|
|
101
|
+
JSON
|
|
102
|
+
|
|
103
|
+
secapi portfolio analyze \
|
|
104
|
+
--holdings-file holdings.json \
|
|
105
|
+
--response-mode compact \
|
|
106
|
+
--include trust
|
|
107
|
+
|
|
108
|
+
secapi portfolio attribution \
|
|
109
|
+
--holdings-file holdings.json \
|
|
110
|
+
--window 1y \
|
|
111
|
+
--frequency monthly \
|
|
112
|
+
--response-mode compact \
|
|
113
|
+
--include trust
|
|
114
|
+
|
|
115
|
+
secapi portfolio hedge \
|
|
116
|
+
--holdings-file holdings.json \
|
|
117
|
+
--objective factor_neutral \
|
|
118
|
+
--constraints-json '{"maxHedges":5}' \
|
|
119
|
+
--response-mode compact \
|
|
120
|
+
--include trust
|
|
121
|
+
|
|
122
|
+
secapi portfolio optimize \
|
|
123
|
+
--holdings-file holdings.json \
|
|
124
|
+
--objective regime_aware \
|
|
125
|
+
--constraints-json '{"longOnly":true,"maxPositionWeight":0.35}' \
|
|
126
|
+
--response-mode compact \
|
|
127
|
+
--include trust
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Model Workflows
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
secapi models factor-analysis \
|
|
134
|
+
--holdings-file holdings.json \
|
|
135
|
+
--model-json '{"id":"growth-core","label":"Growth Core"}' \
|
|
136
|
+
--include-attribution \
|
|
137
|
+
--include-hedge \
|
|
138
|
+
--include-optimizer \
|
|
139
|
+
--response-mode compact \
|
|
140
|
+
--include trust
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Discovery
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
secapi --help
|
|
147
|
+
secapi factors catalog --category style
|
|
148
|
+
secapi factors bulk-download --keys VALUE,QUALITY,MOMENTUM --format csv
|
|
149
|
+
secapi factors similarity-pack --symbol AAPL --limit 10
|
|
150
|
+
secapi model-portfolios factor-view --portfolio-id growth-core --response-mode compact
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Links
|
|
154
|
+
|
|
155
|
+
- [API Documentation](https://docs.secapi.ai)
|
|
156
|
+
- [Developer Portal](https://secapi.ai/developers)
|