reportify-sdk 0.2.10 → 0.3.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 +107 -6
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,19 +49,18 @@ const balance = await client.stock.balanceSheet('US:AAPL');
|
|
|
49
49
|
const cashflow = await client.stock.cashflowStatement('US:AAPL');
|
|
50
50
|
|
|
51
51
|
// Price data
|
|
52
|
-
const prices = await client.stock.prices('US:AAPL', {
|
|
53
|
-
const kline = await client.stock.kline('US:TSLA', { interval: '1d', limit: 100 });
|
|
52
|
+
const prices = await client.stock.prices('US:AAPL', { startDate: '2024-01-01' });
|
|
54
53
|
|
|
55
|
-
// Real-time
|
|
56
|
-
const
|
|
54
|
+
// Real-time quote
|
|
55
|
+
const quote = await client.stock.quote('US:AAPL');
|
|
57
56
|
|
|
58
57
|
// Company info
|
|
59
58
|
const overview = await client.stock.overview('US:AAPL');
|
|
60
59
|
const shareholders = await client.stock.shareholders('US:AAPL');
|
|
61
60
|
|
|
62
61
|
// Screening and calendar
|
|
63
|
-
const stocks = await client.stock.screener({
|
|
64
|
-
const earnings = await client.stock.earningsCalendar({
|
|
62
|
+
const stocks = await client.stock.screener({ country: 'US', marketCapMoreThan: 1e10 });
|
|
63
|
+
const earnings = await client.stock.earningsCalendar({ market: 'us', startDate: '2024-01-01', endDate: '2024-01-31' });
|
|
65
64
|
```
|
|
66
65
|
|
|
67
66
|
### Timeline
|
|
@@ -92,6 +91,108 @@ const summary = await client.docs.summary('doc_id');
|
|
|
92
91
|
// List and search documents
|
|
93
92
|
const docs = await client.docs.list({ symbols: ['US:AAPL'], pageSize: 10 });
|
|
94
93
|
const chunks = await client.docs.searchChunks('revenue breakdown', { num: 5 });
|
|
94
|
+
|
|
95
|
+
// Upload documents
|
|
96
|
+
const result = await client.docs.uploadDocs([
|
|
97
|
+
{ url: 'https://example.com/report.pdf', name: 'Annual Report' }
|
|
98
|
+
]);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Quant (Quantitative Analysis)
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// Compute technical indicators
|
|
105
|
+
const rsi = await client.quant.computeIndicators({
|
|
106
|
+
symbols: ['000001'],
|
|
107
|
+
formula: 'RSI(14)'
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const macd = await client.quant.computeIndicators({
|
|
111
|
+
symbols: ['000001'],
|
|
112
|
+
formula: 'MACD()'
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Screen stocks by formula
|
|
116
|
+
const oversold = await client.quant.screen({ formula: 'RSI(14) < 30' });
|
|
117
|
+
const goldenCross = await client.quant.screen({ formula: 'CROSS(MA(5), MA(20))' });
|
|
118
|
+
|
|
119
|
+
// Get OHLCV data
|
|
120
|
+
const ohlcv = await client.quant.ohlcv({ symbol: '000001', startDate: '2024-01-01' });
|
|
121
|
+
const ohlcvBatch = await client.quant.ohlcvBatch({ symbols: ['000001', '600519'] });
|
|
122
|
+
|
|
123
|
+
// Backtest strategy
|
|
124
|
+
const result = await client.quant.backtest({
|
|
125
|
+
startDate: '2023-01-01',
|
|
126
|
+
endDate: '2024-01-01',
|
|
127
|
+
symbol: '000001',
|
|
128
|
+
entryFormula: 'CROSS(MA(5), MA(20))',
|
|
129
|
+
exitFormula: 'CROSSDOWN(MA(5), MA(20))'
|
|
130
|
+
});
|
|
131
|
+
console.log(`Total Return: ${(result.total_return_pct * 100).toFixed(2)}%`);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Concepts
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
// Get latest concepts
|
|
138
|
+
const concepts = await client.concepts.latest();
|
|
139
|
+
concepts.forEach(c => console.log(c.concept_name));
|
|
140
|
+
|
|
141
|
+
// Get today's concept feeds
|
|
142
|
+
const feeds = await client.concepts.today();
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Channels
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// Search channels
|
|
149
|
+
const result = await client.channels.search('Goldman Sachs');
|
|
150
|
+
|
|
151
|
+
// Get followed channels
|
|
152
|
+
const followings = await client.channels.getFollowings();
|
|
153
|
+
|
|
154
|
+
// Follow/unfollow a channel
|
|
155
|
+
await client.channels.follow('channel_id');
|
|
156
|
+
await client.channels.unfollow('channel_id');
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Chat
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
// Chat completion based on documents
|
|
163
|
+
const response = await client.chat.completion(
|
|
164
|
+
'What are Tesla revenue projections?',
|
|
165
|
+
{
|
|
166
|
+
symbols: ['US:TSLA'],
|
|
167
|
+
mode: 'comprehensive' // concise, comprehensive, deepresearch
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
console.log(response.message);
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Agent
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
// Create agent conversation
|
|
177
|
+
const conv = await client.agent.createConversation(11887655289749510);
|
|
178
|
+
|
|
179
|
+
// Chat with agent
|
|
180
|
+
const response = await client.agent.chat(
|
|
181
|
+
conv.id,
|
|
182
|
+
'Analyze NVIDIA latest earnings'
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
// Get agent-generated file
|
|
186
|
+
const fileContent = await client.agent.getFile('file_id');
|
|
187
|
+
// Save in Node.js: fs.writeFileSync('output.xlsx', Buffer.from(fileContent));
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### User
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
// Get followed companies
|
|
194
|
+
const companies = await client.user.followedCompanies();
|
|
195
|
+
companies.forEach(c => console.log(`${c.symbol}: ${c.name}`));
|
|
95
196
|
```
|
|
96
197
|
|
|
97
198
|
## Error Handling
|
package/dist/index.d.mts
CHANGED
|
@@ -567,7 +567,7 @@ declare class DocsModule {
|
|
|
567
567
|
/**
|
|
568
568
|
* Query documents by symbols
|
|
569
569
|
*
|
|
570
|
-
* @param symbols -
|
|
570
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
571
571
|
* @param options - Filter options
|
|
572
572
|
*/
|
|
573
573
|
queryBySymbols(symbols: string[], options?: {
|
|
@@ -1409,7 +1409,7 @@ declare class SearchModule {
|
|
|
1409
1409
|
* Search company filings
|
|
1410
1410
|
*
|
|
1411
1411
|
* @param query - Search query string
|
|
1412
|
-
* @param symbols -
|
|
1412
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1413
1413
|
* @param options - Search options
|
|
1414
1414
|
*/
|
|
1415
1415
|
filings(query: string, symbols: string[], options?: Omit<SearchOptions, 'symbols' | 'categories' | 'industries' | 'channelIds'>): Promise<Document[]>;
|
|
@@ -1417,7 +1417,7 @@ declare class SearchModule {
|
|
|
1417
1417
|
* Search earnings call transcripts and slides
|
|
1418
1418
|
*
|
|
1419
1419
|
* @param query - Search query string
|
|
1420
|
-
* @param symbols -
|
|
1420
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1421
1421
|
* @param options - Search options including fiscal year/quarter filters
|
|
1422
1422
|
*/
|
|
1423
1423
|
conferenceCalls(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
|
@@ -1425,7 +1425,7 @@ declare class SearchModule {
|
|
|
1425
1425
|
* Search earnings financial reports
|
|
1426
1426
|
*
|
|
1427
1427
|
* @param query - Search query string
|
|
1428
|
-
* @param symbols -
|
|
1428
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1429
1429
|
* @param options - Search options including fiscal year/quarter filters
|
|
1430
1430
|
*/
|
|
1431
1431
|
earningsPack(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -567,7 +567,7 @@ declare class DocsModule {
|
|
|
567
567
|
/**
|
|
568
568
|
* Query documents by symbols
|
|
569
569
|
*
|
|
570
|
-
* @param symbols -
|
|
570
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
571
571
|
* @param options - Filter options
|
|
572
572
|
*/
|
|
573
573
|
queryBySymbols(symbols: string[], options?: {
|
|
@@ -1409,7 +1409,7 @@ declare class SearchModule {
|
|
|
1409
1409
|
* Search company filings
|
|
1410
1410
|
*
|
|
1411
1411
|
* @param query - Search query string
|
|
1412
|
-
* @param symbols -
|
|
1412
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1413
1413
|
* @param options - Search options
|
|
1414
1414
|
*/
|
|
1415
1415
|
filings(query: string, symbols: string[], options?: Omit<SearchOptions, 'symbols' | 'categories' | 'industries' | 'channelIds'>): Promise<Document[]>;
|
|
@@ -1417,7 +1417,7 @@ declare class SearchModule {
|
|
|
1417
1417
|
* Search earnings call transcripts and slides
|
|
1418
1418
|
*
|
|
1419
1419
|
* @param query - Search query string
|
|
1420
|
-
* @param symbols -
|
|
1420
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1421
1421
|
* @param options - Search options including fiscal year/quarter filters
|
|
1422
1422
|
*/
|
|
1423
1423
|
conferenceCalls(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
|
@@ -1425,7 +1425,7 @@ declare class SearchModule {
|
|
|
1425
1425
|
* Search earnings financial reports
|
|
1426
1426
|
*
|
|
1427
1427
|
* @param query - Search query string
|
|
1428
|
-
* @param symbols -
|
|
1428
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1429
1429
|
* @param options - Search options including fiscal year/quarter filters
|
|
1430
1430
|
*/
|
|
1431
1431
|
earningsPack(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
package/dist/index.js
CHANGED
|
@@ -468,7 +468,7 @@ var DocsModule = class {
|
|
|
468
468
|
/**
|
|
469
469
|
* Query documents by symbols
|
|
470
470
|
*
|
|
471
|
-
* @param symbols -
|
|
471
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
472
472
|
* @param options - Filter options
|
|
473
473
|
*/
|
|
474
474
|
async queryBySymbols(symbols, options = {}) {
|
|
@@ -1474,7 +1474,7 @@ var SearchModule = class {
|
|
|
1474
1474
|
* Search company filings
|
|
1475
1475
|
*
|
|
1476
1476
|
* @param query - Search query string
|
|
1477
|
-
* @param symbols -
|
|
1477
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1478
1478
|
* @param options - Search options
|
|
1479
1479
|
*/
|
|
1480
1480
|
async filings(query, symbols, options = {}) {
|
|
@@ -1492,7 +1492,7 @@ var SearchModule = class {
|
|
|
1492
1492
|
* Search earnings call transcripts and slides
|
|
1493
1493
|
*
|
|
1494
1494
|
* @param query - Search query string
|
|
1495
|
-
* @param symbols -
|
|
1495
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1496
1496
|
* @param options - Search options including fiscal year/quarter filters
|
|
1497
1497
|
*/
|
|
1498
1498
|
async conferenceCalls(query, symbols, options = {}) {
|
|
@@ -1512,7 +1512,7 @@ var SearchModule = class {
|
|
|
1512
1512
|
* Search earnings financial reports
|
|
1513
1513
|
*
|
|
1514
1514
|
* @param query - Search query string
|
|
1515
|
-
* @param symbols -
|
|
1515
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1516
1516
|
* @param options - Search options including fiscal year/quarter filters
|
|
1517
1517
|
*/
|
|
1518
1518
|
async earningsPack(query, symbols, options = {}) {
|
|
@@ -1664,7 +1664,7 @@ var Reportify = class {
|
|
|
1664
1664
|
headers: {
|
|
1665
1665
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1666
1666
|
"Content-Type": "application/json",
|
|
1667
|
-
"User-Agent": "reportify-sdk-js/0.
|
|
1667
|
+
"User-Agent": "reportify-sdk-js/0.3.0"
|
|
1668
1668
|
},
|
|
1669
1669
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1670
1670
|
signal: controller.signal
|
|
@@ -1725,7 +1725,7 @@ var Reportify = class {
|
|
|
1725
1725
|
headers: {
|
|
1726
1726
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1727
1727
|
"Content-Type": "application/json",
|
|
1728
|
-
"User-Agent": "reportify-sdk-typescript/0.
|
|
1728
|
+
"User-Agent": "reportify-sdk-typescript/0.3.0"
|
|
1729
1729
|
}
|
|
1730
1730
|
});
|
|
1731
1731
|
if (!response.ok) {
|
package/dist/index.mjs
CHANGED
|
@@ -426,7 +426,7 @@ var DocsModule = class {
|
|
|
426
426
|
/**
|
|
427
427
|
* Query documents by symbols
|
|
428
428
|
*
|
|
429
|
-
* @param symbols -
|
|
429
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
430
430
|
* @param options - Filter options
|
|
431
431
|
*/
|
|
432
432
|
async queryBySymbols(symbols, options = {}) {
|
|
@@ -1432,7 +1432,7 @@ var SearchModule = class {
|
|
|
1432
1432
|
* Search company filings
|
|
1433
1433
|
*
|
|
1434
1434
|
* @param query - Search query string
|
|
1435
|
-
* @param symbols -
|
|
1435
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1436
1436
|
* @param options - Search options
|
|
1437
1437
|
*/
|
|
1438
1438
|
async filings(query, symbols, options = {}) {
|
|
@@ -1450,7 +1450,7 @@ var SearchModule = class {
|
|
|
1450
1450
|
* Search earnings call transcripts and slides
|
|
1451
1451
|
*
|
|
1452
1452
|
* @param query - Search query string
|
|
1453
|
-
* @param symbols -
|
|
1453
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1454
1454
|
* @param options - Search options including fiscal year/quarter filters
|
|
1455
1455
|
*/
|
|
1456
1456
|
async conferenceCalls(query, symbols, options = {}) {
|
|
@@ -1470,7 +1470,7 @@ var SearchModule = class {
|
|
|
1470
1470
|
* Search earnings financial reports
|
|
1471
1471
|
*
|
|
1472
1472
|
* @param query - Search query string
|
|
1473
|
-
* @param symbols -
|
|
1473
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1474
1474
|
* @param options - Search options including fiscal year/quarter filters
|
|
1475
1475
|
*/
|
|
1476
1476
|
async earningsPack(query, symbols, options = {}) {
|
|
@@ -1622,7 +1622,7 @@ var Reportify = class {
|
|
|
1622
1622
|
headers: {
|
|
1623
1623
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1624
1624
|
"Content-Type": "application/json",
|
|
1625
|
-
"User-Agent": "reportify-sdk-js/0.
|
|
1625
|
+
"User-Agent": "reportify-sdk-js/0.3.0"
|
|
1626
1626
|
},
|
|
1627
1627
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1628
1628
|
signal: controller.signal
|
|
@@ -1683,7 +1683,7 @@ var Reportify = class {
|
|
|
1683
1683
|
headers: {
|
|
1684
1684
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1685
1685
|
"Content-Type": "application/json",
|
|
1686
|
-
"User-Agent": "reportify-sdk-typescript/0.
|
|
1686
|
+
"User-Agent": "reportify-sdk-typescript/0.3.0"
|
|
1687
1687
|
}
|
|
1688
1688
|
});
|
|
1689
1689
|
if (!response.ok) {
|