fmp-node-api 0.0.7 → 0.0.8

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.js CHANGED
@@ -61,11 +61,13 @@ var FMPClient = class {
61
61
  return {
62
62
  success: true,
63
63
  data,
64
+ error: null,
64
65
  status: response.status
65
66
  };
66
67
  } catch (error) {
67
68
  return {
68
69
  success: false,
70
+ data: null,
69
71
  error: error.message || "Unknown error occurred",
70
72
  status: error.response?.status || 500
71
73
  };
@@ -84,11 +86,13 @@ var FMPClient = class {
84
86
  return {
85
87
  success: true,
86
88
  data,
89
+ error: null,
87
90
  status: response.status
88
91
  };
89
92
  } catch (error) {
90
93
  return {
91
94
  success: false,
95
+ data: null,
92
96
  error: error.message || "Unknown error occurred",
93
97
  status: error.response?.status || 500
94
98
  };
@@ -1123,6 +1127,289 @@ var SenateHouseEndpoints = class {
1123
1127
  }
1124
1128
  };
1125
1129
 
1130
+ // src/endpoints/institutional.ts
1131
+ var InstitutionalEndpoints = class {
1132
+ constructor(client) {
1133
+ this.client = client;
1134
+ }
1135
+ /**
1136
+ * Get Form 13F institutional stock ownership data
1137
+ * https://site.financialmodelingprep.com/developer/docs#form-13f-13f---institutional-stock-ownership
1138
+ * @param symbol - The stock symbol to get the Form 13F data for
1139
+ * @param date - The date to get the Form 13F data for (optional)
1140
+ * @returns Form 13F institutional stock ownership data
1141
+ */
1142
+ async getForm13F(params) {
1143
+ const { cik, date } = params;
1144
+ const queryParams = {};
1145
+ if (date) queryParams.date = date;
1146
+ return this.client.get(`/form-thirteen/${cik}`, "v3", queryParams);
1147
+ }
1148
+ /**
1149
+ * Get Form 13F dates for institutional stock ownership
1150
+ * https://site.financialmodelingprep.com/developer/docs#form-13f-dates-13f---institutional-stock-ownership
1151
+ * @param symbol - The stock symbol to get the Form 13F dates for
1152
+ * @returns Form 13F dates for institutional stock ownership
1153
+ */
1154
+ async getForm13FDates(params) {
1155
+ const { cik } = params;
1156
+ return this.client.get(`/form-thirteen-date/${cik}`, "v3");
1157
+ }
1158
+ /**
1159
+ * Get institutional holders data
1160
+ * https://site.financialmodelingprep.com/developer/docs#institutional-holder-13f---institutional-stock-ownership
1161
+ * @param symbol - The stock symbol to get the institutional holders for
1162
+ * @returns Institutional holders data
1163
+ */
1164
+ async getInstitutionalHolders(params) {
1165
+ const { symbol } = params;
1166
+ return this.client.get(`/institutional-holder/${symbol}`, "v3");
1167
+ }
1168
+ };
1169
+
1170
+ // src/endpoints/insider.ts
1171
+ var InsiderEndpoints = class {
1172
+ constructor(client) {
1173
+ this.client = client;
1174
+ }
1175
+ /**
1176
+ * Get insider trading RSS feed
1177
+ * https://site.financialmodelingprep.com/developer/docs#insider-trades-rss-insider-trading
1178
+ * @param params - Parameters for the RSS feed request
1179
+ * @returns An RSS feed of insider trades, updated in real time
1180
+ */
1181
+ async getInsiderTradingRSS({
1182
+ page
1183
+ }) {
1184
+ return this.client.get(`/insider-trading-rss-feed`, "v4", { page });
1185
+ }
1186
+ /**
1187
+ * Search for insider trades
1188
+ * https://site.financialmodelingprep.com/developer/docs#insider-trades-search-insider-trading
1189
+ * @param params - Parameters for the insider trading search
1190
+ * @returns A list of insider trades filtered by the provided parameters
1191
+ */
1192
+ async searchInsiderTrading({
1193
+ symbol,
1194
+ reportingCik,
1195
+ companyCik,
1196
+ transactionType,
1197
+ page
1198
+ }) {
1199
+ const params = { page };
1200
+ if (symbol) params.symbol = symbol;
1201
+ if (reportingCik) params.reportingCik = reportingCik;
1202
+ if (companyCik) params.companyCik = companyCik;
1203
+ if (transactionType) params.transactionType = transactionType;
1204
+ return this.client.get(`/insider-trading`, "v4", params);
1205
+ }
1206
+ /**
1207
+ * Get transaction types
1208
+ * https://site.financialmodelingprep.com/developer/docs#transaction-types-insider-trading
1209
+ * @returns A list of all insider transaction types
1210
+ */
1211
+ async getTransactionTypes() {
1212
+ return this.client.get(`/insider-trading-transaction-type`, "v4");
1213
+ }
1214
+ /**
1215
+ * Get insiders by symbol
1216
+ * https://site.financialmodelingprep.com/developer/docs#insiders-by-symbol-insider-trading
1217
+ * @param params - Parameters for the insiders request
1218
+ * @returns A list of insiders for a specific company
1219
+ */
1220
+ async getInsidersBySymbol({
1221
+ symbol
1222
+ }) {
1223
+ return this.client.get(`/insider-roaster`, "v4", { symbol });
1224
+ }
1225
+ /**
1226
+ * Get insider trade statistics
1227
+ * https://site.financialmodelingprep.com/developer/docs#insider-trade-statistics-insider-trading
1228
+ * @param params - Parameters for the statistics request
1229
+ * @returns Statistics on insider trading activity for a specific company
1230
+ */
1231
+ async getInsiderTradeStatistics({
1232
+ symbol
1233
+ }) {
1234
+ return this.client.get(`/insider-roaster-statistic`, "v4", { symbol });
1235
+ }
1236
+ /**
1237
+ * Get CIK mapper
1238
+ * https://site.financialmodelingprep.com/developer/docs#cik-mapper-insider-trading
1239
+ * @param params - Parameters for the CIK mapper request
1240
+ * @returns A list of CIK numbers and corresponding company names
1241
+ */
1242
+ async getCikMapper({ page }) {
1243
+ return this.client.get(`/mapper-cik-name`, "v4", { page });
1244
+ }
1245
+ /**
1246
+ * Get CIK mapper by name
1247
+ * https://site.financialmodelingprep.com/developer/docs#cik-mapper-by-name-insider-trading
1248
+ * @param params - Parameters for the CIK mapper by name request
1249
+ * @returns A list of CIK numbers and corresponding names matching the search term
1250
+ */
1251
+ async getCikMapperByName({
1252
+ name,
1253
+ page = 0
1254
+ }) {
1255
+ return this.client.get(`/mapper-cik-name`, "v4", { name, page });
1256
+ }
1257
+ /**
1258
+ * Get CIK mapper by symbol
1259
+ * https://site.financialmodelingprep.com/developer/docs#cik-mapper-company-insider-trading
1260
+ * @param params - Parameters for the CIK mapper by symbol request
1261
+ * @returns CIK number and corresponding company name for a specific symbol
1262
+ */
1263
+ async getCikMapperBySymbol({
1264
+ symbol
1265
+ }) {
1266
+ return this.client.getSingle(`/mapper-cik-company/${symbol}`, "v4");
1267
+ }
1268
+ /**
1269
+ * Get beneficial ownership acquisitions
1270
+ * https://site.financialmodelingprep.com/developer/docs#acquisition-of-beneficial-ownership
1271
+ * @param params - Parameters for the beneficial ownership request
1272
+ * @returns A list of acquisitions of beneficial ownership for a specific company
1273
+ */
1274
+ async getBeneficialOwnership({
1275
+ symbol
1276
+ }) {
1277
+ return this.client.get(`/insider/ownership/acquisition_of_beneficial_ownership`, "v4", {
1278
+ symbol
1279
+ });
1280
+ }
1281
+ /**
1282
+ * Get fail to deliver data
1283
+ * https://site.financialmodelingprep.com/developer/docs#fail-to-deliver
1284
+ * @param params - Parameters for the fail to deliver request
1285
+ * @returns A list of fail to deliver data for a specific company
1286
+ */
1287
+ async getFailToDeliver({
1288
+ symbol,
1289
+ page = 0
1290
+ }) {
1291
+ return this.client.get(`/fail_to_deliver`, "v4", { symbol, page });
1292
+ }
1293
+ /**
1294
+ * Get all insider trades for a symbol (convenience method)
1295
+ * @param symbol - The stock symbol to get insider trades for
1296
+ * @param page - Page number for pagination (default: 0)
1297
+ * @returns A list of insider trades for the specified symbol
1298
+ */
1299
+ async getInsiderTradesBySymbol(symbol, page = 0) {
1300
+ return this.searchInsiderTrading({ symbol, page });
1301
+ }
1302
+ /**
1303
+ * Get insider trades by transaction type (convenience method)
1304
+ * @param transactionType - The transaction type to filter by
1305
+ * @param page - Page number for pagination (default: 0)
1306
+ * @returns A list of insider trades filtered by transaction type
1307
+ */
1308
+ async getInsiderTradesByType(transactionType, page = 0) {
1309
+ return this.searchInsiderTrading({ transactionType, page });
1310
+ }
1311
+ /**
1312
+ * Get insider trades by reporting CIK (convenience method)
1313
+ * @param reportingCik - The reporting CIK to filter by
1314
+ * @param page - Page number for pagination (default: 0)
1315
+ * @returns A list of insider trades filtered by reporting CIK
1316
+ */
1317
+ async getInsiderTradesByReportingCik(reportingCik, page = 0) {
1318
+ return this.searchInsiderTrading({ reportingCik, page });
1319
+ }
1320
+ /**
1321
+ * Get insider trades by company CIK (convenience method)
1322
+ * @param companyCik - The company CIK to filter by
1323
+ * @param page - Page number for pagination (default: 0)
1324
+ * @returns A list of insider trades filtered by company CIK
1325
+ */
1326
+ async getInsiderTradesByCompanyCik(companyCik, page = 0) {
1327
+ return this.searchInsiderTrading({ companyCik, page });
1328
+ }
1329
+ };
1330
+
1331
+ // src/endpoints/sec.ts
1332
+ var SECEndpoints = class {
1333
+ constructor(client) {
1334
+ this.client = client;
1335
+ }
1336
+ /**
1337
+ * Get RSS feed of SEC filings
1338
+ * https://site.financialmodelingprep.com/developer/docs#rss-feed-securities-and-exchange-commission-(s.e.c)
1339
+ * @param params - RSS feed parameters
1340
+ * @returns A real-time feed of SEC filings from publicly traded companies, including the filing type, link to SEC page, and direct link to the filing. This endpoint can be used to stay up-to-date on the latest SEC filings for all companies or for a specific set of companies.
1341
+ */
1342
+ async getRSSFeed(params) {
1343
+ return this.client.get("/rss_feed", "v4", params);
1344
+ }
1345
+ /**
1346
+ * Get RSS feed of all SEC filings
1347
+ * https://site.financialmodelingprep.com/developer/docs#rss-feed-all-securities-and-exchange-commission-(s.e.c)
1348
+ * @param params - RSS feed all parameters
1349
+ * @returns A real-time feed of all SEC filings from publicly traded companies in the latest RSS feed format. This endpoint provides a comprehensive overview of all SEC filings, including the filing type, link to SEC page, and direct link to the filing.
1350
+ */
1351
+ async getRSSFeedAll(params) {
1352
+ return this.client.get("/rss_feed_all", "v4", params);
1353
+ }
1354
+ /**
1355
+ * Get RSS feed V3 of SEC filings
1356
+ * https://site.financialmodelingprep.com/developer/docs#rss-feed-v3-securities-and-exchange-commission-(s.e.c)
1357
+ * @param params - RSS feed V3 parameters
1358
+ * @returns A real-time feed of SEC filings from publicly traded companies in the latest RSS feed format (V3)
1359
+ */
1360
+ async getRSSFeedV3(params) {
1361
+ return this.client.get("/rss_feed", "v3", params);
1362
+ }
1363
+ /**
1364
+ * Get RSS feed of 8-K SEC filings
1365
+ * https://site.financialmodelingprep.com/developer/docs#rss-feed-8-k-securities-and-exchange-commission-(s.e.c)
1366
+ * @param params - RSS feed 8-K parameters
1367
+ * @returns A real-time feed of 8-K SEC filings from publicly traded companies
1368
+ */
1369
+ async getRSSFeed8K(params) {
1370
+ return this.client.get("/rss_feed_8k", "v4", params);
1371
+ }
1372
+ /**
1373
+ * Get SEC filings for a specific company
1374
+ * https://site.financialmodelingprep.com/developer/docs#sec-filings-securities-and-exchange-commission-(s.e.c)
1375
+ * @param symbol - The stock symbol to get SEC filings for
1376
+ * @param params - SEC filings parameters
1377
+ * @returns Access direct links to SEC filings, including the filing type, link to the SEC page, and direct link to the specific filing
1378
+ */
1379
+ async getSECFilings({
1380
+ symbol,
1381
+ params
1382
+ }) {
1383
+ return this.client.get(`/sec_filings/${symbol}`, "v3", params);
1384
+ }
1385
+ /**
1386
+ * Get individual industry classification
1387
+ * https://site.financialmodelingprep.com/developer/docs#individual-industry-classification-standard-industrial-classification
1388
+ * @param params - Industry classification parameters
1389
+ * @returns Identify the industry in which a particular company operates, based on the Standard Industrial Classification (SIC) system
1390
+ */
1391
+ async getIndividualIndustryClassification(params) {
1392
+ return this.client.getSingle("/standard_industrial_classification", "v4", params);
1393
+ }
1394
+ /**
1395
+ * Get all industry classifications
1396
+ * https://site.financialmodelingprep.com/developer/docs#all-industry-classification-standard-industrial-classification
1397
+ * @returns Get a comprehensive overview of all industries, classified according to the SIC system
1398
+ */
1399
+ async getAllIndustryClassifications() {
1400
+ return this.client.get("/standard_industrial_classification/all", "v4");
1401
+ }
1402
+ /**
1403
+ * Get industry classification codes
1404
+ * https://site.financialmodelingprep.com/developer/docs#industry-classification-codes-standard-industrial-classification
1405
+ * @param params - Industry classification codes parameters
1406
+ * @returns Learn more about the SIC system and identify the SIC code for a particular industry
1407
+ */
1408
+ async getIndustryClassificationCodes(params) {
1409
+ return this.client.get("/standard_industrial_classification_list", "v4", params);
1410
+ }
1411
+ };
1412
+
1126
1413
  // src/fmp.ts
1127
1414
  var FMP = class {
1128
1415
  constructor(config) {
@@ -1138,6 +1425,9 @@ var FMP = class {
1138
1425
  this.company = new CompanyEndpoints(client);
1139
1426
  this.quote = new QuoteEndpoints(client);
1140
1427
  this.senateHouse = new SenateHouseEndpoints(client);
1428
+ this.institutional = new InstitutionalEndpoints(client);
1429
+ this.insider = new InsiderEndpoints(client);
1430
+ this.sec = new SECEndpoints(client);
1141
1431
  this.forex = new ForexEndpoints(client);
1142
1432
  this.economic = new EconomicEndpoints(client);
1143
1433
  this.mutualFund = new MutualFundEndpoints(client);
@@ -1168,6 +1458,29 @@ var Exchange = /* @__PURE__ */ ((Exchange2) => {
1168
1458
  return Exchange2;
1169
1459
  })(Exchange || {});
1170
1460
 
1461
+ // src/types/insider.ts
1462
+ var TransactionType = /* @__PURE__ */ ((TransactionType2) => {
1463
+ TransactionType2["AWARD"] = "A-Award";
1464
+ TransactionType2["CONVERSION"] = "C-Conversion";
1465
+ TransactionType2["RETURN"] = "D-Return";
1466
+ TransactionType2["EXPIRE_SHORT"] = "E-ExpireShort";
1467
+ TransactionType2["IN_KIND"] = "F-InKind";
1468
+ TransactionType2["GIFT"] = "G-Gift";
1469
+ TransactionType2["EXPIRE_LONG"] = "H-ExpireLong";
1470
+ TransactionType2["DISCRETIONARY"] = "I-Discretionary";
1471
+ TransactionType2["OTHER"] = "J-Other";
1472
+ TransactionType2["SMALL"] = "L-Small";
1473
+ TransactionType2["EXEMPT"] = "M-Exempt";
1474
+ TransactionType2["OUT_OF_THE_MONEY"] = "O-OutOfTheMoney";
1475
+ TransactionType2["PURCHASE"] = "P-Purchase";
1476
+ TransactionType2["SALE"] = "S-Sale";
1477
+ TransactionType2["TENDER"] = "U-Tender";
1478
+ TransactionType2["WILL"] = "W-Will";
1479
+ TransactionType2["IN_THE_MONEY"] = "X-InTheMoney";
1480
+ TransactionType2["TRUST"] = "Z-Trust";
1481
+ return TransactionType2;
1482
+ })(TransactionType || {});
1483
+
1171
1484
  // src/utils/formatting.ts
1172
1485
  function formatCurrency(value, currency = "USD") {
1173
1486
  return new Intl.NumberFormat("en-US", {
@@ -1303,6 +1616,8 @@ exports.FMPClient = FMPClient;
1303
1616
  exports.FinancialEndpoints = FinancialEndpoints;
1304
1617
  exports.ForexEndpoints = ForexEndpoints;
1305
1618
  exports.HTTP_STATUS = HTTP_STATUS;
1619
+ exports.InsiderEndpoints = InsiderEndpoints;
1620
+ exports.InstitutionalEndpoints = InstitutionalEndpoints;
1306
1621
  exports.ListEndpoints = ListEndpoints;
1307
1622
  exports.MAX_LIMIT = MAX_LIMIT;
1308
1623
  exports.MarketEndpoints = MarketEndpoints;
@@ -1310,9 +1625,11 @@ exports.MutualFundEndpoints = MutualFundEndpoints;
1310
1625
  exports.PERIODS = PERIODS;
1311
1626
  exports.Period = Period;
1312
1627
  exports.QuoteEndpoints = QuoteEndpoints;
1628
+ exports.SECEndpoints = SECEndpoints;
1313
1629
  exports.SECTORS = SECTORS;
1314
1630
  exports.SenateHouseEndpoints = SenateHouseEndpoints;
1315
1631
  exports.StockEndpoints = StockEndpoints;
1632
+ exports.TransactionType = TransactionType;
1316
1633
  exports.formatCurrency = formatCurrency;
1317
1634
  exports.formatDate = formatDate;
1318
1635
  exports.formatLargeNumber = formatLargeNumber;