4

I am currently trying to use the yfinance package in Python, but am running into problems. When I run

import yfinance as yf
msft = yf.Ticker('MSFT')
msft.info

However, When I run this code I get the error message of :Exception: yfinance failed to decrypt Yahoo data response. WARNING: No decryption keys could be extracted from JS file. Falling back to backup decrypt methods.

I am unsure what to do, for a month ago, this same code worked for me. I am running jupyter notebooks on mac. I redownloaded python, but am to no avail. I followed the advice from >https://github.com/ranaroussi/yfinance>.

Grant Weaver
  • 53
  • 1
  • 1
  • 6
  • Can you share which version of `yfinance` are you using? as of now `yfinance==0.2.24` seems to be executing the same code block without any issues. – Amir nazary Jul 16 '23 at 21:24

2 Answers2

2

Read through the discussion here.
As to " for a month ago, this same code worked for me", here definitely gives a sense that Yahoo has been actively adjusting things on their end very recently and changes need to be made to accomodate that.

Wayne
  • 6,607
  • 8
  • 36
  • 93
1

You could use yahooquery, another package just like yfinance using the Yahoo API and is a bit faster than yfinance You can find documentation here https://pypi.org/project/yahooquery/1.1.0/