gadicc / node-yahoo-finance2

Unofficial API for Yahoo Finance
https://www.npmjs.com/package/yahoo-finance2
MIT License
353 stars 58 forks source link

DailyGainers method #722

Closed YanVolynets closed 6 months ago

YanVolynets commented 7 months ago
import yahooFinance from 'yahoo-finance2';
const queryOptions = { count: 5, region: 'US', lang: 'en-US' };
(async () => {
  let result = await yahooFinance.dailyGainers(queryOptions);
  console.log(result);
})();

I get 5 duplicates for every stock in output and then get error: FailedYahooValidationError: Failed Yahoo Schema validation at validate (file:///c:/Users/messi/Desktop/Nay/Study/Javascript/Bot_tardernet/node_modules/yahoo-finance2/dist/esm/src/lib/validateAndCoerceTypes.js:296:15) at Object.moduleExec [as _moduleExec] (file:///c:/Users/messi/Desktop/Nay/Study/Javascript/Bot_tardernet/node_modules/yahoo-finance2/dist/esm/src/lib/moduleExec.js:87:9) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///c:/Users/messi/Desktop/Nay/Study/Javascript/Bot_tardernet/trdview.mjs:4:16 { result: { id: 'ec5bebb9-b7b2-4474-9e5c-3e258b61cbe6', title: 'Day Gainers', description: 'Discover the equities with the greatest gains in the trading day.', canonicalName: 'DAY_GAINERS',