Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annualReportExpenseRatio missing #2040

Closed
yunhongz opened this issue Aug 30, 2024 · 2 comments
Closed

annualReportExpenseRatio missing #2040

yunhongz opened this issue Aug 30, 2024 · 2 comments

Comments

@yunhongz
Copy link

Describe bug

With over 1100 ETFs traded in NYSE/Nasdaq, I couldn't find the 'annualReportExpenseRatio' value frrom their info records. Is this field no longer available?

import yfinace as yf

ticker='SPYI'

yf_ticker = yf.Ticker(ticker)

info = yf_ticker.get_info()

info.get('annualReportExpenseRatio')

Simple code that reproduces your problem

import yfinace as yf

ticker='SPYI'; yf_ticker = yf.Ticker(ticker); info = yf_ticker.get_info(); info.get('annualReportExpenseRatio')

ticker='QQQ'; yf_ticker = yf.Ticker(ticker); info = yf_ticker.get_info(); info.get('annualReportExpenseRatio')

ticker='SPY'; yf_ticker = yf.Ticker(ticker); info = yf_ticker.get_info(); info.get('annualReportExpenseRatio')

ticker='SPY'; yf_ticker = yf.Ticker(ticker); info = yf_ticker.get_info(); info.get('annualReportExpenseRatio')

Debug log

yf.enable_debug_mode()
ticker='SPY'; yf_ticker = yf.Ticker(ticker); info = yf_ticker.get_info(); info.get('annualReportExpenseRatio')
DEBUG get_raw_json(): https://query2.finance.yahoo.com/v10/finance/quoteSummary/SPY
DEBUG Entering get()
DEBUG url=https://query2.finance.yahoo.com/v10/finance/quoteSummary/SPY
DEBUG params={'modules': 'financialData,quoteType,defaultKeyStatistics,assetProfile,summaryDetail', 'corsDomain': 'finance.yahoo.com', 'formatted': 'false', 'symbol': 'SPY'}
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
DEBUG reusing cookie
DEBUG reusing crumb
DEBUG Exiting _get_cookie_and_crumb_basic()
DEBUG Exiting _get_cookie_and_crumb()
DEBUG response code=200
DEBUG Exiting get()

Bad data proof

No response

yfinance version

yfinance 0.2.38

Python version

python3.10

Operating system

No response

@ericpien
Copy link
Contributor

ericpien commented Sep 1, 2024

There were multiple efforts to support ETF and Mutual Funds Data. Some efforts were specific to expense ratios (#557), or holdings (#1872). These efforts also attempted to solve the issues in different methods (i.e. scraping html or using api).

Rather than implementing piece-wise, I think fund level data should be supported holistically as started by #1784 using the api method.

I will take this issue and also attempt to resolve the following issues/discussions in one go:

@ericpien
Copy link
Contributor

hi @yunhongz, following #2041, you are now able to query annualReportExpenseRatio via:

spy = yf.Ticker('SPY')
data = spy.funds_data
data.fund_operations
Attributes SPY Category Average
Annual Report Expense Ratio 0.000945 0.007769
Annual Holdings Turnover 0.020000 0.490600
Total Net Assets 308649.800000 308649.800000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants