Kmymoney updating stock & mutual fund issue

Hello, I have been successfully updating my mutual fund securities for quite a long time using Kmymoney Ver. 5.1.3. However, since a few days ago, when I try to update I get the following error message:
Timeout on server query1.finance.yahoo.com: Socket operation timed out
Unable to update price for VBIAX (empty quote data)
I shall appreciate it if some one kindly provide a solution to this issue. Thanks in advance!

1 Like

In settings change the “v7” to “V6” in the URL for yahoo finance.

Thank you! That did it.

That was also changed yesterday. V6 stopped working and now, when you go back yo V7 there is a message to provide feedback about the API for developers. Went there and they are asking if you be willing to pay.

In the meantime, I started using an AlphaVantage API (free API key) and I am able to retrieve values using the web call. My only issue is that I can’t decipher how to extract the prices into KMyMoney.

Here is a sample call provided by them and the response. If someone can help on how to extract the price and date would be appreciated.

https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=IBM&apikey=demo

{
“Global Quote”: {
“01. symbol”: “IBM”,
“02. open”: “127.8200”,
“03. high”: “127.9000”,
“04. low”: “125.4700”,
“05. price”: “125.6800”,
“06. volume”: “3915505”,
“07. latest trading day”: “2023-05-24”,
“08. previous close”: “128.1800”,
“09. change”: “-2.5000”,
“10. change percent”: “-1.9504%”
}
}

Hello,

Thanks for pointing at to this source. I am using below settings (with yahoo symbols) and that seems to be working at my place:

URL: https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=%1&apikey=YOUR-API-KEY

(obviously provide your API key instead of “YOUR-API-KEY”)

URL of CSV:

(leave blank)

Symbol: %1

Identify by: Symbol

Price: “05. price”: “(\d+.\d+)”

Date:

(leave blank)

Date Format:

(leave blank)

  • tick the HTML strip stuff

Apologies as I am not using an english version of kmymoney I had to backtranslate the fields name which can be slightly wrong nevertheless the field orders should be the same

Cheers

Your link text is different from the underlying link. One is showing symbol=%1, while the actual link has symbol=%251.

FYI: if you click on Install, there is an entry for Alphavantage that works.

Thanks, updated my post according to your remark.

Could you please advise more details on where to click “Install” ?

The free Alphavantage plan only allows fetching 5 quotes per minutes so it is not suitable to “update all” quotes at once but work for slowly updating each quote one by one making sure not to speed above one update every 12 seconds :cry: If anyone has an other website that provides the service that Yahoo used to provide, I would be pleased to hear !


Look in the &Online quotes section, to the right of the names.

At least Alphavantage still works, albeit slowly as you mentioned.

I am still able to get quotes from Yahoo with the following settings:
URL: https://query1.finance.yahoo.com/v8/finance/chart/%1
Identifier: %1
Identify by: Symbol
Price: "regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)
Date: "regularMarketTime":([\d]+)

2 Likes

Glad you’re still able to use Yahoo, but for how long? Every financial app or Python library I’ve used has been fighting their API changes basically non-stop. For me, it’s just not worth the hassle.

Now to figure out how to get my Kraken quotes…

I’ve been travelling for a month and get back to find quotes for KMyMoney are not working. V6, V7, V6, VPI, V\sqrt(2), nothing seems to work. What’s the latest? thanks

Some one suggested use of v8 which works for me.

I got frustrated at having to fiddle with the Yahoo settings so I switched to using the Financial Times. Details in my post on the old forum:

Stocks price update not working • KDE Community Forums

It’s been working fine for about six weeks now although there are no guarantees it will work in the future.

Yes, following Section 8 and Mahmood, I am now getting quotes. Gracias

Glad that I could help!

As of August, retrieving quotes from Yahoo has not worked for me. Alphavantage still seems to work as long as I get my quotes prior to 0400 GMT. The working solution suggesting v8 URL returns a message of unauthorized and no date or price for the selected stock. I am suspecting that Yahoo is trying to make it difficult to download prices into accounting and other financial analysis software.

Has anyone found a solution that works with either Yahoo or a different US-based API? I am looking for US-based stock data.

I switched to Financial Times, works fine with the US stocks I’m tracking. You can also try Google Finance; made a config listed here: Download stock quotes from Google Finance - #4 by ajgringo619.

I just downloaded from yahoo with no problems. URL is https://query1.finance.yahoo.com/v8/finance/chart/%1 However, I have no doubt they will eventually find yet another way to break it. I wonder if they have partial roll outs of changes, so not everybody gets hit at the same time.

I was able to get version 8 of Yahoo finance to work. Between the version number changes in the API and the newest regex expressions. Here is a screenshot of my final settings:

1 Like

I have given up on trying to keep up with Yahoo Finance. I now use a small python script with KmyMoney to retrieve quotes from Twelve Data - https://twelvedata.com/. Twelve Data is similar to Alphavantage - it requires a free API key and limits quotes to 8 per minute (I switched from Alphavantage because I have a few mutual funds which Alphavantage does not support).

I do not mind posting this script here, but there are a couple of caveats.

First, it will require a fair amount of documentation, not yet written. It requires some setup - at the minimum, a config file with your API key.

Second, I have not been able to get it working with KmyMoney on Windows. I use kmm on Linux, but have Windows 10 installed in a virtual machine. I have installed kmm and python there and tried this script. It will run from a windows command prompt, but I was unable to use it with kmm there to retrieve a quote.