yfinance: yfinance 0.1.*: Unable to load ticker information
- Info about your system:
yfinance version: ‘0.1.90’
- operating system: -windows
- Simple code that reproduces your problem
ticker = 'AAPL'
print('ticker: %s'%(ticker))
yf_info = yf.Ticker(ticker)
bs = yf_info.balance_sheet
print(bs)
- The error message Returns empty array: when I print bs Empty DataFrame Columns: [Open, High, Low, Close, Adj Close, Volume] Index: []
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 22
- Comments: 51 (9 by maintainers)
Links to this issue
Commits related to this issue
- #1253 Fix for encrypted stores, bases on https://github.com/ranaroussi/yfinance/issues/1246#issuecomment-1356709536 but using cryptography. — committed to fredrik-corneliusson/yfinance-tz-cache by fredrik-corneliusson 2 years ago
Same problem for me on all stocks it seems. I get
{'regularMarketPrice': None, 'preMarketPrice': None, 'logo_url': ''}
for anyinfo
They are encrypting the store data (it seems with AES) using
crypto-js
library.Deobfuscated code is doing something like this:
I’ll continue deobfuscation, it seems I will be able to provide some working code sample soon.
Having similar issue, when trying to print regularMarketPrice and volume. printing yf.Ticker(ticker).info returns: {‘regularMarketPrice’: None, ‘preMarketPrice’: None, ‘logo_url’: ‘’, trailingPegRatio’:None} and print(yf.Ticker(‘AAPL’).info[‘volume’]) returns KeyError for ‘volume’
New release out that fixes this - 0.1.92
Same problem for me
Looks like Yahoo has encoded the data stores embedded in HTML that
yfinance
relied upon. E.g.Before (via my session cache):
After
Anyone able to decode this?
Same here. Problem seems to have started today, perhaps some issue with Yahoo or API.
Thanks for all the hard work guys. 0.1.93 confirmed behaving the same as prior
First time I have ever seen the open source collaboration process in action. Powerful. Thanks all. Especially @Rogach
@ValueRaider Seems I have a solution in PR #1253
This is the wrong place for PIP issues. Try here
New release 0.1.93, fixes
Ticker.shares
Here’s the fully working example. Runs in NodeJS, has a dependency on
crypto-js
library.I have to run now, don’t have the time to convert this to python, sorry.
@Travis-Barton good point. I’ve restored the
balancesheet
API and added a small summary changelog near top of READMEHello, I could make use of the help of more experienced people. I cannot retrieve info anymore, typically I get {‘regularMarketPrice’: None, ‘preMarketPrice’: None, ‘logo_url’: ‘’, ‘trailingPegRatio’: 2.164}. I tried to update yfinance to 0.1.93 using pip install yfinance --upgrade --no-cache-dir but only 0.1.87 was installed. I thank you in advance for your assistance.
Just checked -
+.shares +.financials +.quarterly_financials +.balance_sheet +.quarterly_balancesheet +.cashflow +.quarterly_cashflow +.dividends +.earnings +.quarterly_earnings +.recommendations
Everything seems to work fine with 0.1.93 again - thx for great work
@ValueRaider I think I found the problem! yf.version is returning 0.1.90.
had to restart visual studio code, heh… basic troubleshooting ftw?
Good spot. I can fix this.
Everything seems to work fine with 0.1.92.
Only thing which i recognized which was not working for me, was that i was not able to get the number of shares.
e.g.
msft.shares
I tried to port but give up. None of the examples I found use a “words” array as the salt, most assume the salt is embedded in the encrypted text. Example