cmallwitz / Financials-Extension

Extension for LibreOffice Calc to access stock market data
Other
152 stars 21 forks source link

Example GETREALTIME("IBM",21,"YAHOO") does not work anymore #69

Closed klausi closed 1 year ago

klausi commented 1 year ago

=GETREALTIME("IBM",21,"YAHOO") does not work for me anymore, I get a NaN result. It looks like the QuoteSummaryStore JSON is missing in the response and the the extension returns None. I saw nothing in the logs, so modified financials_yahoo.py:

try:
            start = text.find('"QuoteSummaryStore":{')

            if start < 0:
                return 'No QuoteSummaryStore found in Yahoo response, ticker={} datacode={}'.format(ticker, datacode)
                #return None

That then triggers for me.

Did Yahoo change their HTML/JSON that is expected here?

cmallwitz commented 1 year ago

Confirmed - YAHOO changed their web site quite a bit earlier this weekend - already on it making necessary changes...

klausi commented 1 year ago

Thank you! I was about to start hacking to get the last price (code 21, probably what most users care about) from the HTML source with a regex :-D

cmallwitz commented 1 year ago

I uploaded version 3.2.0 to fix Yahoo - can you check if it works for you (there are some fields that are not fixed yet) ?

Andresmith76 commented 1 year ago

Wow! Thank you so much for your quick fix. I did install as directed and for the most part, I am no longer getting errors. I have a few mutual fund stocks that are still not able to retrieve some of the Stock Dividend parameters. It's also has trouble getting each stocks Sector info but I'm assuming it's because you haven't repaired all the fields. Libre Office is running and getting most of my requested info now that you've created extension 3.2.0. Again, thank you for your quick action.

cmallwitz commented 1 year ago

Can you give me a list of symbols for the funds and field names you are missing? it seems Yahoo is not displaying quite 100% of the data they had before...

Andresmith76 commented 1 year ago

I can confirm data point codes 69/PE Ratio and 98/Sector aren't working. I have also received an N/A when using code 70/DIV but this might be because the fund I was requesting didn't support dividends (SHRAX).

klausi commented 1 year ago

Thanks, =GETREALTIME("IBM",21,"YAHOO") works for me again.

cmallwitz commented 1 year ago

I just pushed release version 3.2.1 fixing a few outstanding issues. Have a look and let me know if I missed anything!

BTW: SECTOR and INDUSTRY should now work where data is available

criddle3 commented 1 year ago

Fixed! Thanks! My first attempt on Linux failed. The previously downloaded file was still in my downloads dir, so the file name was appended with the "space" and this caused an error on install. If anybody else sees this, just rename file to correct file name and try again.

CaptainCronos commented 1 year ago

I want to thank you for the work that you are doing. I love the extension.

Some of the yahoo items still aren't working like futures/52 week highs and lows, last price date/time etc.

cmallwitz commented 1 year ago

Looking at e.g. future ESH23.CME there is no 52 weeks high/low

And yes, missing last date/time is a annoying but it is handled by some JavaScript in the Yahoo page and I haven't found a consistent way to extract it. If markets are open, there is no date - if markets are closed, it "shows" the last price date but this isn't available in a nice way to extract.

CaptainCronos commented 1 year ago

Cool. I was looking at GC=F, SI=F, CL=F to be specific. They did work, and still for FT. Not sweating you cause you sound like you got a handle on it. I hate when they break stuff.

cmallwitz commented 1 year ago

Closing this for now - last date/time seems to be a struggle.

52 week high/low on futures doesn't seem to be available on Yahoo any more. Even if FT supplies it, I'm not sure it makes a load of sense as some of the futures - some of them might no even be trading for 52 weeks...