python - Yahoo Finance API issues

2.8k Views Asked by At

I am trying to download stock data with yfinance, specifically:

!pip install yfinance
import yfinance as yf
yf.download('AAPL', start='2015-01-01', end=pd.to_datetime('today'), progress=False)

However, this returns:

1 Failed download: AAPL: TypeError("import_optional_dependency() got an unexpected keyword argument 'errors'")

If I try to print the data, it is an empty array. I have also tried using the ticker class:

print(yf.Ticker('AAPL').info)

but this returns

Exception: yfinance failed to decrypt Yahoo data response

Finally, I have tried yahooquery:

!pip install yahooquery
from yahooquery import Ticker

t = Ticker('AAPL', asynchronous=True)
print(t.history(period='ytd', interval='1d'))

print(t.asset_profile)

But this returns:

Empty DataFrame Columns: [high, low, volume, open, close] Index: [] {'APPL': 'No fundamentals data found for any of the summaryTypes=assetProfile'}

pandas datareader also does not work, though I believe it depends on yfinance. I am wondering if I am doing anything wrong, or if the yahoo api is down. Any help is appreciated.

0

There are 0 best solutions below