Yahoo Finance Quotes

UUID: yfquotes@thegli
Last edited:
6 days ago 2024-04-19, 08:20
Last commit: [a732cf56] yfquotes@thegli: Add Dutch translation (#1138)

Displays financial market information such as stock quotes and commodity prices from Yahoo Finance

README

Close

Cinnamon Desklet for Yahoo Finance quotes

Description

This repository contains a desklet for the Cinnamon desktop environment that displays financial market information provided by Yahoo Finance.

Screenshot

This desklet is based on the desklet from fthuin. The data retrieval part is adopted to an alternative service url, after the Yahoo Finance community table got retired in May 2017.

Tested with

  • Linux Mint Cinnamon 17 up to 21
  • Debian 9 with Cinnamon 3.2
  • Manjaro with Cinnamon 3.8
  • Fedora 38 Cinnamon Spin with Cinnamon 5.6 and libsoup3

Installation

Either follow the installation instructions on Cinnamon spices (recommended), or manually download the directory yfquotes@thegli (below "files") and copy the directory and its content to ~/.local/share/cinnamon/desklets/

Configuration

Check out the desklet configuration settings, and choose the data refresh period, the list of quotes to show, and quote details to display. The default list contains the Dow 30 companies.

Troubleshooting

Problem: The desklet fails to load data, and shows error message "Status: 429 Too Many Requests".
Solution: Enable option Send custom User-Agent header found on the first tab "Quotes" in the configuration settings.

Debug Logging

Only enable debug logging in case of problems, and when you know why you need it!

The log output goes to the standard file ~/.xsession-errors. All log messages produced by this desklet contain "yfquotes@thegli", so we can filter by this text. By default, the desklet logs only abnormal situations.

Significantly more log output can be generated when the debug log mode is active.
To activate the debug log mode, create an empty file "DEBUG" in the desklet installation directory, e.g. with the command touch ~/.local/share/cinnamon/desklets/yfquotes@thegli/DEBUG
Then the Cinnamon desktop needs to be restarted in order to re-initialize the desklet. This can be done by pressing Ctrl-Alt-Esc, or by logout/login.

To disable the debug log mode, delete the "DEBUG" file, and restart the Cinnamon desktop.

Release Notes

0.11.0 - March 15, 2024

Features:

  • new setting to customize font color and font size
  • new setting to customize date and time format (see date man page for options)
  • new setting to control vertical scrollbar

0.10.0 - March 4, 2024

Features:

  • add Spanish translation (courtesy of haggen88)
  • add Finnish translation (courtesy of MahtiAnkka)
  • update Hungarian translation (courtesy of KAMI911)
  • update Danish translation (courtesy of Alan01)
  • update Italian translation (courtesy of Dragone2)
  • brush up this README document
  • implement an optional debug log mode for tracing and analysis of unexpected problem situations

Bugfixes:

  • handle HTTP response status codes not supported by libsoup3
  • update DOW 30 component symbols

0.9.0 - August 28, 2023

Features:

  • support cookie consent process for EU region
  • setting for User-Agent header is now active by default
  • include status details in error message
  • add Romanian translation (courtesy of AndreiMiculita)

Bugfixes:

  • remove obsolete setting to select Yahoo Finance Quotes API version, because V6 got disabled
  • general code refactoring, and logging improvements

0.8.7 - July 19, 2023

Features:

  • add setting to include a User-Agent header in Yahoo Finance Quotes API requests
  • update Hungarian translation (courtesy of KAMI911)

0.8.6 - June 5, 2023

Bugfixes:

  • fix libsoup3-specific code

0.8.5 - May 25, 2023

Bugfixes:

  • adapt to recent changes in Yahoo Finance Quotes API

0.8.4 - May 8, 2023

Features:

  • new setting to select the version of Yahoo Finance Quotes API
  • update Danish translation (courtesy of Alan01)
  • update Hungarian translation (courtesy of KAMI911)
  • update Italian translation (courtesy of Dragone2)

0.8.3 - September 15, 2022

Bugfixes:

  • add support for libsoup3 (courtesy of fredcw)

0.8.2 - June 8, 2022

Bugfixes:

  • check timer reference before calling Mainloop.source_remove()

0.8.1 - May 16, 2022

Features:

  • update Brasilian and German translations
  • fetch finance data asynchronously to improve responsiveness

Bugfixes:

  • do not color percentage change value when corresponding setting is not selected
  • increase default desklet width
  • update screenshot image
  • fix syntax errors in README.md

0.8.0 - January 12, 2022

Features:

0.7.0 - January 10, 2022

Features (courtesy of sulonetskyy):

  • add symbolic trend change icons instead of .svg
  • add configurable trend change colors instead of hardcoded colors
  • add configurable strict rounding
  • add UAH and RUB currency symbols
  • change table items view (text align to the left, numbers/dates align to the right)

0.6.0 - June 18, 2021

Features:

  • change layout of settings dialog to tabbed views
  • new setting to use alternative colors (use blue instead of green)
  • add Hungarian translation (courtesy of KAMI911)

0.5.2 - February 7, 2021

Features:

  • add Italian translation (courtesy of Dragone2)
  • add Korean translation (courtesy of chaeya)
  • optimize png files (courtesy of NikoKrause)

Bugfixes:

  • correct a msgid in translation files

0.5.1 - December 20, 2020

Features:

  • incorporate Danish translation (courtesy of Alan01)

Bugfixes:

  • update DOW 30 component symbols
  • resolve various issues reported by Codacy

0.5.0 - October 4, 2020

Features:

  • new setting to color percentage change according to trend. Enabled by default if percentage change is displayed. Courtesy of plaihonen.
  • new setting to add Yahoo Finance hyperlink to symbol/quote. Enabled by default if symbol is displayed. Proposed by ngaro.
  • new setting to use long version for verbose quote name. Enabled by default if verbose name is displayed. Courtesy of ngaro.

0.4.2 - September 20, 2020

Bugfixes:

  • update translation files with new setting
  • extend desklet description for better searchability

0.4.1 - August 18, 2020

Features:

  • add setting to disable quote name hyperlink

Bugfixes:

  • remove invalid quote symbol from default list

0.4.0 - July 17, 2020

Features:

  • allow multiple desklet instances
  • add German translation

0.3.0 - June 29, 2020

Features:

  • add setting to sort quotes list
  • update DOW 30 component symbols

Bugfixes:

  • auto-retry in case of connection problem (e.g. TLS handshake)

0.2.0 - May 23, 2018

Features:

  • show absolute price change amount
  • show last trade time/date
  • show timestamp of latest data refresh
  • add setting to configure rounding rule
  • make background transparency configurable
  • quote name links to Yahoo Finance details page
  • display severe errors such as network failure

Bugfixes:

  • improve error handling

0.1.0 - May 6, 2018

Features:

  • minor description adjustments in configuration settings

Bugfixes:

  • fix "value "nan" of type 'gfloat' is invalid or out of range for property" errors logged in .xsession-errors
  • works (again) with Cinnamon 3.2

0.0.1 - May 4, 2018

Features:

  • setting to show/hide the currency symbol

Bugfixes:

  • change data retrieval to alternative url from Yahoo Finance

Credits

Based on the desklet source code from fthuin.

License

GNU General Public License v3.0

Log In To Comment!

55 Comments

Gustavo Sobreiro de Assis
great desklets, thanks
Gerald Drißner
Gerald Drißner-8 months ago
Has anyone succeeded in making it work again? The user-agent-header did not fix it on my setup. I'd appreciate any workaround or fix. THANKS!
Thomas Egli
Thomas Egli-8 months ago
Hi Gerald It looks like Yahoo does triage requests based on device, and geolocation. The user-agent feature addresses only the former. Do you, by chance, reside in a EU country? (my bet would be Germany)
Heny67
Heny67-8 months ago
Hi Thomas! I know you didn't write to me, but if it helps, I live in Hungary.
Thomas Egli
Thomas Egli-8 months ago
Hi Heny67 Thank you for your reply. You confirm my assumption that the cause of the problem is a different routing of the requests. Apparently, EU citizens enjoy the pleasure of a cookie consent screen. Since the desklet cannot handle this alternative flow, the necessary access data gathering fails, and with that, any quotes data retrieval requests. I live outside of the EU, and therefore never got confronted with this situation (so far). Let me think about how this consent flow can be handled by the desklet. Off-topic: Fantastic World Athletics Championships your country is currently hosting!
Heny67
Heny67-7 months ago
Hi Thomas! I would like to note that I am not a programmer, I just hope my experience will help in the development. There are two things that could be related to the problem. 1. I can retrieve the data from the yahoo finance page without any problems. Sometimes it happens that I have to refresh the page several times because there are no results, but this is not common. 2. I use a personal financial software (money manager ex) where it is not possible to update stock and currency exchange rates in the same way. Even to this day, they have not been able to solve this problem there either. Off: Thank you for the recognition from the Athletics competition! :-)
Thomas Egli
Thomas Egli-7 months ago
I just prepared a new PR that addresses the cookie consent situation. Hopefully this should make the desklet working again for everyone.
Gerald Drißner
Gerald Drißner-7 months ago
YES, it works now! Many thanks for you work!!
Heny67
Heny67-7 months ago
Hi Thomas! It works fine now, thank you!
Heny67
Heny67-8 months ago
Hi! No, it still doesn't work.
Heny67
Heny67-9 months ago
No changes.
Heny67
Heny67-9 months ago
Hi! I get "yahoo finance service is currently unavailable" message with both v6 and v7 api!
Thomas Egli
Thomas Egli-9 months ago
V7 is the one to use. The old V6 was shut down. The latest version (released yesterday) brought a feature for this (new) "service unavailable" problem: 1. Open the settings dialog (right-click on desklet, then select "Configure...") 2. Enable the new option "Send custom User-Agent header" (at the bottom on the first tab) 3. Leave the default value, and close the settings dialog. The setting applies immediately, and quotes data should appear again. Hope this helps.
wp-dave
wp-dave-8 months ago
FWIW, the above instructions worked for both my linux (Linux Mint 20.3) machines. One machine I had to give the old Ctrl-Alt-Esc for resetting Cinnamon just after the "Configure.." option in the instructions. My other machine, the polling for Yahoo Finance worked without manual intervention. The only difference, really, is that the first machine has a ton of apps on this installation so I don't know if, with a bit of patience, the polling would have worked without my intervention.
wp-dave
wp-dave-8 months ago
..what I meant to say was.. after the instructions, if the polling doesn't work, the reset Cinnamon. Just to clarify..
Heny67
Heny67-9 months ago
No changes.
Thomas Egli
Thomas Egli-9 months ago
I just checked, and it (still) works on my end, even without the new setting.
Thomas Egli
Thomas Egli-9 months ago
Thank you for the screenshot to verify the configuration. It really looks like the new setting does not help to circumvent the reduced availability of the Yahoo Finance service in your case. That's too bad. Unfortunately I don't have any other option to offer, except to keep on trying. I observed that after some time, the service gets responsive again.
Goodolandy
Goodolandy-9 months ago
That just started today for me.
Thomas Egli
Thomas Egli-11 months ago
FYI: I prepared a new PR that should/will fix the recent issues with V7. Stay tuned...
wp-dave
wp-dave-9 months ago
The latest bugfix worked for me. Thanks, Thomas.
asp1
asp1-11 months ago
Hi Thomas, Thanks a lot for your nice desklet and its quick fix! Great job!
Gerald Drißner
Gerald Drißner-11 months ago
Great applet - however, since 7th of May 2023, there is a connection error to yahoo on my system. Does anyone else have this problem?
David
David-11 months ago
Sorry to report that the problem has returned - May 24 05:20 GMT
David
David-11 months ago
On a whim - using "sed" as I reset to V7 - it didn't work so I went back to V6 - still no luck.
Thomas Egli
Thomas Egli-11 months ago
You are correct, the V6 no longer works right now (returns a 404). As always, it is unclear whether this is a temporary outage, or the V6 endpoint got retired. Since the V7 endpoint now requires authentication, I cannot provide any quick fix this time.
David
David-9 months ago
The long term fix you did for authenticating the V7 endpoint was just now updated on my computer 30/6/23 - 11:25 (GMT+3). It works! THANKS THOMAS!
Thomas Egli
Thomas Egli-11 months ago
Something changed on the Yahoo API, and a 401 error is currently returned for each request. I don't know if and when it will be fixed - a similar problem occurred a few weeks ago. As a quick workaround, we can fallback to an older endpoint of the API. We just need to change the URL in the desklet: 1. Open a terminal. 2. Execute the following sed command: sed -i 's/v7/v6/g' ~/.local/share/cinnamon/desklets/yfquotes@thegli/desklet.js 3. Restart Cinnamon, e.g. with the shortcut Ctrl+Alt+Esc, or by log out and in again. Hope this helps.
Shimon Rura
Shimon Rura-11 months ago
Thanks, this worked for me too!
wp-dave
wp-dave-11 months ago
Thanks Thomas, that fix worked for me. Appreciate the fast response!
David
David-11 months ago
Thanks Thomas! I did as you suggested and it worked. I wonder if we may lose some functionality in the future by using the older Yahoo API. But that is for another day - for now, I'm happy, thanks to you!
Stephen Merrony
Stephen Merrony-11 months ago
Worked for me, thanks.
Gerald Drißner
Gerald Drißner-11 months ago
Hi, thank you for your quick reply and help! I tried it, but unfortunately, it didn't work. I did not get the exchange rates/prices. I only got the "symbols" replicated, e.g., EURUSD=X - but no result. I hope that yahoo won't shut down the access. Thanks for your work!
Thomas Egli
Thomas Egli-11 months ago
Too bad that it doesn't work for you, as this did the trick on my machine. But at least no more error message ;-) Maybe it helps if you reset the desklet (via context menu "Configure...", then menu entry "Reset to default"). Note that your current list will be replaced with this.
Gerald Drißner
Gerald Drißner-11 months ago
Now, it also works with your fix!!! Thanks a lot (don't ask me why it suddenly worked...)
sbadux
sbadux-2 years ago
Thank you very much for this applet. Super-useful and customizable. I love it.
michaeltjester
michaeltjester-2 years ago
Is it currently possible to add a memo to the line items? My goal is to input my cost for each of the stocks that I am tracking so that I can keep track of where I am at and whether I should sell easily.
Thomas Egli
Thomas Egli-2 years ago
Sorry but no, that is not possible. This desklet is not intended for portfolio management.
Goodolandy
Goodolandy-3 years ago
Hello, great desklet. I was wondering, is it possible to add an option to input number stocks owned next to each stock and the total value being displayed?
rijabo
rijabo-3 years ago
one of a kind and very useful and working. Would love to have the possebility to change border/no border and change the font color white to some other color. But like i said. Great desklet
Thomas Egli
Thomas Egli-3 years ago
Thank you for your interest. The styles are defined in a CSS file, found at ~/.local/share/cinnamon/desklets/yfquotes@thegli/stylesheet.css. Feel free to change them to your liking. You might want to make a backup of your modifications, as the file will get overwritten on the next desklet update.
Foxbille
Foxbille-3 years ago
Hello, Thanks for this very useful desklet, but is it possible make a small modification of the code to grab data from EuroNext ? (and get French quotations values) Eric
Thomas Egli
Thomas Egli-3 years ago
I have no plans to integrate other financial information provider; the desklet is called Yahoo Finance Quotes for a reason :-) Out of curiosity, for which French quotes are you looking for?
Foxbille
Foxbille-3 years ago
Thanks for your answer. I'm looking for ALBLU,ALCRB, CLA, EDEN, EPS, ALESK, GTT, IPH, ALMDG, DIM, BN, PUB, SCR, EO, KORI, SPIE, NEX, ELIOR, COFA, IPS, FNAC, ABIO, SII, NRG, POXEL, IGE and LFDE
Thomas Egli
Thomas Egli-3 years ago
I haven't tested all of them, but the ones I picked were all available. Just append .PA to your symbol, and you get ALBLU.PA, CLA.PA, NEX.PA etc. You can look them up on https://finance.yahoo.com to find out what Yahoo Finance Quotes uses. French stocks usually have a "PA" (for Paris) suffix. Try it out :-)
Foxbille
Foxbille-3 years ago
Works fine !!! Thanx a lot ;-)
plaihonen
plaihonen-3 years ago
Hi, quite useful desklet. I have some suggestions though. * Title on top of the desklet. This would be useful if more than one instance. The "updated" info could be moved from the bottom to the top with the title. * Option to add divider. This could be something like "---" in the quote symbols list. I have no clue how challenging this would be to program with the existing sorting functionality. * Option to align left. This would improve readability. At least with the longer "Verbose name" the impact would be significant.
Thomas Egli
Thomas Egli-3 years ago
I remember that I tried left alignment once. If the listed quote names have more or less the same length, then it looks better than centered, but if you have a mix of very short and very long names, then I felt that there is too much space to the next column. So I kept the center alignment, as I couldn't come up with something better, and in the meantime I got used to it. Regarding title and divider/spacer: I never thought about that but the sorting would definitely be a bit of a challenge.
jupiterjosh
jupiterjosh-3 years ago
Excellent desklet! May I make a suggestion that you include words like "stock" or "ticker" in your desklet description? You may find more people downloading the desklet if you add those words. I only found the spice by googling it, but since I was using the words "stock", "price", "ticker" etc, this desklet didn't come up in the desklet search bar.
Thomas Egli
Thomas Egli-3 years ago
Happy you like it. And thanks for your suggestion. I will improve the description in a future update.
newlinuxuser
newlinuxuser-3 years ago
Hi. how to add currency pairs?
Thomas Egli
Thomas Egli-3 years ago
Currency pair symbols follow the pattern "[Target Currency][Base Currency]=X", for instance "EURUSD=X". You can look them up on https://finance.yahoo.com/currencies.
Xcelerate11
Xcelerate11-3 years ago
This desklet is amazing! Does anyone know how I can create multiple instances of this desklet?
Thomas Egli
Thomas Egli-3 years ago
With the latest version, you can now create up to 10 instances.