rsquaredacademy / yahoofinancer

Obtain historical and near real time data from Yahoo Finance
https://yahoofinancer.rsquaredacademy.com
Other
13 stars 2 forks source link

Missing data fields in yahoofinacier #8

Closed rpenm closed 1 week ago

rpenm commented 10 months ago

I am trying to retrieve some fields in yahoofinancier that should be available according to the documentation: https://www.r-bloggers.com/2022/11/introducing-yahoofinancer/

When I run the script below it returns values for high, low, volume, forward PE, 50 day average, and 200 day average But it returns NULL values for beta, averageVolume, averageVolume10days

Can someone advise why these values return as NULL?

Thank you!

-----------------sample script

load the library

library(yahoofinancer)

----------------------------------------

select ticker and date range

tickerSymbol <- 'aapl' startDate <- '2023-11-01' endDate <- '2023-12-21' interval <- '1d'

---------------------------------------

create ticker class

ticker <- Ticker$new(tickerSymbol)

build dataframe of stock history

df <- ticker$get_history(start = startDate, end = endDate, interval = interval) df <- data.frame(df)

get desired stats

fwdPE <- ticker$quote$forwardPE avgVol <- ticker$quote$averageVolume avg10dVol <- ticker$quote$averageVolume10days avg50d <- ticker$quote$fiftyDayAverage avg200d <- ticker$quote$twoHundredDayAverage beta <- ticker$quote$beta 

aravindhebbali commented 10 months ago

Hello @rpenm,

There have been a lot of changes to the Yahoo Finance API since May. Only a subset of the original data is available now.

rpenm commented 10 months ago

Ok. Good to know. Is there are alternative API to Yahoo finance that you recommend?

Thank You!