reportify-sdk 0.2.10 → 0.3.1
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 +49 -5
- package/dist/index.d.ts +49 -5
- package/dist/index.js +51 -6
- package/dist/index.mjs +51 -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?: {
|
|
@@ -744,6 +744,19 @@ interface OHLCVData {
|
|
|
744
744
|
volume: number;
|
|
745
745
|
[key: string]: unknown;
|
|
746
746
|
}
|
|
747
|
+
type FinancialType = 'income' | 'cashflow' | 'balancesheet' | 'equity';
|
|
748
|
+
interface FinancialsParams {
|
|
749
|
+
financialType: FinancialType;
|
|
750
|
+
symbol: string;
|
|
751
|
+
market?: StockMarket;
|
|
752
|
+
startYear?: number;
|
|
753
|
+
endYear?: number;
|
|
754
|
+
}
|
|
755
|
+
interface FinancialData {
|
|
756
|
+
symbol: string;
|
|
757
|
+
report_period: string;
|
|
758
|
+
[key: string]: unknown;
|
|
759
|
+
}
|
|
747
760
|
interface BacktestParams {
|
|
748
761
|
startDate: string;
|
|
749
762
|
endDate: string;
|
|
@@ -925,6 +938,37 @@ declare class QuantModule {
|
|
|
925
938
|
* ```
|
|
926
939
|
*/
|
|
927
940
|
ohlcvBatch(params: BatchOHLCVParams): Promise<OHLCVData[]>;
|
|
941
|
+
/**
|
|
942
|
+
* Get historical financial statement data for a single symbol
|
|
943
|
+
*
|
|
944
|
+
* @param params - Financials parameters
|
|
945
|
+
* @returns Array of financial data sorted by report period
|
|
946
|
+
*
|
|
947
|
+
* @example
|
|
948
|
+
* ```typescript
|
|
949
|
+
* // Get income statement
|
|
950
|
+
* const data = await client.quant.financials({
|
|
951
|
+
* financialType: 'income',
|
|
952
|
+
* symbol: '000001'
|
|
953
|
+
* });
|
|
954
|
+
*
|
|
955
|
+
* // Get balance sheet for specific years
|
|
956
|
+
* const data = await client.quant.financials({
|
|
957
|
+
* financialType: 'balancesheet',
|
|
958
|
+
* symbol: '600519',
|
|
959
|
+
* startYear: 2020,
|
|
960
|
+
* endYear: 2024
|
|
961
|
+
* });
|
|
962
|
+
*
|
|
963
|
+
* // Get cash flow statement for HK stock
|
|
964
|
+
* const data = await client.quant.financials({
|
|
965
|
+
* financialType: 'cashflow',
|
|
966
|
+
* symbol: '00700',
|
|
967
|
+
* market: 'hk'
|
|
968
|
+
* });
|
|
969
|
+
* ```
|
|
970
|
+
*/
|
|
971
|
+
financials(params: FinancialsParams): Promise<FinancialData[]>;
|
|
928
972
|
/**
|
|
929
973
|
* Execute strategy backtest
|
|
930
974
|
*
|
|
@@ -1409,7 +1453,7 @@ declare class SearchModule {
|
|
|
1409
1453
|
* Search company filings
|
|
1410
1454
|
*
|
|
1411
1455
|
* @param query - Search query string
|
|
1412
|
-
* @param symbols -
|
|
1456
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1413
1457
|
* @param options - Search options
|
|
1414
1458
|
*/
|
|
1415
1459
|
filings(query: string, symbols: string[], options?: Omit<SearchOptions, 'symbols' | 'categories' | 'industries' | 'channelIds'>): Promise<Document[]>;
|
|
@@ -1417,7 +1461,7 @@ declare class SearchModule {
|
|
|
1417
1461
|
* Search earnings call transcripts and slides
|
|
1418
1462
|
*
|
|
1419
1463
|
* @param query - Search query string
|
|
1420
|
-
* @param symbols -
|
|
1464
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1421
1465
|
* @param options - Search options including fiscal year/quarter filters
|
|
1422
1466
|
*/
|
|
1423
1467
|
conferenceCalls(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
|
@@ -1425,7 +1469,7 @@ declare class SearchModule {
|
|
|
1425
1469
|
* Search earnings financial reports
|
|
1426
1470
|
*
|
|
1427
1471
|
* @param query - Search query string
|
|
1428
|
-
* @param symbols -
|
|
1472
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1429
1473
|
* @param options - Search options including fiscal year/quarter filters
|
|
1430
1474
|
*/
|
|
1431
1475
|
earningsPack(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
|
@@ -1504,4 +1548,4 @@ declare class Reportify {
|
|
|
1504
1548
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1505
1549
|
}
|
|
1506
1550
|
|
|
1507
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
|
1551
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialData, type FinancialStatement, type FinancialType, type FinancialsParams, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
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?: {
|
|
@@ -744,6 +744,19 @@ interface OHLCVData {
|
|
|
744
744
|
volume: number;
|
|
745
745
|
[key: string]: unknown;
|
|
746
746
|
}
|
|
747
|
+
type FinancialType = 'income' | 'cashflow' | 'balancesheet' | 'equity';
|
|
748
|
+
interface FinancialsParams {
|
|
749
|
+
financialType: FinancialType;
|
|
750
|
+
symbol: string;
|
|
751
|
+
market?: StockMarket;
|
|
752
|
+
startYear?: number;
|
|
753
|
+
endYear?: number;
|
|
754
|
+
}
|
|
755
|
+
interface FinancialData {
|
|
756
|
+
symbol: string;
|
|
757
|
+
report_period: string;
|
|
758
|
+
[key: string]: unknown;
|
|
759
|
+
}
|
|
747
760
|
interface BacktestParams {
|
|
748
761
|
startDate: string;
|
|
749
762
|
endDate: string;
|
|
@@ -925,6 +938,37 @@ declare class QuantModule {
|
|
|
925
938
|
* ```
|
|
926
939
|
*/
|
|
927
940
|
ohlcvBatch(params: BatchOHLCVParams): Promise<OHLCVData[]>;
|
|
941
|
+
/**
|
|
942
|
+
* Get historical financial statement data for a single symbol
|
|
943
|
+
*
|
|
944
|
+
* @param params - Financials parameters
|
|
945
|
+
* @returns Array of financial data sorted by report period
|
|
946
|
+
*
|
|
947
|
+
* @example
|
|
948
|
+
* ```typescript
|
|
949
|
+
* // Get income statement
|
|
950
|
+
* const data = await client.quant.financials({
|
|
951
|
+
* financialType: 'income',
|
|
952
|
+
* symbol: '000001'
|
|
953
|
+
* });
|
|
954
|
+
*
|
|
955
|
+
* // Get balance sheet for specific years
|
|
956
|
+
* const data = await client.quant.financials({
|
|
957
|
+
* financialType: 'balancesheet',
|
|
958
|
+
* symbol: '600519',
|
|
959
|
+
* startYear: 2020,
|
|
960
|
+
* endYear: 2024
|
|
961
|
+
* });
|
|
962
|
+
*
|
|
963
|
+
* // Get cash flow statement for HK stock
|
|
964
|
+
* const data = await client.quant.financials({
|
|
965
|
+
* financialType: 'cashflow',
|
|
966
|
+
* symbol: '00700',
|
|
967
|
+
* market: 'hk'
|
|
968
|
+
* });
|
|
969
|
+
* ```
|
|
970
|
+
*/
|
|
971
|
+
financials(params: FinancialsParams): Promise<FinancialData[]>;
|
|
928
972
|
/**
|
|
929
973
|
* Execute strategy backtest
|
|
930
974
|
*
|
|
@@ -1409,7 +1453,7 @@ declare class SearchModule {
|
|
|
1409
1453
|
* Search company filings
|
|
1410
1454
|
*
|
|
1411
1455
|
* @param query - Search query string
|
|
1412
|
-
* @param symbols -
|
|
1456
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1413
1457
|
* @param options - Search options
|
|
1414
1458
|
*/
|
|
1415
1459
|
filings(query: string, symbols: string[], options?: Omit<SearchOptions, 'symbols' | 'categories' | 'industries' | 'channelIds'>): Promise<Document[]>;
|
|
@@ -1417,7 +1461,7 @@ declare class SearchModule {
|
|
|
1417
1461
|
* Search earnings call transcripts and slides
|
|
1418
1462
|
*
|
|
1419
1463
|
* @param query - Search query string
|
|
1420
|
-
* @param symbols -
|
|
1464
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1421
1465
|
* @param options - Search options including fiscal year/quarter filters
|
|
1422
1466
|
*/
|
|
1423
1467
|
conferenceCalls(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
|
@@ -1425,7 +1469,7 @@ declare class SearchModule {
|
|
|
1425
1469
|
* Search earnings financial reports
|
|
1426
1470
|
*
|
|
1427
1471
|
* @param query - Search query string
|
|
1428
|
-
* @param symbols -
|
|
1472
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1429
1473
|
* @param options - Search options including fiscal year/quarter filters
|
|
1430
1474
|
*/
|
|
1431
1475
|
earningsPack(query: string, symbols: string[], options?: EarningsSearchOptions): Promise<Document[]>;
|
|
@@ -1504,4 +1548,4 @@ declare class Reportify {
|
|
|
1504
1548
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1505
1549
|
}
|
|
1506
1550
|
|
|
1507
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
|
1551
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialData, type FinancialStatement, type FinancialType, type FinancialsParams, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
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 = {}) {
|
|
@@ -841,6 +841,51 @@ var QuantModule = class {
|
|
|
841
841
|
return response.datas || [];
|
|
842
842
|
}
|
|
843
843
|
// ===========================================================================
|
|
844
|
+
// Financials
|
|
845
|
+
// ===========================================================================
|
|
846
|
+
/**
|
|
847
|
+
* Get historical financial statement data for a single symbol
|
|
848
|
+
*
|
|
849
|
+
* @param params - Financials parameters
|
|
850
|
+
* @returns Array of financial data sorted by report period
|
|
851
|
+
*
|
|
852
|
+
* @example
|
|
853
|
+
* ```typescript
|
|
854
|
+
* // Get income statement
|
|
855
|
+
* const data = await client.quant.financials({
|
|
856
|
+
* financialType: 'income',
|
|
857
|
+
* symbol: '000001'
|
|
858
|
+
* });
|
|
859
|
+
*
|
|
860
|
+
* // Get balance sheet for specific years
|
|
861
|
+
* const data = await client.quant.financials({
|
|
862
|
+
* financialType: 'balancesheet',
|
|
863
|
+
* symbol: '600519',
|
|
864
|
+
* startYear: 2020,
|
|
865
|
+
* endYear: 2024
|
|
866
|
+
* });
|
|
867
|
+
*
|
|
868
|
+
* // Get cash flow statement for HK stock
|
|
869
|
+
* const data = await client.quant.financials({
|
|
870
|
+
* financialType: 'cashflow',
|
|
871
|
+
* symbol: '00700',
|
|
872
|
+
* market: 'hk'
|
|
873
|
+
* });
|
|
874
|
+
* ```
|
|
875
|
+
*/
|
|
876
|
+
async financials(params) {
|
|
877
|
+
const response = await this.client.get(
|
|
878
|
+
`/v1/quant/financials/${params.financialType}`,
|
|
879
|
+
{
|
|
880
|
+
symbol: params.symbol,
|
|
881
|
+
market: params.market || "cn",
|
|
882
|
+
start_year: params.startYear,
|
|
883
|
+
end_year: params.endYear
|
|
884
|
+
}
|
|
885
|
+
);
|
|
886
|
+
return response.datas || [];
|
|
887
|
+
}
|
|
888
|
+
// ===========================================================================
|
|
844
889
|
// Backtest
|
|
845
890
|
// ===========================================================================
|
|
846
891
|
/**
|
|
@@ -1474,7 +1519,7 @@ var SearchModule = class {
|
|
|
1474
1519
|
* Search company filings
|
|
1475
1520
|
*
|
|
1476
1521
|
* @param query - Search query string
|
|
1477
|
-
* @param symbols -
|
|
1522
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1478
1523
|
* @param options - Search options
|
|
1479
1524
|
*/
|
|
1480
1525
|
async filings(query, symbols, options = {}) {
|
|
@@ -1492,7 +1537,7 @@ var SearchModule = class {
|
|
|
1492
1537
|
* Search earnings call transcripts and slides
|
|
1493
1538
|
*
|
|
1494
1539
|
* @param query - Search query string
|
|
1495
|
-
* @param symbols -
|
|
1540
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1496
1541
|
* @param options - Search options including fiscal year/quarter filters
|
|
1497
1542
|
*/
|
|
1498
1543
|
async conferenceCalls(query, symbols, options = {}) {
|
|
@@ -1512,7 +1557,7 @@ var SearchModule = class {
|
|
|
1512
1557
|
* Search earnings financial reports
|
|
1513
1558
|
*
|
|
1514
1559
|
* @param query - Search query string
|
|
1515
|
-
* @param symbols -
|
|
1560
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1516
1561
|
* @param options - Search options including fiscal year/quarter filters
|
|
1517
1562
|
*/
|
|
1518
1563
|
async earningsPack(query, symbols, options = {}) {
|
|
@@ -1664,7 +1709,7 @@ var Reportify = class {
|
|
|
1664
1709
|
headers: {
|
|
1665
1710
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1666
1711
|
"Content-Type": "application/json",
|
|
1667
|
-
"User-Agent": "reportify-sdk-js/0.
|
|
1712
|
+
"User-Agent": "reportify-sdk-js/0.3.1"
|
|
1668
1713
|
},
|
|
1669
1714
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1670
1715
|
signal: controller.signal
|
|
@@ -1725,7 +1770,7 @@ var Reportify = class {
|
|
|
1725
1770
|
headers: {
|
|
1726
1771
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1727
1772
|
"Content-Type": "application/json",
|
|
1728
|
-
"User-Agent": "reportify-sdk-typescript/0.
|
|
1773
|
+
"User-Agent": "reportify-sdk-typescript/0.3.1"
|
|
1729
1774
|
}
|
|
1730
1775
|
});
|
|
1731
1776
|
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 = {}) {
|
|
@@ -799,6 +799,51 @@ var QuantModule = class {
|
|
|
799
799
|
return response.datas || [];
|
|
800
800
|
}
|
|
801
801
|
// ===========================================================================
|
|
802
|
+
// Financials
|
|
803
|
+
// ===========================================================================
|
|
804
|
+
/**
|
|
805
|
+
* Get historical financial statement data for a single symbol
|
|
806
|
+
*
|
|
807
|
+
* @param params - Financials parameters
|
|
808
|
+
* @returns Array of financial data sorted by report period
|
|
809
|
+
*
|
|
810
|
+
* @example
|
|
811
|
+
* ```typescript
|
|
812
|
+
* // Get income statement
|
|
813
|
+
* const data = await client.quant.financials({
|
|
814
|
+
* financialType: 'income',
|
|
815
|
+
* symbol: '000001'
|
|
816
|
+
* });
|
|
817
|
+
*
|
|
818
|
+
* // Get balance sheet for specific years
|
|
819
|
+
* const data = await client.quant.financials({
|
|
820
|
+
* financialType: 'balancesheet',
|
|
821
|
+
* symbol: '600519',
|
|
822
|
+
* startYear: 2020,
|
|
823
|
+
* endYear: 2024
|
|
824
|
+
* });
|
|
825
|
+
*
|
|
826
|
+
* // Get cash flow statement for HK stock
|
|
827
|
+
* const data = await client.quant.financials({
|
|
828
|
+
* financialType: 'cashflow',
|
|
829
|
+
* symbol: '00700',
|
|
830
|
+
* market: 'hk'
|
|
831
|
+
* });
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
async financials(params) {
|
|
835
|
+
const response = await this.client.get(
|
|
836
|
+
`/v1/quant/financials/${params.financialType}`,
|
|
837
|
+
{
|
|
838
|
+
symbol: params.symbol,
|
|
839
|
+
market: params.market || "cn",
|
|
840
|
+
start_year: params.startYear,
|
|
841
|
+
end_year: params.endYear
|
|
842
|
+
}
|
|
843
|
+
);
|
|
844
|
+
return response.datas || [];
|
|
845
|
+
}
|
|
846
|
+
// ===========================================================================
|
|
802
847
|
// Backtest
|
|
803
848
|
// ===========================================================================
|
|
804
849
|
/**
|
|
@@ -1432,7 +1477,7 @@ var SearchModule = class {
|
|
|
1432
1477
|
* Search company filings
|
|
1433
1478
|
*
|
|
1434
1479
|
* @param query - Search query string
|
|
1435
|
-
* @param symbols -
|
|
1480
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1436
1481
|
* @param options - Search options
|
|
1437
1482
|
*/
|
|
1438
1483
|
async filings(query, symbols, options = {}) {
|
|
@@ -1450,7 +1495,7 @@ var SearchModule = class {
|
|
|
1450
1495
|
* Search earnings call transcripts and slides
|
|
1451
1496
|
*
|
|
1452
1497
|
* @param query - Search query string
|
|
1453
|
-
* @param symbols -
|
|
1498
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1454
1499
|
* @param options - Search options including fiscal year/quarter filters
|
|
1455
1500
|
*/
|
|
1456
1501
|
async conferenceCalls(query, symbols, options = {}) {
|
|
@@ -1470,7 +1515,7 @@ var SearchModule = class {
|
|
|
1470
1515
|
* Search earnings financial reports
|
|
1471
1516
|
*
|
|
1472
1517
|
* @param query - Search query string
|
|
1473
|
-
* @param symbols -
|
|
1518
|
+
* @param symbols - Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
1474
1519
|
* @param options - Search options including fiscal year/quarter filters
|
|
1475
1520
|
*/
|
|
1476
1521
|
async earningsPack(query, symbols, options = {}) {
|
|
@@ -1622,7 +1667,7 @@ var Reportify = class {
|
|
|
1622
1667
|
headers: {
|
|
1623
1668
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1624
1669
|
"Content-Type": "application/json",
|
|
1625
|
-
"User-Agent": "reportify-sdk-js/0.
|
|
1670
|
+
"User-Agent": "reportify-sdk-js/0.3.1"
|
|
1626
1671
|
},
|
|
1627
1672
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1628
1673
|
signal: controller.signal
|
|
@@ -1683,7 +1728,7 @@ var Reportify = class {
|
|
|
1683
1728
|
headers: {
|
|
1684
1729
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1685
1730
|
"Content-Type": "application/json",
|
|
1686
|
-
"User-Agent": "reportify-sdk-typescript/0.
|
|
1731
|
+
"User-Agent": "reportify-sdk-typescript/0.3.1"
|
|
1687
1732
|
}
|
|
1688
1733
|
});
|
|
1689
1734
|
if (!response.ok) {
|