ka1kuk commited on
Commit
2b8774c
1 Parent(s): f1e4e01

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +14 -3
app.js CHANGED
@@ -76,6 +76,17 @@ app.get('/api/chart/:symbol', async (req, res) => {
76
  }
77
  });
78
 
 
 
 
 
 
 
 
 
 
 
 
79
  app.get('/api/summary/:symbol', async (req, res) => {
80
  const symbol = req.params.symbol;
81
  try {
@@ -199,7 +210,7 @@ app.get('/api/trend/:symbol', async (req, res) => {
199
 
200
  app.get('/api/insider/:symbol', async (req, res) => {
201
  const symbol = req.params.symbol;
202
- try {
203
  const queryOptions = { modules: ['insiderHolders', 'insiderTransactions', 'institutionOwnership'] };
204
  const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
205
  res.json(quote);
@@ -222,7 +233,7 @@ app.get('/api/major/:symbol', async (req, res) => {
222
 
223
  app.get('/api/netshare/:symbol', async (req, res) => {
224
  const symbol = req.params.symbol;
225
- try {
226
  const queryOptions = { modules: ['netSharePurchaseActivity', 'price'] };
227
  const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
228
  res.json(quote);
@@ -233,7 +244,7 @@ app.get('/api/netshare/:symbol', async (req, res) => {
233
 
234
  app.get('/api/recommend/:symbol', async (req, res) => {
235
  const symbol = req.params.symbol;
236
- try {
237
  const queryOptions = { modules: ['recommendationTrend'] };
238
  const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
239
  res.json(quote);
 
76
  }
77
  });
78
 
79
+ app.get('api/getall/:symbol', async ((req, res) => {
80
+ const symbol = req.params.symbol
81
+ try {
82
+ const queryOptions = { modules: ['defaultKeyStatistics', 'summaryDetail', 'earnings', 'earningsHistory', 'earningsTrend', 'assetProfile', 'balanceSheetHistory', 'balanceSheetHistoryQuarterly', 'calendarEvents', 'cashflowStatementHistory', 'cashflowStatementHistoryQuarterly', 'summaryProfile', 'financialData', 'fundOwnership', 'fundPerformance', 'fundProfile', 'incomeStatementHistory', 'incomeStatementHistoryQuarterly', 'indexTrend', 'industryTrend', 'netSharePurchaseActivity', 'price'] };
83
+ const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
84
+ res.json(quote);
85
+ } catch (error) {
86
+ res.status(500).json({ message: 'Error fetching summary data.' });
87
+ }
88
+ })
89
+
90
  app.get('/api/summary/:symbol', async (req, res) => {
91
  const symbol = req.params.symbol;
92
  try {
 
210
 
211
  app.get('/api/insider/:symbol', async (req, res) => {
212
  const symbol = req.params.symbol;
213
+ try {
214
  const queryOptions = { modules: ['insiderHolders', 'insiderTransactions', 'institutionOwnership'] };
215
  const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
216
  res.json(quote);
 
233
 
234
  app.get('/api/netshare/:symbol', async (req, res) => {
235
  const symbol = req.params.symbol;
236
+ try {
237
  const queryOptions = { modules: ['netSharePurchaseActivity', 'price'] };
238
  const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
239
  res.json(quote);
 
244
 
245
  app.get('/api/recommend/:symbol', async (req, res) => {
246
  const symbol = req.params.symbol;
247
+ try {
248
  const queryOptions = { modules: ['recommendationTrend'] };
249
  const quote = await yahooFinance.quoteSummary(symbol, queryOptions);
250
  res.json(quote);