yf-web-scraper

1.21.1 • Public • Published

Yahoo Finance Data

Scrapes the Yahoo Finance website to pull financial data about a company.

Object keys Type Example
ticker String ABBV
name String Abbvie Inc.
price Float 153.80
averageDividendPaymentsPerYear Integer 4
averageDividendPayoutMonths Array [3,6,9,12]
bookValuePerShare Float 9.22
category String Healthcare
consecutiveYearsOfDividendGrowth Integer 8
consecutiveYearsOfDividendPayments Integer 9
currency String USD
currentRatio Float 0.81
debtToEquityRatio Float 451.44
dilutedEPS Float 6.97
dividendHistory Array [{ date: 2022-04-12T16:00:00.000Z, amount: 1.41 },...]
dividendYield Float 0.0368
EBITDA Integer 24749000000
EPS Float 3.43
exDividendDate String 2022-07-12T16:00:00.000Z
fiftyDayMovingAverage Float 149.83
fiftyTwoWeekHigh Float 175.91
fiftyTwoWeekLow Float 105.56
fiveYearAnnualGrowthEstimate Float 0.0187
freeCashFlow Integer 22047000000
incomeFromOperations Integer 19460000000
industry String Drug Manufacturers—General
interestCoverageRatio Float 7.007268063274903
interestExpense Integer 2339000000
leveredFreeCashFlow Integer 19240000000
marketCap Integer 270620000000
netIncome Integer 12410000000
news Array [{source: "Investor's Business Daily",link: 'https://finance.yahoo.com/m/c91b9937-b4d4-31a2-b8b5-6c408522c083/5-nyse-stocks-to-watch-and.html',headline: '5 NYSE Stocks To Watch And Buy: Here Are Fundamental And Technical Reasons Why',excerpt: "There's no better time than to build a strong watchlist during a serious market correction. This story covers five NYSE stocks to watch and consider buying. In 2022, the NYSE's composite index is outperforming its Nasdaq sibling."},...]
numberOfAnalysts Integer 12
operatingCashflow Integer 22810000000
operatingMartin Float 0.3541
payoutRatio Float 0.3541
PERatio Float 10.92
pricesByYearAndMonth Object {'2022': {'0': [Array],'1': [Array],'2': [Array],'3': [Array],'4': [Array],'5': [Array],'6': [Array]}}
priceToBookRatio Float 16.62
priceToFreeCashFlow Float 12.35
profitMargin Float 0.22
quarterlyEarningsGrowth Float 0.264
quarterlyRevenueGrowth Float 0.041
returnOnAssets Float 0.0855
returnOnEquity Float 0.8312
revenue Integer 56730000000
shareholderEquity Float 272226000000.00003
sharesOutstanding Integer 1770000000
tenYearAverageDividendYield Float 0.03698200381876895
tenYearDividendGrowthRate Float 0.16311628992319557
tenYearDividendVolatility Float 0.40109297777764435
threeYearAverageEarningsGrowth Float 0.55
threeYearAverageRevenueGrowth Float 0.3
totalAssets Integer 146529000
totalCash Integer 7570000000
totalDebt Integer 73650000000
totalLiabilities Integer 131093000
twoHundredDayMovingAverage Float 136.88
type String Stock
yearOnYearEarningsGrowth Float 1.52
yearOnYearRevenueGrowth Float 0.23

How To

  1. Install the package.
npm install yf-scraper
  1. Import the package.
import YahooFinance from 'yf-web-scraper'
  1. Provide the ticker symbol (e.g. '3017') and (if non-US, optional) the exchange (e.g. 'HK').
await YahooFinance('ticker', 'exchange').then((data) => {
  // data
}).catch((error) => {
  // error
})

Notes

  • It will return normalized raw data, e.g. "26440000000" instead of "26.44B".
  • Note that UK-listed companies statistics are returned in pence, not pounds

Readme

Keywords

none

Package Sidebar

Install

npm i yf-web-scraper

Weekly Downloads

1

Version

1.21.1

License

ISC

Unpacked Size

9.68 MB

Total Files

11

Last publish

Collaborators

  • darrylsnow