This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Stocks price update not working

Tags: None
(comma "," separated)
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Stocks price update not working

Thu May 25, 2023 5:36 pm
Using the v7 version, you see a link to this information, which explains why this service has been stopped. :(


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
boingy
Registered Member
Posts
16
Karma
0

Re: Stocks price update not working

Thu May 25, 2023 6:25 pm
I guess we need another quote supplier. I'm in the UK and haven't had much luck with any of the other quote providers that ship with KMM for UK stocks and funds. I might spend a bit more time on it tomorrow.
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS

Re: Stocks price update not working

Thu May 25, 2023 6:42 pm
File or folder does not exist implies you have some networking problem. What happens if you copy/paste that url in a browser or something like curl?
All - please understand that the underlying problem is that Yahoo keeps changing their URL for fetching quotes, and there is no easy way to for the KMM team to push changes to existing intallations. When yahoo does change things, as soon as someone discovers what new URL works it will get posted here and/or on the mailing list.
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS

Re: Stocks price update not working

Thu May 25, 2023 8:46 pm
I was originally going to say that error sounds more like a network issue, but I've tried many variations myself, with the same results. What I find interesting is that 404 error is not coming from my browser (when I try the URL directly) but yahoo is displaying that error. The result of one of my attempts included"Invalid Crumb. For Developers - https://bit.ly/yahoo-finance-api-feedback" (which ends up pointing to a Google doc) which suggests to me they are working very hard to prevent any automated gathering of their data.
Since one can still see prices on yahoo web pages, it should be possible to create a new quote definition, but I doubt is will be easy. I'm sure that once someone comes up with something that works, it will be posted.
boingy
Registered Member
Posts
16
Karma
0

Re: Stocks price update not working

Fri May 26, 2023 7:26 am
Ok, I have now successfully switched to using Financial Times for my quotes.
I'm not saying it's the best solution for everyone but here is what I did.

In "Settings -> Configure KMM -> Online Quotes" page I changed the URL for Financial Times from:
Code: Select all
http://funds.ft.com/uk/Tearsheet/Summary?s=%1

to:
Code: Select all
https://markets.ft.com/data/equities/tearsheet/summary?s=%1

I then had to lookup the FT symbols for each of my stocks/funds, which are completely different to Yahoo, and update each individual investment on the investments page.
I also had to change the "Factor" on just one of the funds from 0.01 to 1 because FT give that fund as pounds rather than pennies.

I only have a few stocks and funds so this didn't take long but I'd hate to have to do it if I had dozens of holdings!
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Stocks price update not working

Fri May 26, 2023 10:40 am
Thanks for the info. Source code updated.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
User avatar
Section_8
Registered Member
Posts
61
Karma
0
OS

Re: Stocks price update not working

Fri May 26, 2023 11:42 am
Ok, I have tentatively found a Yahoo finance URL that seems to be working, at least for the moment:
URL:
Code: Select all
https://query1.finance.yahoo.com/v8/finance/chart/%1

Identifier: %1
Identify by: Symbol
Price:
Code: Select all
"regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)

Date:
Code: Select all
"regularMarketTime":([\d]+)
gnull
Registered Member
Posts
21
Karma
0
OS

Re: Stocks price update not working

Sat May 27, 2023 10:14 am
Hello,

Based on the content of this article published during May 2022, https://cryptocointracker.com/yahoo-finance/yahoo-finance-api, my understanding is that Yahoo Finance API's have bot been suddenly stopped. The version V7 of API have been simply removed from service and it is needed now to use new version and new syntax to retrieve data :

And so
- Basic API is now at version 11,
- Specific API used to retrieve historical data is now version 8, indeed wit URL="https://query1.finance.yahoo.com/v8/finance/chart/" as mentioned above by Section_8
User avatar
watchstar
Registered Member
Posts
38
Karma
0

Re: Stocks price update not working

Sun May 28, 2023 7:19 pm
The solution posted by Section_8 worked! At least for now. Thank-you Section_8.
User avatar
Section_8
Registered Member
Posts
61
Karma
0
OS

Re: Stocks price update not working

Tue May 30, 2023 9:11 pm
FYI, some of those yahoo finance URLs in that article referenced by gnull seem to depend on the type of equity involved. So, for example, in my testing, just by pasting URLs into firefox:
Code: Select all
https://query1.finance.yahoo.com/v11/finance/quoteSummary/%1?modules=financialData
retrieves data if %1 is a stock ticker symbol. Many of my investments are mutual funds, and if I use a mutual fund symbol for %1 in that URL, I just get back JSON data with an error of "Not Found"

I *think* that URL I posted above works (for now) for everything, but anyone only interested in stocks may have other options.
boingy
Registered Member
Posts
16
Karma
0

Re: Stocks price update not working

Wed May 31, 2023 5:33 am
Section_8 wrote:FYI, some of those yahoo finance URLs in that article referenced by gnull seem to depend on the type of equity involved. So, for example, in my testing, just by pasting URLs into firefox:
Code: Select all
https://query1.finance.yahoo.com/v11/finance/quoteSummary/%1?modules=financialData
retrieves data if %1 is a stock ticker symbol. Many of my investments are mutual funds, and if I use a mutual fund symbol for %1 in that URL, I just get back JSON data with an error of "Not Found"

I *think* that URL I posted above works (for now) for everything, but anyone only interested in stocks may have other options.


It seems like Yahoo are on a mission to block this sort of access so I would not be optimistic that the new URLs will work for long.
The Financial Times URL I listed earlier in this thread is working for my (small number of) UK stocks and funds. I haven't tested it extensively but I'm going to stick with that until I find a reason not to.

We should run a sweepstake for which supplier URL will stop working first!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]