ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
13.21k stars 2.33k forks source link

Problem with requesting asset.info for certain assets whilst other data fields like history are defined. #448

Closed gordonkoehn closed 1 year ago

gordonkoehn commented 4 years ago

I noticed that for certain assets like Ryanair Stock, ticker symbol "RYA.L" the info data seems to be Null.

The historic prices are accessible, but the .info is empty it seems to me.

I cannot reproduce this with any other Asset.

Am I doing something wrong ? - Or is this a real bug?

Appreciating any help or suggestions!

My code to reproduce:

# get stock info
import yfinance as yf

#define the ticker symbol
tickerSymbol = 'RYA.L'

#get data on this ticker
tickerData = yf.Ticker(tickerSymbol)

#get history - printed
print(tickerData.history(period="max"))

#get info - printed
print(tickerData.info)

Returns the historic prices fine but there is some issue with the .info field:

Screenshot 2020-09-11 at 16 46 15

OscarCreator commented 4 years ago

Got the same issue here. Tested with Python version 3.7, 3.6, 2.7 but all same issue.

nyrwyrd commented 4 years ago

recently encountered this issue with some ticker symbols (dd, ppl, mfgp, hwm) but 40+ other ticker symbols seem to be okay. this is running yfinance 0.1.54 in python 3.8 at same line with hard coded index '[1]'. error also occurs in retrievals of some other attributes (financials, balance_sheet, cash_flow, earnings, sustainability) while history and occasionally have some issues on another computer running yfinance 0.1.52 in python 3.6 with some ticker symbols (including above) in latter environment but it is not persistent there. in latter case have been able to retrieve data on another try so have not looked into source of problem there, just try/except around failure. generally seems more reliable in older version of yfinance.

gordonkoehn commented 4 years ago

Alright - thx for sharing your experience.

I am running yfinance 0.1.54 and python 3.6.7 and it seems the error is persistent.

I'll maybe try to use an older version of yfinance.

Let me know if you find the root cause!

Best,

Gordon