fmp-node-api 0.0.6 → 0.0.7
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/dist/index.d.mts +126 -15
- package/dist/index.d.ts +126 -15
- package/dist/index.js +146 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +146 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -161,6 +161,29 @@ interface MarketCap {
|
|
|
161
161
|
date: string;
|
|
162
162
|
marketCap: number;
|
|
163
163
|
}
|
|
164
|
+
interface StockRealTimePrice {
|
|
165
|
+
symbol: string;
|
|
166
|
+
price: number;
|
|
167
|
+
}
|
|
168
|
+
interface StockRealTimePriceFull {
|
|
169
|
+
bidSize: number;
|
|
170
|
+
askPrice: number;
|
|
171
|
+
volume: number;
|
|
172
|
+
askSize: number;
|
|
173
|
+
bidPrice: number;
|
|
174
|
+
lastSalePrice: number;
|
|
175
|
+
lastSaleSize: number;
|
|
176
|
+
lastSaleTime: number;
|
|
177
|
+
fmpLast: number;
|
|
178
|
+
lastUpdated: number;
|
|
179
|
+
symbol: string;
|
|
180
|
+
}
|
|
181
|
+
interface StockListResponse<T> {
|
|
182
|
+
stockList: T[];
|
|
183
|
+
}
|
|
184
|
+
interface CompaniesPriceListResponse<T> {
|
|
185
|
+
companiesPriceList: T[];
|
|
186
|
+
}
|
|
164
187
|
|
|
165
188
|
interface FinancialStatementsParams extends SymbolParams, PeriodParams {
|
|
166
189
|
limit?: number;
|
|
@@ -838,6 +861,16 @@ interface EarningsCalendar {
|
|
|
838
861
|
fiscalDateEnding: string;
|
|
839
862
|
updatedFromDate: string;
|
|
840
863
|
}
|
|
864
|
+
interface EarningsConfirmed {
|
|
865
|
+
symbol: string;
|
|
866
|
+
exchange: string;
|
|
867
|
+
time: string;
|
|
868
|
+
when: string;
|
|
869
|
+
date: string;
|
|
870
|
+
publicationDate: string;
|
|
871
|
+
title: string;
|
|
872
|
+
url: string;
|
|
873
|
+
}
|
|
841
874
|
interface DividendsCalendar {
|
|
842
875
|
date: string;
|
|
843
876
|
label: string;
|
|
@@ -1011,6 +1044,7 @@ interface EarningsCallTranscript {
|
|
|
1011
1044
|
date: string;
|
|
1012
1045
|
content: string;
|
|
1013
1046
|
}
|
|
1047
|
+
type CompanyTranscriptData = [number, number, string];
|
|
1014
1048
|
|
|
1015
1049
|
interface SenateHouseTradingParams {
|
|
1016
1050
|
symbol: string;
|
|
@@ -1018,6 +1052,9 @@ interface SenateHouseTradingParams {
|
|
|
1018
1052
|
interface SenateHouseTradingRSSFeedParams {
|
|
1019
1053
|
page: number;
|
|
1020
1054
|
}
|
|
1055
|
+
interface SenateHouseTradingByNameParams {
|
|
1056
|
+
name: string;
|
|
1057
|
+
}
|
|
1021
1058
|
interface SenateTradingResponse {
|
|
1022
1059
|
firstName: string;
|
|
1023
1060
|
lastName: string;
|
|
@@ -1047,6 +1084,23 @@ interface HouseTradingResponse {
|
|
|
1047
1084
|
link: string;
|
|
1048
1085
|
capitalGainsOver200USD: string;
|
|
1049
1086
|
}
|
|
1087
|
+
interface SenateHouseTradingByNameResponse {
|
|
1088
|
+
symbol: string;
|
|
1089
|
+
disclosureDate: string;
|
|
1090
|
+
transactionDate: string;
|
|
1091
|
+
firstName: string;
|
|
1092
|
+
lastName: string;
|
|
1093
|
+
office: string;
|
|
1094
|
+
district: string;
|
|
1095
|
+
owner: string;
|
|
1096
|
+
assetDescription: string;
|
|
1097
|
+
assetType: string;
|
|
1098
|
+
type: string;
|
|
1099
|
+
amount: string;
|
|
1100
|
+
capitalGainsOver200USD: string;
|
|
1101
|
+
comment: string;
|
|
1102
|
+
link: string;
|
|
1103
|
+
}
|
|
1050
1104
|
|
|
1051
1105
|
declare class FMPClient {
|
|
1052
1106
|
private v3Client;
|
|
@@ -1055,7 +1109,18 @@ declare class FMPClient {
|
|
|
1055
1109
|
private apiKey;
|
|
1056
1110
|
constructor(config: FMPConfig);
|
|
1057
1111
|
private createClient;
|
|
1112
|
+
/**
|
|
1113
|
+
* Standard get method - returns raw API response
|
|
1114
|
+
*
|
|
1115
|
+
* For endpoints that return arrays, this will always return an array (possibly empty) for `data` when success is true.
|
|
1116
|
+
* For endpoints that return objects, data is returned as-is.
|
|
1117
|
+
*/
|
|
1058
1118
|
get<T>(endpoint: string, version?: 'v3' | 'v4' | 'stable', params?: Record<string, any>): Promise<APIResponse<T>>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Get method for single-object endpoints - unwraps single-item arrays
|
|
1121
|
+
*
|
|
1122
|
+
* For endpoints that return single objects, this will always return an object (possibly empty) for `data` when success is true.
|
|
1123
|
+
*/
|
|
1059
1124
|
getSingle<T>(endpoint: string, version?: 'v3' | 'v4' | 'stable', params?: Record<string, any>): Promise<APIResponse<T>>;
|
|
1060
1125
|
private getClientForVersion;
|
|
1061
1126
|
}
|
|
@@ -1071,7 +1136,7 @@ declare class StockEndpoints {
|
|
|
1071
1136
|
*/
|
|
1072
1137
|
getQuote({ symbol }: {
|
|
1073
1138
|
symbol: string;
|
|
1074
|
-
}): Promise<APIResponse<StockQuote
|
|
1139
|
+
}): Promise<APIResponse<StockQuote>>;
|
|
1075
1140
|
/**
|
|
1076
1141
|
* Get historical stock prices
|
|
1077
1142
|
* @deprecated Use `fmp.quote.getHistoricalPrice()` instead. This method will be removed in version 0.1.0.
|
|
@@ -1093,7 +1158,7 @@ declare class StockEndpoints {
|
|
|
1093
1158
|
*/
|
|
1094
1159
|
getMarketCap({ symbol }: {
|
|
1095
1160
|
symbol: string;
|
|
1096
|
-
}): Promise<APIResponse<MarketCap
|
|
1161
|
+
}): Promise<APIResponse<MarketCap>>;
|
|
1097
1162
|
/**
|
|
1098
1163
|
* Get stock splits
|
|
1099
1164
|
* https://site.financialmodelingprep.com/developer/docs#splits-historical-splits
|
|
@@ -1112,6 +1177,23 @@ declare class StockEndpoints {
|
|
|
1112
1177
|
getDividendHistory({ symbol, }: {
|
|
1113
1178
|
symbol: string;
|
|
1114
1179
|
}): Promise<APIResponse<StockDividendResponse>>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Get stock real time price
|
|
1182
|
+
* @param symbol - The stock symbol to get the real time price for
|
|
1183
|
+
* @returns The real time price for the stock
|
|
1184
|
+
*/
|
|
1185
|
+
getRealTimePrice({ symbols, }: {
|
|
1186
|
+
symbols: string[];
|
|
1187
|
+
}): Promise<APIResponse<StockRealTimePrice[]>>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Get stock real time price full
|
|
1190
|
+
* https://site.financialmodelingprep.com/developer/docs#real-time-full-price-quote
|
|
1191
|
+
* @param symbols - The stock symbols to get the real time price for
|
|
1192
|
+
* @returns The real time price for the stocks
|
|
1193
|
+
*/
|
|
1194
|
+
getRealTimePriceForMultipleStocks({ symbols, }: {
|
|
1195
|
+
symbols: string[];
|
|
1196
|
+
}): Promise<APIResponse<StockRealTimePriceFull[]>>;
|
|
1115
1197
|
}
|
|
1116
1198
|
|
|
1117
1199
|
declare class FinancialEndpoints {
|
|
@@ -1311,7 +1393,7 @@ declare class ETFEndpoints {
|
|
|
1311
1393
|
* @param symbol - The symbol of the ETF to get the profile for
|
|
1312
1394
|
* @returns The FMP ETF Information endpoint provides basic information about an ETF, such as its ticker symbol, name, expense ratio, and asset under management. For example, an investor may want to compare the expense ratios of different ETFs to find the one that is most cost-effective.
|
|
1313
1395
|
*/
|
|
1314
|
-
getProfile({ symbol }: SymbolParams): Promise<APIResponse<ETFProfile
|
|
1396
|
+
getProfile({ symbol }: SymbolParams): Promise<APIResponse<ETFProfile>>;
|
|
1315
1397
|
/**
|
|
1316
1398
|
* Get ETF sector weighting
|
|
1317
1399
|
* https://site.financialmodelingprep.com/developer/docs#etf-sector-weighting-etf-holdings
|
|
@@ -1463,6 +1545,14 @@ declare class CalendarEndpoints {
|
|
|
1463
1545
|
* @returns The earnings calendar
|
|
1464
1546
|
*/
|
|
1465
1547
|
getEarningsCalendar({ from, to }?: DateRangeParams): Promise<APIResponse<EarningsCalendar[]>>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Get earnings confirmed
|
|
1550
|
+
* https://site.financialmodelingprep.com/developer/docs#earnings-confirmed-earnings
|
|
1551
|
+
* @param from - The start date to get the earnings confirmed for
|
|
1552
|
+
* @param to - The end date to get the earnings confirmed for
|
|
1553
|
+
* @returns The earnings confirmed
|
|
1554
|
+
*/
|
|
1555
|
+
getEarningsConfirmed({ from, to }?: DateRangeParams): Promise<APIResponse<EarningsConfirmed[]>>;
|
|
1466
1556
|
/**
|
|
1467
1557
|
* Get dividends calendar
|
|
1468
1558
|
* https://site.financialmodelingprep.com/developer/docs#dividends-calendar-dividends
|
|
@@ -1506,9 +1596,9 @@ declare class CompanyEndpoints {
|
|
|
1506
1596
|
* @param symbol - The stock symbol to get the profile for
|
|
1507
1597
|
* @returns Get a comprehensive overview of a company with our Company Profile endpoint. This endpoint provides key information such as price, beta, market capitalization, description, headquarters, and more.
|
|
1508
1598
|
*/
|
|
1509
|
-
getCompanyProfile({ symbol
|
|
1599
|
+
getCompanyProfile({ symbol }: {
|
|
1510
1600
|
symbol: string;
|
|
1511
|
-
}): Promise<APIResponse<CompanyProfile
|
|
1601
|
+
}): Promise<APIResponse<CompanyProfile>>;
|
|
1512
1602
|
/**
|
|
1513
1603
|
* Get executive compensation
|
|
1514
1604
|
* https://site.financialmodelingprep.com/developer/docs#executive-compensation-company-information
|
|
@@ -1517,16 +1607,16 @@ declare class CompanyEndpoints {
|
|
|
1517
1607
|
*/
|
|
1518
1608
|
getExecutiveCompensation({ symbol, }: {
|
|
1519
1609
|
symbol: string;
|
|
1520
|
-
}): Promise<APIResponse<ExecutiveCompensation[]
|
|
1610
|
+
}): Promise<APIResponse<ExecutiveCompensation[]>>;
|
|
1521
1611
|
/**
|
|
1522
1612
|
* Get company notes
|
|
1523
1613
|
* https://site.financialmodelingprep.com/developer/docs#company-notes-company-information
|
|
1524
1614
|
* @param symbol - The stock symbol to get the notes for
|
|
1525
1615
|
* @returns Stay up-to-date on a company's financial condition, operations, and risks with our Company Notes endpoint. This endpoint provides information about notes reported by a company in their financial statements.
|
|
1526
1616
|
*/
|
|
1527
|
-
getCompanyNotes({ symbol
|
|
1617
|
+
getCompanyNotes({ symbol }: {
|
|
1528
1618
|
symbol: string;
|
|
1529
|
-
}): Promise<APIResponse<CompanyNotes[]
|
|
1619
|
+
}): Promise<APIResponse<CompanyNotes[]>>;
|
|
1530
1620
|
/**
|
|
1531
1621
|
* Get historical employee count
|
|
1532
1622
|
* https://site.financialmodelingprep.com/developer/docs#historical-employee-company-information
|
|
@@ -1535,7 +1625,7 @@ declare class CompanyEndpoints {
|
|
|
1535
1625
|
*/
|
|
1536
1626
|
getHistoricalEmployeeCount({ symbol, }: {
|
|
1537
1627
|
symbol: string;
|
|
1538
|
-
}): Promise<APIResponse<HistoricalEmployeeCount[]
|
|
1628
|
+
}): Promise<APIResponse<HistoricalEmployeeCount[]>>;
|
|
1539
1629
|
/**
|
|
1540
1630
|
* Get shares float
|
|
1541
1631
|
* https://site.financialmodelingprep.com/developer/docs#company-share-float-share-float
|
|
@@ -1544,7 +1634,7 @@ declare class CompanyEndpoints {
|
|
|
1544
1634
|
*/
|
|
1545
1635
|
getSharesFloat({ symbol }: {
|
|
1546
1636
|
symbol: string;
|
|
1547
|
-
}): Promise<APIResponse<SharesFloat
|
|
1637
|
+
}): Promise<APIResponse<SharesFloat>>;
|
|
1548
1638
|
/**
|
|
1549
1639
|
* Get historical shares float
|
|
1550
1640
|
* https://site.financialmodelingprep.com/developer/docs#company-historical-share-float
|
|
@@ -1553,7 +1643,7 @@ declare class CompanyEndpoints {
|
|
|
1553
1643
|
*/
|
|
1554
1644
|
getHistoricalSharesFloat({ symbol, }: {
|
|
1555
1645
|
symbol: string;
|
|
1556
|
-
}): Promise<APIResponse<HistoricalSharesFloat[]
|
|
1646
|
+
}): Promise<APIResponse<HistoricalSharesFloat[]>>;
|
|
1557
1647
|
/**
|
|
1558
1648
|
* Get earnings call transcript
|
|
1559
1649
|
* https://site.financialmodelingprep.com/developer/docs#earnings-transcript-earnings-transcripts
|
|
@@ -1566,7 +1656,16 @@ declare class CompanyEndpoints {
|
|
|
1566
1656
|
symbol: string;
|
|
1567
1657
|
year: number;
|
|
1568
1658
|
quarter: number;
|
|
1569
|
-
}): Promise<APIResponse<EarningsCallTranscript[]
|
|
1659
|
+
}): Promise<APIResponse<EarningsCallTranscript[]>>;
|
|
1660
|
+
/**
|
|
1661
|
+
* Get company transcript dates
|
|
1662
|
+
* https://site.financialmodelingprep.com/developer/docs#transcript-dates-earnings-transcripts
|
|
1663
|
+
* @param symbol - The stock symbol to get the transcript data for
|
|
1664
|
+
* @returns The FMP Company Transcript Data endpoint provides the transcript data for a company's earnings call.
|
|
1665
|
+
*/
|
|
1666
|
+
getCompanyTranscriptData({ symbol, }: {
|
|
1667
|
+
symbol: string;
|
|
1668
|
+
}): Promise<APIResponse<CompanyTranscriptData[]>>;
|
|
1570
1669
|
}
|
|
1571
1670
|
|
|
1572
1671
|
declare class QuoteEndpoints {
|
|
@@ -1577,7 +1676,7 @@ declare class QuoteEndpoints {
|
|
|
1577
1676
|
* @param params - Parameters for the quote request
|
|
1578
1677
|
* @returns Quote data for the specified asset
|
|
1579
1678
|
*/
|
|
1580
|
-
getQuote(params: QuoteParams): Promise<APIResponse<Quote
|
|
1679
|
+
getQuote(params: QuoteParams): Promise<APIResponse<Quote>>;
|
|
1581
1680
|
/**
|
|
1582
1681
|
* Get historical prices for any asset type
|
|
1583
1682
|
* @param params - Parameters for the historical price request
|
|
@@ -1614,6 +1713,12 @@ declare class SenateHouseEndpoints {
|
|
|
1614
1713
|
* @returns Senate trading RSS feed
|
|
1615
1714
|
*/
|
|
1616
1715
|
getSenateTradingRSSFeed(params: SenateHouseTradingRSSFeedParams): Promise<APIResponse<SenateTradingResponse[]>>;
|
|
1716
|
+
/** Get Senate trades by name
|
|
1717
|
+
* https://site.financialmodelingprep.com/developer/docs/stable#senate-trading-by-name
|
|
1718
|
+
* @param name - The name of the senator to get the trades for
|
|
1719
|
+
* @returns Senate trades by name
|
|
1720
|
+
*/
|
|
1721
|
+
getSenateTradingByName(params: SenateHouseTradingByNameParams): Promise<APIResponse<SenateHouseTradingByNameResponse[]>>;
|
|
1617
1722
|
/**
|
|
1618
1723
|
* Get house trading data only
|
|
1619
1724
|
* https://site.financialmodelingprep.com/developer/docs#house-disclosure
|
|
@@ -1626,7 +1731,13 @@ declare class SenateHouseEndpoints {
|
|
|
1626
1731
|
* @param page - The page number to get
|
|
1627
1732
|
* @returns House trading RSS feed
|
|
1628
1733
|
*/
|
|
1629
|
-
getHouseTradingRSSFeed(params: SenateHouseTradingRSSFeedParams): Promise<APIResponse<
|
|
1734
|
+
getHouseTradingRSSFeed(params: SenateHouseTradingRSSFeedParams): Promise<APIResponse<HouseTradingResponse[]>>;
|
|
1735
|
+
/** Get house trading by name
|
|
1736
|
+
* https://site.financialmodelingprep.com/developer/docs/stable#house-trading-by-name
|
|
1737
|
+
* @param name - The name of the representative to get the trades for
|
|
1738
|
+
* @returns House trading by name
|
|
1739
|
+
*/
|
|
1740
|
+
getHouseTradingByName(params: SenateHouseTradingByNameParams): Promise<APIResponse<SenateHouseTradingByNameResponse[]>>;
|
|
1630
1741
|
}
|
|
1631
1742
|
|
|
1632
1743
|
/**
|
|
@@ -1796,4 +1907,4 @@ declare const HTTP_STATUS: {
|
|
|
1796
1907
|
readonly INTERNAL_SERVER_ERROR: 500;
|
|
1797
1908
|
};
|
|
1798
1909
|
|
|
1799
|
-
export { type APIResponse, type AvailableIndexesList, type BalanceSheet, type BalanceSheetGrowth, COUNTRIES, CalendarEndpoints, type CashFlowStatement, type CashflowGrowth, CompanyEndpoints, type CompanyNotes, type CompanyProfile, CryptoEndpoints, type CryptoHistoricalParams, type CryptoList, type CryptoListParams, type CryptoQuote, DEFAULT_LIMIT, DEFAULT_TIMEOUT, type DateRangeParams, type DividendsCalendar, ERROR_MESSAGES, type ETFCountryWeighting, ETFEndpoints, type ETFHolder, type ETFHolding, type ETFHoldingDates, type ETFList, type ETFProfile, type ETFStockExposure, type ETFWeighting, EXCHANGES, type EarningsCalendar, type EarningsCallTranscript, type EarningsHistorical, type EarningsSurprises, EconomicEndpoints, type EconomicIndicator, type EconomicIndicatorName, type EconomicIndicatorParams, type EconomicsCalendar, type EnterpriseValue, type ErrorResponse, Exchange, type ExecutiveCompensation, FMP, FMPClient, type FMPConfig, FinancialEndpoints, type FinancialGrowth, type FinancialRatios, type FinancialStatementBase, type FinancialStatementsParams, ForexEndpoints, type ForexHistoricalParams, type ForexList, type ForexQuote, type GrowthStatementBase, HTTP_STATUS, type HistoricalEmployeeCount, type HistoricalPriceData, type HistoricalPriceParams, type HistoricalPriceResponse, type HistoricalSharesFloat, type HouseTradingResponse, type IPOCalendar, type IncomeGrowth, type IncomeStatement, type IntradayParams, type KeyMetrics, ListEndpoints, MAX_LIMIT, type MarketCap, MarketEndpoints, type MarketHoliday, type MarketHours, type MarketIndex, type MarketPerformance, type MarketSectorPerformance, MutualFundEndpoints, type MutualFundHolding, type MutualFundQuote, PERIODS, type PaginationParams, Period, type PeriodParams, type QueryParams, type Quote, QuoteEndpoints, type QuoteParams, SECTORS, SenateHouseEndpoints, type SenateHouseTradingParams, type SenateHouseTradingRSSFeedParams, type SenateTradingResponse, type SharesFloat, type SplitsCalendar, type StockDividend, type StockDividendResponse, StockEndpoints, type StockList, type StockQuote, type StockSplit, type StockSplitResponse, type SuccessResponse, type SymbolParams, type TreasuryRate, formatCurrency, formatDate, formatLargeNumber, formatNumber, formatPercentage, formatReadableDate, formatTimestamp, formatVolume, validateApiKey, validateDate, validateLimit, validatePage, validatePeriod, validateSymbol };
|
|
1910
|
+
export { type APIResponse, type AvailableIndexesList, type BalanceSheet, type BalanceSheetGrowth, COUNTRIES, CalendarEndpoints, type CashFlowStatement, type CashflowGrowth, type CompaniesPriceListResponse, CompanyEndpoints, type CompanyNotes, type CompanyProfile, type CompanyTranscriptData, CryptoEndpoints, type CryptoHistoricalParams, type CryptoList, type CryptoListParams, type CryptoQuote, DEFAULT_LIMIT, DEFAULT_TIMEOUT, type DateRangeParams, type DividendsCalendar, ERROR_MESSAGES, type ETFCountryWeighting, ETFEndpoints, type ETFHolder, type ETFHolding, type ETFHoldingDates, type ETFList, type ETFProfile, type ETFStockExposure, type ETFWeighting, EXCHANGES, type EarningsCalendar, type EarningsCallTranscript, type EarningsConfirmed, type EarningsHistorical, type EarningsSurprises, EconomicEndpoints, type EconomicIndicator, type EconomicIndicatorName, type EconomicIndicatorParams, type EconomicsCalendar, type EnterpriseValue, type ErrorResponse, Exchange, type ExecutiveCompensation, FMP, FMPClient, type FMPConfig, FinancialEndpoints, type FinancialGrowth, type FinancialRatios, type FinancialStatementBase, type FinancialStatementsParams, ForexEndpoints, type ForexHistoricalParams, type ForexList, type ForexQuote, type GrowthStatementBase, HTTP_STATUS, type HistoricalEmployeeCount, type HistoricalPriceData, type HistoricalPriceParams, type HistoricalPriceResponse, type HistoricalSharesFloat, type HouseTradingResponse, type IPOCalendar, type IncomeGrowth, type IncomeStatement, type IntradayParams, type KeyMetrics, ListEndpoints, MAX_LIMIT, type MarketCap, MarketEndpoints, type MarketHoliday, type MarketHours, type MarketIndex, type MarketPerformance, type MarketSectorPerformance, MutualFundEndpoints, type MutualFundHolding, type MutualFundQuote, PERIODS, type PaginationParams, Period, type PeriodParams, type QueryParams, type Quote, QuoteEndpoints, type QuoteParams, SECTORS, SenateHouseEndpoints, type SenateHouseTradingByNameParams, type SenateHouseTradingByNameResponse, type SenateHouseTradingParams, type SenateHouseTradingRSSFeedParams, type SenateTradingResponse, type SharesFloat, type SplitsCalendar, type StockDividend, type StockDividendResponse, StockEndpoints, type StockList, type StockListResponse, type StockQuote, type StockRealTimePrice, type StockRealTimePriceFull, type StockSplit, type StockSplitResponse, type SuccessResponse, type SymbolParams, type TreasuryRate, formatCurrency, formatDate, formatLargeNumber, formatNumber, formatPercentage, formatReadableDate, formatTimestamp, formatVolume, validateApiKey, validateDate, validateLimit, validatePage, validatePeriod, validateSymbol };
|
package/dist/index.d.ts
CHANGED
|
@@ -161,6 +161,29 @@ interface MarketCap {
|
|
|
161
161
|
date: string;
|
|
162
162
|
marketCap: number;
|
|
163
163
|
}
|
|
164
|
+
interface StockRealTimePrice {
|
|
165
|
+
symbol: string;
|
|
166
|
+
price: number;
|
|
167
|
+
}
|
|
168
|
+
interface StockRealTimePriceFull {
|
|
169
|
+
bidSize: number;
|
|
170
|
+
askPrice: number;
|
|
171
|
+
volume: number;
|
|
172
|
+
askSize: number;
|
|
173
|
+
bidPrice: number;
|
|
174
|
+
lastSalePrice: number;
|
|
175
|
+
lastSaleSize: number;
|
|
176
|
+
lastSaleTime: number;
|
|
177
|
+
fmpLast: number;
|
|
178
|
+
lastUpdated: number;
|
|
179
|
+
symbol: string;
|
|
180
|
+
}
|
|
181
|
+
interface StockListResponse<T> {
|
|
182
|
+
stockList: T[];
|
|
183
|
+
}
|
|
184
|
+
interface CompaniesPriceListResponse<T> {
|
|
185
|
+
companiesPriceList: T[];
|
|
186
|
+
}
|
|
164
187
|
|
|
165
188
|
interface FinancialStatementsParams extends SymbolParams, PeriodParams {
|
|
166
189
|
limit?: number;
|
|
@@ -838,6 +861,16 @@ interface EarningsCalendar {
|
|
|
838
861
|
fiscalDateEnding: string;
|
|
839
862
|
updatedFromDate: string;
|
|
840
863
|
}
|
|
864
|
+
interface EarningsConfirmed {
|
|
865
|
+
symbol: string;
|
|
866
|
+
exchange: string;
|
|
867
|
+
time: string;
|
|
868
|
+
when: string;
|
|
869
|
+
date: string;
|
|
870
|
+
publicationDate: string;
|
|
871
|
+
title: string;
|
|
872
|
+
url: string;
|
|
873
|
+
}
|
|
841
874
|
interface DividendsCalendar {
|
|
842
875
|
date: string;
|
|
843
876
|
label: string;
|
|
@@ -1011,6 +1044,7 @@ interface EarningsCallTranscript {
|
|
|
1011
1044
|
date: string;
|
|
1012
1045
|
content: string;
|
|
1013
1046
|
}
|
|
1047
|
+
type CompanyTranscriptData = [number, number, string];
|
|
1014
1048
|
|
|
1015
1049
|
interface SenateHouseTradingParams {
|
|
1016
1050
|
symbol: string;
|
|
@@ -1018,6 +1052,9 @@ interface SenateHouseTradingParams {
|
|
|
1018
1052
|
interface SenateHouseTradingRSSFeedParams {
|
|
1019
1053
|
page: number;
|
|
1020
1054
|
}
|
|
1055
|
+
interface SenateHouseTradingByNameParams {
|
|
1056
|
+
name: string;
|
|
1057
|
+
}
|
|
1021
1058
|
interface SenateTradingResponse {
|
|
1022
1059
|
firstName: string;
|
|
1023
1060
|
lastName: string;
|
|
@@ -1047,6 +1084,23 @@ interface HouseTradingResponse {
|
|
|
1047
1084
|
link: string;
|
|
1048
1085
|
capitalGainsOver200USD: string;
|
|
1049
1086
|
}
|
|
1087
|
+
interface SenateHouseTradingByNameResponse {
|
|
1088
|
+
symbol: string;
|
|
1089
|
+
disclosureDate: string;
|
|
1090
|
+
transactionDate: string;
|
|
1091
|
+
firstName: string;
|
|
1092
|
+
lastName: string;
|
|
1093
|
+
office: string;
|
|
1094
|
+
district: string;
|
|
1095
|
+
owner: string;
|
|
1096
|
+
assetDescription: string;
|
|
1097
|
+
assetType: string;
|
|
1098
|
+
type: string;
|
|
1099
|
+
amount: string;
|
|
1100
|
+
capitalGainsOver200USD: string;
|
|
1101
|
+
comment: string;
|
|
1102
|
+
link: string;
|
|
1103
|
+
}
|
|
1050
1104
|
|
|
1051
1105
|
declare class FMPClient {
|
|
1052
1106
|
private v3Client;
|
|
@@ -1055,7 +1109,18 @@ declare class FMPClient {
|
|
|
1055
1109
|
private apiKey;
|
|
1056
1110
|
constructor(config: FMPConfig);
|
|
1057
1111
|
private createClient;
|
|
1112
|
+
/**
|
|
1113
|
+
* Standard get method - returns raw API response
|
|
1114
|
+
*
|
|
1115
|
+
* For endpoints that return arrays, this will always return an array (possibly empty) for `data` when success is true.
|
|
1116
|
+
* For endpoints that return objects, data is returned as-is.
|
|
1117
|
+
*/
|
|
1058
1118
|
get<T>(endpoint: string, version?: 'v3' | 'v4' | 'stable', params?: Record<string, any>): Promise<APIResponse<T>>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Get method for single-object endpoints - unwraps single-item arrays
|
|
1121
|
+
*
|
|
1122
|
+
* For endpoints that return single objects, this will always return an object (possibly empty) for `data` when success is true.
|
|
1123
|
+
*/
|
|
1059
1124
|
getSingle<T>(endpoint: string, version?: 'v3' | 'v4' | 'stable', params?: Record<string, any>): Promise<APIResponse<T>>;
|
|
1060
1125
|
private getClientForVersion;
|
|
1061
1126
|
}
|
|
@@ -1071,7 +1136,7 @@ declare class StockEndpoints {
|
|
|
1071
1136
|
*/
|
|
1072
1137
|
getQuote({ symbol }: {
|
|
1073
1138
|
symbol: string;
|
|
1074
|
-
}): Promise<APIResponse<StockQuote
|
|
1139
|
+
}): Promise<APIResponse<StockQuote>>;
|
|
1075
1140
|
/**
|
|
1076
1141
|
* Get historical stock prices
|
|
1077
1142
|
* @deprecated Use `fmp.quote.getHistoricalPrice()` instead. This method will be removed in version 0.1.0.
|
|
@@ -1093,7 +1158,7 @@ declare class StockEndpoints {
|
|
|
1093
1158
|
*/
|
|
1094
1159
|
getMarketCap({ symbol }: {
|
|
1095
1160
|
symbol: string;
|
|
1096
|
-
}): Promise<APIResponse<MarketCap
|
|
1161
|
+
}): Promise<APIResponse<MarketCap>>;
|
|
1097
1162
|
/**
|
|
1098
1163
|
* Get stock splits
|
|
1099
1164
|
* https://site.financialmodelingprep.com/developer/docs#splits-historical-splits
|
|
@@ -1112,6 +1177,23 @@ declare class StockEndpoints {
|
|
|
1112
1177
|
getDividendHistory({ symbol, }: {
|
|
1113
1178
|
symbol: string;
|
|
1114
1179
|
}): Promise<APIResponse<StockDividendResponse>>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Get stock real time price
|
|
1182
|
+
* @param symbol - The stock symbol to get the real time price for
|
|
1183
|
+
* @returns The real time price for the stock
|
|
1184
|
+
*/
|
|
1185
|
+
getRealTimePrice({ symbols, }: {
|
|
1186
|
+
symbols: string[];
|
|
1187
|
+
}): Promise<APIResponse<StockRealTimePrice[]>>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Get stock real time price full
|
|
1190
|
+
* https://site.financialmodelingprep.com/developer/docs#real-time-full-price-quote
|
|
1191
|
+
* @param symbols - The stock symbols to get the real time price for
|
|
1192
|
+
* @returns The real time price for the stocks
|
|
1193
|
+
*/
|
|
1194
|
+
getRealTimePriceForMultipleStocks({ symbols, }: {
|
|
1195
|
+
symbols: string[];
|
|
1196
|
+
}): Promise<APIResponse<StockRealTimePriceFull[]>>;
|
|
1115
1197
|
}
|
|
1116
1198
|
|
|
1117
1199
|
declare class FinancialEndpoints {
|
|
@@ -1311,7 +1393,7 @@ declare class ETFEndpoints {
|
|
|
1311
1393
|
* @param symbol - The symbol of the ETF to get the profile for
|
|
1312
1394
|
* @returns The FMP ETF Information endpoint provides basic information about an ETF, such as its ticker symbol, name, expense ratio, and asset under management. For example, an investor may want to compare the expense ratios of different ETFs to find the one that is most cost-effective.
|
|
1313
1395
|
*/
|
|
1314
|
-
getProfile({ symbol }: SymbolParams): Promise<APIResponse<ETFProfile
|
|
1396
|
+
getProfile({ symbol }: SymbolParams): Promise<APIResponse<ETFProfile>>;
|
|
1315
1397
|
/**
|
|
1316
1398
|
* Get ETF sector weighting
|
|
1317
1399
|
* https://site.financialmodelingprep.com/developer/docs#etf-sector-weighting-etf-holdings
|
|
@@ -1463,6 +1545,14 @@ declare class CalendarEndpoints {
|
|
|
1463
1545
|
* @returns The earnings calendar
|
|
1464
1546
|
*/
|
|
1465
1547
|
getEarningsCalendar({ from, to }?: DateRangeParams): Promise<APIResponse<EarningsCalendar[]>>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Get earnings confirmed
|
|
1550
|
+
* https://site.financialmodelingprep.com/developer/docs#earnings-confirmed-earnings
|
|
1551
|
+
* @param from - The start date to get the earnings confirmed for
|
|
1552
|
+
* @param to - The end date to get the earnings confirmed for
|
|
1553
|
+
* @returns The earnings confirmed
|
|
1554
|
+
*/
|
|
1555
|
+
getEarningsConfirmed({ from, to }?: DateRangeParams): Promise<APIResponse<EarningsConfirmed[]>>;
|
|
1466
1556
|
/**
|
|
1467
1557
|
* Get dividends calendar
|
|
1468
1558
|
* https://site.financialmodelingprep.com/developer/docs#dividends-calendar-dividends
|
|
@@ -1506,9 +1596,9 @@ declare class CompanyEndpoints {
|
|
|
1506
1596
|
* @param symbol - The stock symbol to get the profile for
|
|
1507
1597
|
* @returns Get a comprehensive overview of a company with our Company Profile endpoint. This endpoint provides key information such as price, beta, market capitalization, description, headquarters, and more.
|
|
1508
1598
|
*/
|
|
1509
|
-
getCompanyProfile({ symbol
|
|
1599
|
+
getCompanyProfile({ symbol }: {
|
|
1510
1600
|
symbol: string;
|
|
1511
|
-
}): Promise<APIResponse<CompanyProfile
|
|
1601
|
+
}): Promise<APIResponse<CompanyProfile>>;
|
|
1512
1602
|
/**
|
|
1513
1603
|
* Get executive compensation
|
|
1514
1604
|
* https://site.financialmodelingprep.com/developer/docs#executive-compensation-company-information
|
|
@@ -1517,16 +1607,16 @@ declare class CompanyEndpoints {
|
|
|
1517
1607
|
*/
|
|
1518
1608
|
getExecutiveCompensation({ symbol, }: {
|
|
1519
1609
|
symbol: string;
|
|
1520
|
-
}): Promise<APIResponse<ExecutiveCompensation[]
|
|
1610
|
+
}): Promise<APIResponse<ExecutiveCompensation[]>>;
|
|
1521
1611
|
/**
|
|
1522
1612
|
* Get company notes
|
|
1523
1613
|
* https://site.financialmodelingprep.com/developer/docs#company-notes-company-information
|
|
1524
1614
|
* @param symbol - The stock symbol to get the notes for
|
|
1525
1615
|
* @returns Stay up-to-date on a company's financial condition, operations, and risks with our Company Notes endpoint. This endpoint provides information about notes reported by a company in their financial statements.
|
|
1526
1616
|
*/
|
|
1527
|
-
getCompanyNotes({ symbol
|
|
1617
|
+
getCompanyNotes({ symbol }: {
|
|
1528
1618
|
symbol: string;
|
|
1529
|
-
}): Promise<APIResponse<CompanyNotes[]
|
|
1619
|
+
}): Promise<APIResponse<CompanyNotes[]>>;
|
|
1530
1620
|
/**
|
|
1531
1621
|
* Get historical employee count
|
|
1532
1622
|
* https://site.financialmodelingprep.com/developer/docs#historical-employee-company-information
|
|
@@ -1535,7 +1625,7 @@ declare class CompanyEndpoints {
|
|
|
1535
1625
|
*/
|
|
1536
1626
|
getHistoricalEmployeeCount({ symbol, }: {
|
|
1537
1627
|
symbol: string;
|
|
1538
|
-
}): Promise<APIResponse<HistoricalEmployeeCount[]
|
|
1628
|
+
}): Promise<APIResponse<HistoricalEmployeeCount[]>>;
|
|
1539
1629
|
/**
|
|
1540
1630
|
* Get shares float
|
|
1541
1631
|
* https://site.financialmodelingprep.com/developer/docs#company-share-float-share-float
|
|
@@ -1544,7 +1634,7 @@ declare class CompanyEndpoints {
|
|
|
1544
1634
|
*/
|
|
1545
1635
|
getSharesFloat({ symbol }: {
|
|
1546
1636
|
symbol: string;
|
|
1547
|
-
}): Promise<APIResponse<SharesFloat
|
|
1637
|
+
}): Promise<APIResponse<SharesFloat>>;
|
|
1548
1638
|
/**
|
|
1549
1639
|
* Get historical shares float
|
|
1550
1640
|
* https://site.financialmodelingprep.com/developer/docs#company-historical-share-float
|
|
@@ -1553,7 +1643,7 @@ declare class CompanyEndpoints {
|
|
|
1553
1643
|
*/
|
|
1554
1644
|
getHistoricalSharesFloat({ symbol, }: {
|
|
1555
1645
|
symbol: string;
|
|
1556
|
-
}): Promise<APIResponse<HistoricalSharesFloat[]
|
|
1646
|
+
}): Promise<APIResponse<HistoricalSharesFloat[]>>;
|
|
1557
1647
|
/**
|
|
1558
1648
|
* Get earnings call transcript
|
|
1559
1649
|
* https://site.financialmodelingprep.com/developer/docs#earnings-transcript-earnings-transcripts
|
|
@@ -1566,7 +1656,16 @@ declare class CompanyEndpoints {
|
|
|
1566
1656
|
symbol: string;
|
|
1567
1657
|
year: number;
|
|
1568
1658
|
quarter: number;
|
|
1569
|
-
}): Promise<APIResponse<EarningsCallTranscript[]
|
|
1659
|
+
}): Promise<APIResponse<EarningsCallTranscript[]>>;
|
|
1660
|
+
/**
|
|
1661
|
+
* Get company transcript dates
|
|
1662
|
+
* https://site.financialmodelingprep.com/developer/docs#transcript-dates-earnings-transcripts
|
|
1663
|
+
* @param symbol - The stock symbol to get the transcript data for
|
|
1664
|
+
* @returns The FMP Company Transcript Data endpoint provides the transcript data for a company's earnings call.
|
|
1665
|
+
*/
|
|
1666
|
+
getCompanyTranscriptData({ symbol, }: {
|
|
1667
|
+
symbol: string;
|
|
1668
|
+
}): Promise<APIResponse<CompanyTranscriptData[]>>;
|
|
1570
1669
|
}
|
|
1571
1670
|
|
|
1572
1671
|
declare class QuoteEndpoints {
|
|
@@ -1577,7 +1676,7 @@ declare class QuoteEndpoints {
|
|
|
1577
1676
|
* @param params - Parameters for the quote request
|
|
1578
1677
|
* @returns Quote data for the specified asset
|
|
1579
1678
|
*/
|
|
1580
|
-
getQuote(params: QuoteParams): Promise<APIResponse<Quote
|
|
1679
|
+
getQuote(params: QuoteParams): Promise<APIResponse<Quote>>;
|
|
1581
1680
|
/**
|
|
1582
1681
|
* Get historical prices for any asset type
|
|
1583
1682
|
* @param params - Parameters for the historical price request
|
|
@@ -1614,6 +1713,12 @@ declare class SenateHouseEndpoints {
|
|
|
1614
1713
|
* @returns Senate trading RSS feed
|
|
1615
1714
|
*/
|
|
1616
1715
|
getSenateTradingRSSFeed(params: SenateHouseTradingRSSFeedParams): Promise<APIResponse<SenateTradingResponse[]>>;
|
|
1716
|
+
/** Get Senate trades by name
|
|
1717
|
+
* https://site.financialmodelingprep.com/developer/docs/stable#senate-trading-by-name
|
|
1718
|
+
* @param name - The name of the senator to get the trades for
|
|
1719
|
+
* @returns Senate trades by name
|
|
1720
|
+
*/
|
|
1721
|
+
getSenateTradingByName(params: SenateHouseTradingByNameParams): Promise<APIResponse<SenateHouseTradingByNameResponse[]>>;
|
|
1617
1722
|
/**
|
|
1618
1723
|
* Get house trading data only
|
|
1619
1724
|
* https://site.financialmodelingprep.com/developer/docs#house-disclosure
|
|
@@ -1626,7 +1731,13 @@ declare class SenateHouseEndpoints {
|
|
|
1626
1731
|
* @param page - The page number to get
|
|
1627
1732
|
* @returns House trading RSS feed
|
|
1628
1733
|
*/
|
|
1629
|
-
getHouseTradingRSSFeed(params: SenateHouseTradingRSSFeedParams): Promise<APIResponse<
|
|
1734
|
+
getHouseTradingRSSFeed(params: SenateHouseTradingRSSFeedParams): Promise<APIResponse<HouseTradingResponse[]>>;
|
|
1735
|
+
/** Get house trading by name
|
|
1736
|
+
* https://site.financialmodelingprep.com/developer/docs/stable#house-trading-by-name
|
|
1737
|
+
* @param name - The name of the representative to get the trades for
|
|
1738
|
+
* @returns House trading by name
|
|
1739
|
+
*/
|
|
1740
|
+
getHouseTradingByName(params: SenateHouseTradingByNameParams): Promise<APIResponse<SenateHouseTradingByNameResponse[]>>;
|
|
1630
1741
|
}
|
|
1631
1742
|
|
|
1632
1743
|
/**
|
|
@@ -1796,4 +1907,4 @@ declare const HTTP_STATUS: {
|
|
|
1796
1907
|
readonly INTERNAL_SERVER_ERROR: 500;
|
|
1797
1908
|
};
|
|
1798
1909
|
|
|
1799
|
-
export { type APIResponse, type AvailableIndexesList, type BalanceSheet, type BalanceSheetGrowth, COUNTRIES, CalendarEndpoints, type CashFlowStatement, type CashflowGrowth, CompanyEndpoints, type CompanyNotes, type CompanyProfile, CryptoEndpoints, type CryptoHistoricalParams, type CryptoList, type CryptoListParams, type CryptoQuote, DEFAULT_LIMIT, DEFAULT_TIMEOUT, type DateRangeParams, type DividendsCalendar, ERROR_MESSAGES, type ETFCountryWeighting, ETFEndpoints, type ETFHolder, type ETFHolding, type ETFHoldingDates, type ETFList, type ETFProfile, type ETFStockExposure, type ETFWeighting, EXCHANGES, type EarningsCalendar, type EarningsCallTranscript, type EarningsHistorical, type EarningsSurprises, EconomicEndpoints, type EconomicIndicator, type EconomicIndicatorName, type EconomicIndicatorParams, type EconomicsCalendar, type EnterpriseValue, type ErrorResponse, Exchange, type ExecutiveCompensation, FMP, FMPClient, type FMPConfig, FinancialEndpoints, type FinancialGrowth, type FinancialRatios, type FinancialStatementBase, type FinancialStatementsParams, ForexEndpoints, type ForexHistoricalParams, type ForexList, type ForexQuote, type GrowthStatementBase, HTTP_STATUS, type HistoricalEmployeeCount, type HistoricalPriceData, type HistoricalPriceParams, type HistoricalPriceResponse, type HistoricalSharesFloat, type HouseTradingResponse, type IPOCalendar, type IncomeGrowth, type IncomeStatement, type IntradayParams, type KeyMetrics, ListEndpoints, MAX_LIMIT, type MarketCap, MarketEndpoints, type MarketHoliday, type MarketHours, type MarketIndex, type MarketPerformance, type MarketSectorPerformance, MutualFundEndpoints, type MutualFundHolding, type MutualFundQuote, PERIODS, type PaginationParams, Period, type PeriodParams, type QueryParams, type Quote, QuoteEndpoints, type QuoteParams, SECTORS, SenateHouseEndpoints, type SenateHouseTradingParams, type SenateHouseTradingRSSFeedParams, type SenateTradingResponse, type SharesFloat, type SplitsCalendar, type StockDividend, type StockDividendResponse, StockEndpoints, type StockList, type StockQuote, type StockSplit, type StockSplitResponse, type SuccessResponse, type SymbolParams, type TreasuryRate, formatCurrency, formatDate, formatLargeNumber, formatNumber, formatPercentage, formatReadableDate, formatTimestamp, formatVolume, validateApiKey, validateDate, validateLimit, validatePage, validatePeriod, validateSymbol };
|
|
1910
|
+
export { type APIResponse, type AvailableIndexesList, type BalanceSheet, type BalanceSheetGrowth, COUNTRIES, CalendarEndpoints, type CashFlowStatement, type CashflowGrowth, type CompaniesPriceListResponse, CompanyEndpoints, type CompanyNotes, type CompanyProfile, type CompanyTranscriptData, CryptoEndpoints, type CryptoHistoricalParams, type CryptoList, type CryptoListParams, type CryptoQuote, DEFAULT_LIMIT, DEFAULT_TIMEOUT, type DateRangeParams, type DividendsCalendar, ERROR_MESSAGES, type ETFCountryWeighting, ETFEndpoints, type ETFHolder, type ETFHolding, type ETFHoldingDates, type ETFList, type ETFProfile, type ETFStockExposure, type ETFWeighting, EXCHANGES, type EarningsCalendar, type EarningsCallTranscript, type EarningsConfirmed, type EarningsHistorical, type EarningsSurprises, EconomicEndpoints, type EconomicIndicator, type EconomicIndicatorName, type EconomicIndicatorParams, type EconomicsCalendar, type EnterpriseValue, type ErrorResponse, Exchange, type ExecutiveCompensation, FMP, FMPClient, type FMPConfig, FinancialEndpoints, type FinancialGrowth, type FinancialRatios, type FinancialStatementBase, type FinancialStatementsParams, ForexEndpoints, type ForexHistoricalParams, type ForexList, type ForexQuote, type GrowthStatementBase, HTTP_STATUS, type HistoricalEmployeeCount, type HistoricalPriceData, type HistoricalPriceParams, type HistoricalPriceResponse, type HistoricalSharesFloat, type HouseTradingResponse, type IPOCalendar, type IncomeGrowth, type IncomeStatement, type IntradayParams, type KeyMetrics, ListEndpoints, MAX_LIMIT, type MarketCap, MarketEndpoints, type MarketHoliday, type MarketHours, type MarketIndex, type MarketPerformance, type MarketSectorPerformance, MutualFundEndpoints, type MutualFundHolding, type MutualFundQuote, PERIODS, type PaginationParams, Period, type PeriodParams, type QueryParams, type Quote, QuoteEndpoints, type QuoteParams, SECTORS, SenateHouseEndpoints, type SenateHouseTradingByNameParams, type SenateHouseTradingByNameResponse, type SenateHouseTradingParams, type SenateHouseTradingRSSFeedParams, type SenateTradingResponse, type SharesFloat, type SplitsCalendar, type StockDividend, type StockDividendResponse, StockEndpoints, type StockList, type StockListResponse, type StockQuote, type StockRealTimePrice, type StockRealTimePriceFull, type StockSplit, type StockSplitResponse, type SuccessResponse, type SymbolParams, type TreasuryRate, formatCurrency, formatDate, formatLargeNumber, formatNumber, formatPercentage, formatReadableDate, formatTimestamp, formatVolume, validateApiKey, validateDate, validateLimit, validatePage, validatePeriod, validateSymbol };
|