tn-financial-data 0.3.0 → 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 +12 -0
- package/dist/cli.js +118 -6
- package/dist/client/index.d.ts +24 -1
- package/dist/client/index.js +15 -5
- package/package.json +1 -1
- package/skills/tn-financial-data/references/cli.md +14 -0
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ This package is the hosted agent-facing surface only. The repo's website, local
|
|
|
28
28
|
- Company facts, financials, prices, news, insider trades, ownership, global rates, and raw SEC filings through one hosted API
|
|
29
29
|
- Multi-ticker resolve and snapshot reads for lower-latency agent workflows
|
|
30
30
|
- Earnings calendar, dividends, and stock splits through the same hosted read contract
|
|
31
|
+
- Cross-ticker news search over article title, summary, and body text with ticker, provider, publisher, and date filters
|
|
31
32
|
- Agent-friendly CLI with clean error output, scoped subcommand help, and self-description via `tn-financial-data describe opencli`
|
|
32
33
|
- Packaged skill bundle for Claude and OpenCode installs
|
|
33
34
|
- Typed TypeScript client from the root package export
|
|
@@ -73,6 +74,7 @@ tn-financial-data query financial-metrics-snapshot --tickers AAPL,MSFT,NVDA --pe
|
|
|
73
74
|
tn-financial-data query earnings-calendar --tickers AAPL,MSFT --start-date 2026-04-02 --end-date 2026-04-16
|
|
74
75
|
tn-financial-data query dividends --ticker AAPL --limit 10
|
|
75
76
|
tn-financial-data query company --ticker AAPL
|
|
77
|
+
tn-financial-data query news-search --query "tariff semiconductor" --ticker NVDA --limit 10
|
|
76
78
|
tn-financial-data query filings --ticker AAPL --filing-type 8-K --limit 5
|
|
77
79
|
tn-financial-data query general-overview --ticker AAPL --period quarterly --financial-limit 4 --news-limit 5
|
|
78
80
|
tn-financial-data skill install --tool claude
|
|
@@ -108,6 +110,8 @@ tn-financial-data query splits --ticker AAPL --limit 10
|
|
|
108
110
|
tn-financial-data query filings --ticker AAPL --filing-type 10-K,10-Q,8-K --limit 10
|
|
109
111
|
tn-financial-data query filing-items --ticker AAPL --accession-number 0000320193-26-000005 --item 2.02 --include-exhibits
|
|
110
112
|
tn-financial-data query prices --ticker AAPL --interval day --start-date 2025-01-01 --end-date 2025-01-31
|
|
113
|
+
tn-financial-data query news --ticker AAPL --limit 10
|
|
114
|
+
tn-financial-data query news-search --query "AI data center" --provider alpaca --limit 10
|
|
111
115
|
tn-financial-data query institutional-ownership --ticker AAPL --limit 20
|
|
112
116
|
tn-financial-data query investor-portfolio --investor vanguard --limit 20
|
|
113
117
|
tn-financial-data query global-rates --series ecb_refi,boe_sonia --limit 10
|
|
@@ -205,6 +209,14 @@ const filings = await client.getFilings("AAPL", {
|
|
|
205
209
|
|
|
206
210
|
console.log(filings.filings[0]?.accession_number);
|
|
207
211
|
|
|
212
|
+
const news = await client.searchNews("AI data center", {
|
|
213
|
+
ticker: "NVDA",
|
|
214
|
+
provider: "alpaca",
|
|
215
|
+
limit: 5,
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
console.log(news.news[0]?.title, news.count);
|
|
219
|
+
|
|
208
220
|
const filingItems = await client.getFilingItems("AAPL", {
|
|
209
221
|
accessionNumber: "0000320193-26-000005",
|
|
210
222
|
filingType: "8-K",
|
package/dist/cli.js
CHANGED
|
@@ -202,6 +202,13 @@ var TnFinancialData = class {
|
|
|
202
202
|
if (opts?.endDate) params.set("end_date", opts.endDate);
|
|
203
203
|
return params.toString();
|
|
204
204
|
}
|
|
205
|
+
buildNewsParams(params, opts) {
|
|
206
|
+
if (opts?.limit !== void 0) params.set("limit", String(opts.limit));
|
|
207
|
+
if (opts?.startDate) params.set("start_date", opts.startDate);
|
|
208
|
+
if (opts?.endDate) params.set("end_date", opts.endDate);
|
|
209
|
+
if (opts?.publisher) params.set("publisher", opts.publisher);
|
|
210
|
+
return params.toString();
|
|
211
|
+
}
|
|
205
212
|
buildFilingsParams(ticker, opts) {
|
|
206
213
|
const params = new URLSearchParams({ ticker });
|
|
207
214
|
this.appendLimitParam(params, opts?.limit);
|
|
@@ -317,11 +324,14 @@ var TnFinancialData = class {
|
|
|
317
324
|
}
|
|
318
325
|
async getNews(ticker, opts) {
|
|
319
326
|
const params = new URLSearchParams({ ticker });
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
return this.request(`/news?${this.buildNewsParams(params, opts)}`);
|
|
328
|
+
}
|
|
329
|
+
async searchNews(query, opts) {
|
|
330
|
+
const params = new URLSearchParams({ q: query });
|
|
331
|
+
if (opts?.ticker) params.set("ticker", opts.ticker);
|
|
332
|
+
if (opts?.offset !== void 0) params.set("offset", String(opts.offset));
|
|
333
|
+
if (opts?.provider) params.set("provider", opts.provider);
|
|
334
|
+
return this.request(`/news/search?${this.buildNewsParams(params, opts)}`);
|
|
325
335
|
}
|
|
326
336
|
async getDividends(ticker, opts) {
|
|
327
337
|
return this.request(
|
|
@@ -551,6 +561,13 @@ function parsePositiveInt(value, optionName) {
|
|
|
551
561
|
}
|
|
552
562
|
return parsed;
|
|
553
563
|
}
|
|
564
|
+
function parseNonNegativeInt(value, optionName) {
|
|
565
|
+
const parsed = Number.parseInt(value, 10);
|
|
566
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
567
|
+
throw new CliUsageError(`--${optionName} must be a non-negative integer.`);
|
|
568
|
+
}
|
|
569
|
+
return parsed;
|
|
570
|
+
}
|
|
554
571
|
function parseCsvValues(value, optionName) {
|
|
555
572
|
const parts = value.split(",").map((part) => part.trim()).filter((part) => part.length > 0);
|
|
556
573
|
if (parts.length === 0) {
|
|
@@ -649,7 +666,7 @@ function rootHelp() {
|
|
|
649
666
|
"tn-financial-data",
|
|
650
667
|
"",
|
|
651
668
|
"Usage:",
|
|
652
|
-
" tn-financial-data query <available-tickers|resolve-ticker|company|filings|filing-items|general-overview|financials|financial-metrics|financial-metrics-snapshot|earnings|earnings-calendar|quarterly-highlights|analyst-estimates|prices|snapshot|dividends|splits|news|insider-trades|institutional-ownership|investor-portfolio|global-rates|segmented-revenues|screen|screen-fields> [options]",
|
|
669
|
+
" tn-financial-data query <available-tickers|resolve-ticker|company|filings|filing-items|general-overview|financials|financial-metrics|financial-metrics-snapshot|earnings|earnings-calendar|quarterly-highlights|analyst-estimates|prices|snapshot|dividends|splits|news|news-search|insider-trades|institutional-ownership|investor-portfolio|global-rates|segmented-revenues|screen|screen-fields> [options]",
|
|
653
670
|
" tn-financial-data skill <install|print|targets> [--tool claude|opencode]",
|
|
654
671
|
" tn-financial-data describe opencli",
|
|
655
672
|
" tn-financial-data --version",
|
|
@@ -673,6 +690,7 @@ function rootHelp() {
|
|
|
673
690
|
" tn-financial-data query prices --ticker AAPL --interval day --start-date 2025-01-01 --end-date 2025-01-31",
|
|
674
691
|
" tn-financial-data query dividends --ticker AAPL --limit 20",
|
|
675
692
|
" tn-financial-data query splits --ticker AAPL --limit 20",
|
|
693
|
+
' tn-financial-data query news-search --query "tariff semiconductor" --ticker NVDA --limit 10',
|
|
676
694
|
" tn-financial-data query insider-trades --ticker AAPL --transaction-code P,S --limit 25",
|
|
677
695
|
" tn-financial-data query institutional-ownership --ticker AAPL --limit 20",
|
|
678
696
|
" tn-financial-data query investor-portfolio --investor vanguard --limit 20",
|
|
@@ -713,6 +731,7 @@ function queryHelp() {
|
|
|
713
731
|
" tn-financial-data query dividends --ticker <symbol> [--start-date <date>] [--end-date <date>] [--limit <n>] [--api-key <key>] [--base-url <url>]",
|
|
714
732
|
" tn-financial-data query splits --ticker <symbol> [--start-date <date>] [--end-date <date>] [--limit <n>] [--api-key <key>] [--base-url <url>]",
|
|
715
733
|
" tn-financial-data query news --ticker <symbol> [--start-date <date>] [--end-date <date>] [--publisher <name>] [--limit <n>] [--api-key <key>] [--base-url <url>]",
|
|
734
|
+
" tn-financial-data query news-search --query <text> [--ticker <symbol>] [--start-date <date>] [--end-date <date>] [--publisher <name>] [--provider <id>] [--limit <n>] [--offset <n>] [--api-key <key>] [--base-url <url>]",
|
|
716
735
|
" tn-financial-data query insider-trades --ticker <symbol> [--start-date <date>] [--end-date <date>] [--reporting-owner-cik <cik>] [--transaction-code <csv>] [--security-type <all|non_derivative|derivative>] [--limit <n>] [--api-key <key>] [--base-url <url>]",
|
|
717
736
|
" tn-financial-data query institutional-ownership --ticker <symbol> [--limit <n>] [--api-key <key>] [--base-url <url>]",
|
|
718
737
|
" tn-financial-data query investor-portfolio (--cik <cik> | --investor <alias>) [--limit <n>] [--api-key <key>] [--base-url <url>]",
|
|
@@ -837,6 +856,7 @@ function buildOpenCliDocument() {
|
|
|
837
856
|
"tn-financial-data query prices --ticker AAPL --interval day --start-date 2025-01-01 --end-date 2025-01-31",
|
|
838
857
|
"tn-financial-data query dividends --ticker AAPL --limit 20",
|
|
839
858
|
"tn-financial-data query splits --ticker AAPL --limit 20",
|
|
859
|
+
'tn-financial-data query news-search --query "tariff semiconductor" --ticker NVDA --limit 10',
|
|
840
860
|
"tn-financial-data query insider-trades --ticker AAPL --transaction-code P,S --limit 25",
|
|
841
861
|
"tn-financial-data query institutional-ownership --ticker AAPL --limit 20",
|
|
842
862
|
"tn-financial-data query investor-portfolio --investor vanguard --limit 20",
|
|
@@ -1640,6 +1660,61 @@ function buildOpenCliDocument() {
|
|
|
1640
1660
|
}
|
|
1641
1661
|
]
|
|
1642
1662
|
},
|
|
1663
|
+
{
|
|
1664
|
+
name: "news-search",
|
|
1665
|
+
description: "Search canonical news articles across the covered ticker universe.",
|
|
1666
|
+
options: [
|
|
1667
|
+
{
|
|
1668
|
+
name: "query",
|
|
1669
|
+
required: true,
|
|
1670
|
+
arguments: [{ name: "text", required: true, description: "Search query." }],
|
|
1671
|
+
description: "Plain-text search query."
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
name: "ticker",
|
|
1675
|
+
arguments: [{ name: "ticker", required: true, description: "Ticker symbol." }],
|
|
1676
|
+
description: "Optional ticker filter."
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
name: "start-date",
|
|
1680
|
+
arguments: [{ name: "date", required: true, description: "Filter start date." }],
|
|
1681
|
+
description: "Inclusive start date for search results."
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
name: "end-date",
|
|
1685
|
+
arguments: [{ name: "date", required: true, description: "Filter end date." }],
|
|
1686
|
+
description: "Inclusive end date for search results."
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
name: "publisher",
|
|
1690
|
+
arguments: [
|
|
1691
|
+
{ name: "publisher", required: true, description: "Publisher name filter." }
|
|
1692
|
+
],
|
|
1693
|
+
description: "Filter by publisher name."
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
name: "provider",
|
|
1697
|
+
arguments: [
|
|
1698
|
+
{ name: "provider", required: true, description: "Provider id filter." }
|
|
1699
|
+
],
|
|
1700
|
+
description: "Filter by provider id, for example alpaca."
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
name: "limit",
|
|
1704
|
+
arguments: [
|
|
1705
|
+
{ name: "limit", required: true, description: "Positive integer, max 100." }
|
|
1706
|
+
],
|
|
1707
|
+
description: "Maximum number of search results to return."
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
name: "offset",
|
|
1711
|
+
arguments: [
|
|
1712
|
+
{ name: "offset", required: true, description: "Non-negative integer." }
|
|
1713
|
+
],
|
|
1714
|
+
description: "Zero-based pagination offset."
|
|
1715
|
+
}
|
|
1716
|
+
]
|
|
1717
|
+
},
|
|
1643
1718
|
{
|
|
1644
1719
|
name: "insider-trades",
|
|
1645
1720
|
description: "Fetch stored SEC Form 4 insider-trade line items for one ticker, including derivative and non-derivative transactions.",
|
|
@@ -2151,6 +2226,23 @@ var QUERY_SUBCOMMAND_HELP = {
|
|
|
2151
2226
|
],
|
|
2152
2227
|
"tn-financial-data query news --ticker AAPL --limit 10"
|
|
2153
2228
|
),
|
|
2229
|
+
"news-search": renderHelp(
|
|
2230
|
+
"news-search",
|
|
2231
|
+
["Search canonical news articles across the covered ticker universe."],
|
|
2232
|
+
[
|
|
2233
|
+
"--query <text> Required. Plain-text search query.",
|
|
2234
|
+
"--ticker <symbol> Optional covered ticker filter.",
|
|
2235
|
+
"--start-date <date> Optional start date (YYYY-MM-DD).",
|
|
2236
|
+
"--end-date <date> Optional end date (YYYY-MM-DD).",
|
|
2237
|
+
"--publisher <name> Optional publisher filter.",
|
|
2238
|
+
"--provider <id> Optional provider filter, for example alpaca.",
|
|
2239
|
+
"--limit <n> Number of articles to return. Max 100.",
|
|
2240
|
+
"--offset <n> Optional zero-based pagination offset.",
|
|
2241
|
+
"--api-key <key> API key. Overrides TN_FINANCIAL_DATA_API_KEY.",
|
|
2242
|
+
"--base-url <url> API base URL override."
|
|
2243
|
+
],
|
|
2244
|
+
'tn-financial-data query news-search --query "tariff semiconductor" --ticker NVDA --limit 10'
|
|
2245
|
+
),
|
|
2154
2246
|
"insider-trades": renderHelp(
|
|
2155
2247
|
"insider-trades",
|
|
2156
2248
|
["Fetch SEC Form 4 insider-trade rows for a single issuer."],
|
|
@@ -2677,6 +2769,26 @@ async function handleQuery(parsed, runtime, deps) {
|
|
|
2677
2769
|
);
|
|
2678
2770
|
return 0;
|
|
2679
2771
|
}
|
|
2772
|
+
case "news-search": {
|
|
2773
|
+
const query = requireOption(parsed, "query");
|
|
2774
|
+
const limit = getOption(parsed, "limit");
|
|
2775
|
+
const offset = getOption(parsed, "offset");
|
|
2776
|
+
const options = {
|
|
2777
|
+
ticker: getOption(parsed, "ticker"),
|
|
2778
|
+
startDate: getOption(parsed, "start-date"),
|
|
2779
|
+
endDate: getOption(parsed, "end-date"),
|
|
2780
|
+
publisher: getOption(parsed, "publisher"),
|
|
2781
|
+
provider: getOption(parsed, "provider")
|
|
2782
|
+
};
|
|
2783
|
+
if (limit) {
|
|
2784
|
+
options.limit = parsePositiveInt(limit, "limit");
|
|
2785
|
+
}
|
|
2786
|
+
if (offset) {
|
|
2787
|
+
options.offset = parseNonNegativeInt(offset, "offset");
|
|
2788
|
+
}
|
|
2789
|
+
printJson(runtime, await client.searchNews(query, options));
|
|
2790
|
+
return 0;
|
|
2791
|
+
}
|
|
2680
2792
|
case "insider-trades": {
|
|
2681
2793
|
const ticker = requireOption(parsed, "ticker");
|
|
2682
2794
|
const limit = getOption(parsed, "limit");
|
package/dist/client/index.d.ts
CHANGED
|
@@ -384,6 +384,10 @@ interface NewsArticle {
|
|
|
384
384
|
summary: string | null;
|
|
385
385
|
refreshed_at: string;
|
|
386
386
|
}
|
|
387
|
+
interface NewsSearchArticle extends NewsArticle {
|
|
388
|
+
provider: string | null;
|
|
389
|
+
relevance: number | null;
|
|
390
|
+
}
|
|
387
391
|
interface ReadMetadata {
|
|
388
392
|
ticker: string;
|
|
389
393
|
availability: DataAvailability;
|
|
@@ -423,6 +427,15 @@ interface NewsOpts {
|
|
|
423
427
|
endDate?: string;
|
|
424
428
|
publisher?: string;
|
|
425
429
|
}
|
|
430
|
+
interface NewsSearchOpts {
|
|
431
|
+
ticker?: string;
|
|
432
|
+
limit?: number;
|
|
433
|
+
offset?: number;
|
|
434
|
+
startDate?: string;
|
|
435
|
+
endDate?: string;
|
|
436
|
+
publisher?: string;
|
|
437
|
+
provider?: string;
|
|
438
|
+
}
|
|
426
439
|
interface CorporateActionsOpts {
|
|
427
440
|
limit?: number;
|
|
428
441
|
startDate?: string;
|
|
@@ -615,6 +628,14 @@ interface PriceHistoryResponse extends ReadMetadata {
|
|
|
615
628
|
interface NewsResponse extends ReadMetadata {
|
|
616
629
|
news: NewsArticle[];
|
|
617
630
|
}
|
|
631
|
+
interface NewsSearchResponse {
|
|
632
|
+
query: string;
|
|
633
|
+
count: number;
|
|
634
|
+
limit: number;
|
|
635
|
+
offset: number;
|
|
636
|
+
has_more: boolean;
|
|
637
|
+
news: NewsSearchArticle[];
|
|
638
|
+
}
|
|
618
639
|
interface DividendsResponse extends ReadMetadata {
|
|
619
640
|
count: number;
|
|
620
641
|
limit: number;
|
|
@@ -924,6 +945,7 @@ declare class TnFinancialData {
|
|
|
924
945
|
private buildEarningsCalendarParams;
|
|
925
946
|
private buildInsiderTradeParams;
|
|
926
947
|
private buildCorporateActionsParams;
|
|
948
|
+
private buildNewsParams;
|
|
927
949
|
private buildFilingsParams;
|
|
928
950
|
private buildFilingItemsParams;
|
|
929
951
|
getIncomeStatements(ticker: string, opts: FinancialOpts): Promise<ApiResponse<IncomeStatementsResponse>>;
|
|
@@ -944,6 +966,7 @@ declare class TnFinancialData {
|
|
|
944
966
|
getPriceSnapshot(ticker: string): Promise<ApiResponse<PriceSnapshotResponse>>;
|
|
945
967
|
getBatchPriceSnapshots(tickers: readonly string[]): Promise<ApiResponse<BatchPriceSnapshotsResponse>>;
|
|
946
968
|
getNews(ticker: string, opts?: NewsOpts): Promise<ApiResponse<NewsResponse>>;
|
|
969
|
+
searchNews(query: string, opts?: NewsSearchOpts): Promise<ApiResponse<NewsSearchResponse>>;
|
|
947
970
|
getDividends(ticker: string, opts?: CorporateActionsOpts): Promise<ApiResponse<DividendsResponse>>;
|
|
948
971
|
getSplits(ticker: string, opts?: CorporateActionsOpts): Promise<ApiResponse<SplitsResponse>>;
|
|
949
972
|
getInsiderTrades(ticker: string, opts?: InsiderTradesOpts): Promise<ApiResponse<InsiderTradesResponse>>;
|
|
@@ -962,4 +985,4 @@ declare class TnFinancialData {
|
|
|
962
985
|
screen(request: ScreenerRequest): Promise<ApiResponse<ScreenerResponse>>;
|
|
963
986
|
}
|
|
964
987
|
|
|
965
|
-
export { type AnalystEstimate, type AnalystEstimatesResponse, type AnalystPriceTarget, ApiError, type ApiResponse, type AvailableTicker, type AvailableTickersResponse, type BalanceSheet, type BalanceSheetsResponse, type BatchFinancialMetricsSnapshotEntry, type BatchFinancialMetricsSnapshotsResponse, type BatchNotFoundEntry, type BatchPriceSnapshotEntry, type BatchPriceSnapshotsResponse, type BatchTickerResolutionResponse, type CashFlowStatement, type CashFlowStatementsResponse, type ClientOptions, type CompanyFacts, type ConsensusSurprise, type CorporateActionsOpts, DEFAULT_API_BASE_URL, type DataAvailability, type DividendEvent, type DividendsResponse, type EarningsCalendarEvent, type EarningsCalendarOpts, type EarningsCalendarResponse, type EarningsOpts, type EarningsResponse, type EarningsRow, type FilingExhibit, type FilingItemSection, type FilingItemsOpts, type FilingItemsResponse, type FilingMetadata, type FilingsOpts, type FilingsResponse, type FinancialMetric, type FinancialMetricsOpts, type FinancialMetricsResponse, type FinancialMetricsSnapshotResponse, type FinancialOpts, type FinancialsResponse, type GeneralOverviewFinancials, type GeneralOverviewNews, type GeneralOverviewOpts, type GeneralOverviewPriceSnapshot, type GeneralOverviewResponse, type GlobalInterestRateObservation, type GlobalInterestRateSeries, type GlobalInterestRatesOpts, type GlobalInterestRatesResponse, type IncomeStatement, type IncomeStatementsResponse, type InsiderTrade, type InsiderTradesOpts, type InsiderTradesResponse, type InstitutionalOwnershipEntry, type InstitutionalOwnershipOpts, type InstitutionalOwnershipResponse, type InvestorPortfolioHolding, type InvestorPortfolioInvestor, type InvestorPortfolioOpts, type InvestorPortfolioResponse, type InvestorPortfolioSummary, type KeyStatistics, type KeyStatisticsResponse, type NewsArticle, type NewsOpts, type NewsResponse, type OptionalFinancialQueryOpts, type PriceBar, type PriceHistoryResponse, type PriceOpts, type PriceSnapshot, type PriceSnapshotResponse, type QuarterlyHighlightsMetric, type QuarterlyHighlightsOpts, type QuarterlyHighlightsPayload, type QuarterlyHighlightsResponse, type RateLimitAnnotatedResponse, type RateLimitInfo, type ReadMetadata, type ReportPeriodFilterOpts, type ScreenerFieldMetadata, type ScreenerFieldsResponse, type ScreenerRequest, type ScreenerResponse, type ScreenerResultRow, type SegmentedRevenueItem, type SegmentedRevenuePeriod, type SegmentedRevenuesOpts, type SegmentedRevenuesResponse, type SnakeCase, type SplitEvent, type SplitsResponse, type TickerResolutionCandidate, type TickerResolutionConfidence, type TickerResolutionIntent, type TickerResolutionMatchKind, type TickerResolutionRelationship, type TickerResolutionResponse, type TickerResolutionStatus, TnFinancialData };
|
|
988
|
+
export { type AnalystEstimate, type AnalystEstimatesResponse, type AnalystPriceTarget, ApiError, type ApiResponse, type AvailableTicker, type AvailableTickersResponse, type BalanceSheet, type BalanceSheetsResponse, type BatchFinancialMetricsSnapshotEntry, type BatchFinancialMetricsSnapshotsResponse, type BatchNotFoundEntry, type BatchPriceSnapshotEntry, type BatchPriceSnapshotsResponse, type BatchTickerResolutionResponse, type CashFlowStatement, type CashFlowStatementsResponse, type ClientOptions, type CompanyFacts, type ConsensusSurprise, type CorporateActionsOpts, DEFAULT_API_BASE_URL, type DataAvailability, type DividendEvent, type DividendsResponse, type EarningsCalendarEvent, type EarningsCalendarOpts, type EarningsCalendarResponse, type EarningsOpts, type EarningsResponse, type EarningsRow, type FilingExhibit, type FilingItemSection, type FilingItemsOpts, type FilingItemsResponse, type FilingMetadata, type FilingsOpts, type FilingsResponse, type FinancialMetric, type FinancialMetricsOpts, type FinancialMetricsResponse, type FinancialMetricsSnapshotResponse, type FinancialOpts, type FinancialsResponse, type GeneralOverviewFinancials, type GeneralOverviewNews, type GeneralOverviewOpts, type GeneralOverviewPriceSnapshot, type GeneralOverviewResponse, type GlobalInterestRateObservation, type GlobalInterestRateSeries, type GlobalInterestRatesOpts, type GlobalInterestRatesResponse, type IncomeStatement, type IncomeStatementsResponse, type InsiderTrade, type InsiderTradesOpts, type InsiderTradesResponse, type InstitutionalOwnershipEntry, type InstitutionalOwnershipOpts, type InstitutionalOwnershipResponse, type InvestorPortfolioHolding, type InvestorPortfolioInvestor, type InvestorPortfolioOpts, type InvestorPortfolioResponse, type InvestorPortfolioSummary, type KeyStatistics, type KeyStatisticsResponse, type NewsArticle, type NewsOpts, type NewsResponse, type NewsSearchArticle, type NewsSearchOpts, type NewsSearchResponse, type OptionalFinancialQueryOpts, type PriceBar, type PriceHistoryResponse, type PriceOpts, type PriceSnapshot, type PriceSnapshotResponse, type QuarterlyHighlightsMetric, type QuarterlyHighlightsOpts, type QuarterlyHighlightsPayload, type QuarterlyHighlightsResponse, type RateLimitAnnotatedResponse, type RateLimitInfo, type ReadMetadata, type ReportPeriodFilterOpts, type ScreenerFieldMetadata, type ScreenerFieldsResponse, type ScreenerRequest, type ScreenerResponse, type ScreenerResultRow, type SegmentedRevenueItem, type SegmentedRevenuePeriod, type SegmentedRevenuesOpts, type SegmentedRevenuesResponse, type SnakeCase, type SplitEvent, type SplitsResponse, type TickerResolutionCandidate, type TickerResolutionConfidence, type TickerResolutionIntent, type TickerResolutionMatchKind, type TickerResolutionRelationship, type TickerResolutionResponse, type TickerResolutionStatus, TnFinancialData };
|
package/dist/client/index.js
CHANGED
|
@@ -200,6 +200,13 @@ var TnFinancialData = class {
|
|
|
200
200
|
if (opts?.endDate) params.set("end_date", opts.endDate);
|
|
201
201
|
return params.toString();
|
|
202
202
|
}
|
|
203
|
+
buildNewsParams(params, opts) {
|
|
204
|
+
if (opts?.limit !== void 0) params.set("limit", String(opts.limit));
|
|
205
|
+
if (opts?.startDate) params.set("start_date", opts.startDate);
|
|
206
|
+
if (opts?.endDate) params.set("end_date", opts.endDate);
|
|
207
|
+
if (opts?.publisher) params.set("publisher", opts.publisher);
|
|
208
|
+
return params.toString();
|
|
209
|
+
}
|
|
203
210
|
buildFilingsParams(ticker, opts) {
|
|
204
211
|
const params = new URLSearchParams({ ticker });
|
|
205
212
|
this.appendLimitParam(params, opts?.limit);
|
|
@@ -315,11 +322,14 @@ var TnFinancialData = class {
|
|
|
315
322
|
}
|
|
316
323
|
async getNews(ticker, opts) {
|
|
317
324
|
const params = new URLSearchParams({ ticker });
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
325
|
+
return this.request(`/news?${this.buildNewsParams(params, opts)}`);
|
|
326
|
+
}
|
|
327
|
+
async searchNews(query, opts) {
|
|
328
|
+
const params = new URLSearchParams({ q: query });
|
|
329
|
+
if (opts?.ticker) params.set("ticker", opts.ticker);
|
|
330
|
+
if (opts?.offset !== void 0) params.set("offset", String(opts.offset));
|
|
331
|
+
if (opts?.provider) params.set("provider", opts.provider);
|
|
332
|
+
return this.request(`/news/search?${this.buildNewsParams(params, opts)}`);
|
|
323
333
|
}
|
|
324
334
|
async getDividends(ticker, opts) {
|
|
325
335
|
return this.request(
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ Auth rule:
|
|
|
13
13
|
- for ambiguous company, brand, or free-form one-company prompts, start with `resolve-ticker`
|
|
14
14
|
- for broad ticker prompts like "what's up with NVDA?", start with `general-overview`
|
|
15
15
|
- for covered recent-news prompts like "show me recent Nvidia news", start with `news`
|
|
16
|
+
- for cross-ticker headline/theme prompts like "search semiconductor tariff news", start with `news-search`
|
|
16
17
|
- for latest-quarter product mix, supplemental KPIs, AWS segment profitability, or Tesla free-cash-flow prompts, start with `quarterly-highlights`
|
|
17
18
|
- for Apple product mix specifically, do not start with `segmented-revenues`; that surface only exposes broad `Product` and `Service` rollups, while `quarterly-highlights` carries `iPhone`, `Mac`, `iPad`, `Wearables, Home and Accessories`, and `Services`
|
|
18
19
|
- for compare prompts, try to use matching command families and comparable periods across the names
|
|
@@ -246,6 +247,19 @@ Meaning:
|
|
|
246
247
|
- use it before web search when the stored dataset can answer
|
|
247
248
|
- optionally pair with `snapshot` or `general-overview` if the user needs price or broader company context
|
|
248
249
|
|
|
250
|
+
News search:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
tn-financial-data query news-search --query "tariff semiconductor" --ticker NVDA --limit 20
|
|
254
|
+
tn-financial-data query news-search --query "AI data center" --provider alpaca --offset 20
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Meaning:
|
|
258
|
+
- article-centric search across the stored covered-news corpus
|
|
259
|
+
- use it for cross-ticker topic scans, theme tracking, or when the user gives keywords instead of one issuer
|
|
260
|
+
- supports optional `--ticker`, `--publisher`, `--provider`, `--start-date`, `--end-date`, `--limit`, and `--offset`
|
|
261
|
+
- search results include provider and relevance metadata; do not assume the first result is the only relevant one when `has_more` is true
|
|
262
|
+
|
|
249
263
|
Insider trades:
|
|
250
264
|
|
|
251
265
|
```bash
|