Bug 507426 - Failure to Automatically Retrieve Quotes from Yahoo Finance for Certain Securities.
Summary: Failure to Automatically Retrieve Quotes from Yahoo Finance for Certain Secur...
Status: RESOLVED FIXED
Alias: None
Product: alkimia
Classification: Frameworks and Libraries
Component: Online quotes widget (other bugs)
Version First Reported In: 8.2.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-24 07:10 UTC by origamy.39
Modified: 2025-07-29 08:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.2.1
Sentry Crash Report:


Attachments
Capture (203.02 KB, image/png)
2025-07-24 07:10 UTC, origamy.39
Details
Screenshot of onlinequoteseditor (576.91 KB, image/png)
2025-07-24 13:02 UTC, Ralf Habacker
Details
Capture (148.78 KB, image/png)
2025-07-25 10:56 UTC, origamy.39
Details
Error with new params (135.33 KB, image/png)
2025-07-26 09:43 UTC, origamy.39
Details
Params (119.07 KB, image/png)
2025-07-26 11:02 UTC, origamy.39
Details
Attachment showing my issue with a US security (246.55 KB, image/png)
2025-07-26 11:49 UTC, Michael Carpino
Details
Finally (119.49 KB, image/png)
2025-07-26 14:02 UTC, origamy.39
Details

Note You need to log in before you can comment on or make changes to this bug.
Description origamy.39 2025-07-24 07:10:45 UTC
Created attachment 183479 [details]
Capture

Description:

When I attempt to automatically update security prices via Yahoo Finance, an error occurs, preventing the retrieval of quotes for some securities. For instance, for the TotalEnergies stock, whose Yahoo identifier is TTE.PA, the retrieval fails despite using the correct identifier.

KMyMoney Version: 5.2-4526
Operating System: Ubuntu 25.04

Steps to Reproduce (the bug):

    Open KMyMoney.

    Navigate to the 'Accounts' or 'Investments' tab.

    Click the "Update currency and security prices" (or "Update selected") button.

    Wait for the update operation to complete.

Observed Behavior:

