1.4.1 • Published 3 years ago
yahoo-earnings v1.4.1
Yahoo Finance Earnings Calendar
Node library. Scrapes yahoo finance earnings calendar from a given date.
Need to improve
- Build and publish in CI
- Optimise
getEarningsByInterval
to open browser only one time - Add more tests
Installation
npm install yahoo-earnings
yarn install yahoo-earnings
Usage
By day
import { YahooFinanceEarnings } from 'yahoo-earnings';
const earnings = await YahooFinanceEarnings.getEarningsByDay(
new Date('2020-06-16'),
); // default new Date()
console.log(earnings);
// Upcoming Earning
[
{
epsEstimate: 1.17,
epsReported: undefined,
epsSurprise: undefined,
reportDate: '2020-06-16',
symbol: 'ORCL',
company: 'Oracle Corp',
announceTime: 'After Market Close',
epsSurpriseDollar: undefined,
},
][
// Previous Earning
{
epsEstimate: 2.33,
epsReported: 2.45,
epsSurprise: 5.15,
reportDate: '2020-06-11',
symbol: 'ADBE',
company: 'Adobe Inc.',
announceTime: 'Time Not Supplied',
epsSurpriseDollar: 0.12,
}
];
By date range
import { YahooFinanceEarnings } from 'yahoo-earnings';
const earnings = await YahooFinanceEarnings.getEarningsByInterval(
new Date('2020-06-14'), // default new Date()
new Date('2020-06-17'), // default new Date()
{
requestsTimeoutMs: 2000, // Optional, default 1000.
groupByDay: false, // Optional, default false.
}
);
console.log(earnings);
// Upcoming Earning
[{ ... }, { ... }];