A "Failed to update c..." dialog appears, indicating the inability to receive a quote for specific securities (e.g., TTE.PA) from Yahoo Finance. The message also mentions redirection issues or an inability to download the URL (The URL has been redirected to ... Impossible de télécharger l'URL). This suggests that the online quote source for Yahoo Finance is no longer functional or requires an update to the URL used by KMyMoney.

Expected Behavior:

Security prices should be updated correctly and automatically from Yahoo Finance without errors. The online quote retrieval function should be robust to URL changes or redirections.

Attachments:
Please refer to the attached screenshot ("Capture d’écran du 2025-07-24 09-05-33.png") which shows the error message.

Reminder for the form fields:

    Product: kmymoney

    Component: onlinequotes

    Version First Reported In: git (master)

    Severity: major

    Platform: Other

    OS: Linux
Comment 1 Ralf Habacker 2025-07-24 13:02:23 UTC
Created attachment 183486 [details]
Screenshot of onlinequoteseditor

Have you tried to use the Source "Yahoo.com [Stock]", which can be installed by menu entry:  Settings->KMyMoney Settings->online Quotes->install.

The screenshot shows a test with onlinequoteseditor5, the test application for online quote sources, which works without any problems with the requested security. KMyMoney uses the same library for fetching online quotes, so it should also work there.
Comment 2 origamy.39 2025-07-25 10:55:33 UTC
it works for stocks, not for currencies...
Comment 3 origamy.39 2025-07-25 10:56:09 UTC
Created attachment 183506 [details]
Capture

Here's a capture
Comment 4 Ralf Habacker 2025-07-25 12:09:28 UTC
The reason for this is that the actual way in which the symbol to be searched for is constructed in the URL does not match the expectations of the yahoo.com service.

It is composed as USD-EUR, whereas it is expected to be USDEUR=X, which works as expected:

https://query2.finance.yahoo.com/v8/finance/chart/USDEUR=X?events=history&includeAdjustedClose=true&period1=1753394400&period2=1753444886&interval=1d

Here is a recipe for how to solve the problem locally:
1. Create a duplicate of the source ‘yahoo.com [Currency]’
2. Select the generated source
2. In the edit window, replace ‘%1-%2’ in the URL with ‘%1%2=X’ and save. 

It should work with the new source.
Comment 5 Thomas Baumgart 2025-07-26 07:00:30 UTC
Update status
Comment 6 origamy.39 2025-07-26 09:43:45 UTC
Created attachment 183528 [details]
Error with new params

It fails
Comment 7 Ralf Habacker 2025-07-26 10:14:06 UTC
(In reply to origamy.39 from comment #6)
> It fails
It looks like retrieving data is now working, but no data is available for the specified period. Please set the start date to end date - 1, which should then provide data.
Comment 8 Ralf Habacker 2025-07-26 10:17:46 UTC
(In reply to Ralf Habacker from comment #4)
> The reason for this is that the actual way in which the symbol to be
> searched for is constructed in the URL does not match the expectations of
> the yahoo.com service.

I have updated the online source for “yahoo.com [currency]” (see https://www.pling.com/p/1284581), which should be installable soon.
Comment 9 origamy.39 2025-07-26 11:02:29 UTC
Created attachment 183531 [details]
Params

Sorry, i don't know where do this adjustement...
Can you explain to me
Comment 10 Michael Carpino 2025-07-26 11:49:12 UTC
Created attachment 183533 [details]
Attachment showing my issue with a US security

I am having this issue as well with 4 of my securities.
Comment 11 Ralf Habacker 2025-07-26 13:33:20 UTC
(In reply to origamy.39 from comment #9)
> Created attachment 183531 [details]
> Params
> 
> Sorry, i don't know where do this adjustement...
> Can you explain to me

See the date fields in this screenshot (attachment 183506 [details])
Comment 12 Ralf Habacker 2025-07-26 13:43:41 UTC
(In reply to Michael Carpino from comment #10)
> Created attachment 183533 [details]
> Attachment showing my issue with a US security
> 
> I am having this issue as well with 4 of my securities.

This is also caused by the service, which does not return a value for today (as it does not provide values on weekends). You should set the start date to the end date - 1 or, if that does not help, to -2 days.
Comment 13 origamy.39 2025-07-26 13:45:27 UTC
Fine, but...

"You should set the start date to the end date - 1 or, if that does not help, to -2 days"

How to? Please
Comment 14 origamy.39 2025-07-26 14:02:56 UTC
Created attachment 183536 [details]
Finally

My bad!

This works fine!

I havn't see the selector under...

Thanks a lot!

I love kmymoney!
Comment 15 Ralf Habacker 2025-07-28 13:51:57 UTC
Git commit f818de53841a312e26b36cd8a5f1b43a3814d262 by Ralf Habacker.
Committed on 28/07/2025 at 13:50.
Pushed by habacker into branch 'master'.

Avoid not receiving data at the weekend also for sources fetching currencies

To avoid potential problems when retrieving data on weekends, the start
date for currency conversion queries is now also moved to one day before
the weekend. If this happens, a signal is triggered with the changed
date values so that they can be adjusted in the user interface.

Followup for commit e910fe7cb.
FIXED-IN:5.2.1

M  +6    -0    src/alkonlinequote.h
M  +2    -3    src/alkonlinequote_p.cpp

https://invent.kde.org/office/alkimia/-/commit/f818de53841a312e26b36cd8a5f1b43a3814d262
Comment 16 Thomas Baumgart 2025-07-29 08:44:36 UTC
Git commit a7d023d1e0841e9f29ccce5c6a086cb4920f0755 by Thomas Baumgart, on behalf of Ralf Habacker.
Committed on 29/07/2025 at 08:43.
Pushed by tbaumgart into branch '8.2'.

Avoid not receiving data at the weekend also for sources fetching currencies

To avoid potential problems when retrieving data on weekends, the start
date for currency conversion queries is now also moved to one day before
the weekend. If this happens, a signal is triggered with the changed
date values so that they can be adjusted in the user interface.

Followup for commit e910fe7cb.
FIXED-IN:5.2.1

(cherry picked from commit f818de53841a312e26b36cd8a5f1b43a3814d262)

M  +6    -0    src/alkonlinequote.h
M  +2    -3    src/alkonlinequote_p.cpp

https://invent.kde.org/office/alkimia/-/commit/a7d023d1e0841e9f29ccce5c6a086cb4920f0755