Skip to content

Switch from Alphavantage to Yahoo for default currency quotes? #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edward-dauvergne opened this issue Mar 12, 2024 · 5 comments
Open
Labels
currency On Hold Needs more details or still under development

Comments

@edward-dauvergne
Copy link
Contributor

edward-dauvergne commented Mar 12, 2024

Alphavantage appear to have recently changed their free access to 25 quotes per day. Previously the limit for their free API key was 5 requests per minute. For me, at least, this is an unacceptable restriction. I have cloned the F::Q repository and my testing quickly stops with annoying output:

[edward@localhost finance_quote_alphavantage_wait]$ ./test.pl 
Using Perl v5.36.0
Using Finance::Quote 1.59

USDAUD: 
$VAR1 = {
          'errormsg' => 'Thank you for using Alpha Vantage! Our standard API rate limit is 25 requests per day. Please subscribe to any of the premium plans at https://www.alphavantage.co/premium/ to instantly remove all daily rate limits.',
          'success' => 0
        };
USDBRL: 
$VAR1 = {
          'success' => 0,
          'errormsg' => 'Thank you for using Alpha Vantage! Our standard API rate limit is 25 requests per day. Please subscribe to any of the premium plans at https://www.alphavantage.co/premium/ to instantly remove all daily rate limits.'
        };

I was wondering if it would be possible to switch to Yahoo web for currency quotes? I have tried in the Gnucash security editor to switch away from the quote source being 'single' and 'Currency', switching to 'Unknown' source set to 'yahooweb', but this is not respected and saved by Gnucash (only 'Currency' via alphavantage can be used).

The queries for the v8 Yahoo interface are very easy, e.g.:

Edit: I meant to say, switch back to Yahoo web for currency quotes. It is really annoying that Alphavantage is now squeezing their free users to switch to very expensive premium accounts!

Edit2: I now see that YahooJSON.pm and YahooWeb.pm are both not suitable for this.

@edward-dauvergne edward-dauvergne changed the title Switch from Alphavantage to Yahoo web for default currency quotes? Switch from Alphavantage to Yahoo for default currency quotes? Mar 12, 2024
@edward-dauvergne
Copy link
Contributor Author

Actually, the YahooJSON.pm module does work of this if the symbol is set to something like USDCHF=X:

@edward-dauvergne
Copy link
Contributor Author

edward-dauvergne commented Mar 12, 2024

Sorry for the noise. I now see that setting the environmental variable FQ_CURRENCY to YahooJSON is the solution! Should this however be set to the default now that AlphaVantage are becoming more and more restricted?

@bpschuck
Copy link
Contributor

@edward-dauvergne,
Not a problem, glad you found the FQ_CURRENCY information. AlphaVantage has made a few changes over the past year that affects the functionality of the module. I have already been thinking of changing the default currency method, as well as searching for alternative data sources. If you know of any please post to the Additional Currency Source discussion thread.
Thank you.
Bruce S.

@edward-dauvergne
Copy link
Contributor Author

Thank goodness for FQ_CURRENCY ;) That's a nice addition. Some people may have a paid subscription for AlphaVantage but, for those who don't, their service is becoming quite limited. I travel a bit, so I have more currencies in GnuCash than the new AlphaVantage daily limit. So unfortunately I can't use it any more. Even though Yahoo has a tendency of pulling the rug out from under your feet, I'm sticking with the environmental variable FQ_CURRENCY=YahooJSON. If there was any vote on the subject, I'd go for Yahoo JSON as the default (until they start playing games again).

Regards,
Edward

@bpschuck
Copy link
Contributor

bpschuck commented Oct 8, 2024

There is a new currency rate source, FinanceAPI. It requires a key from https://financeapi.net/. Their free key is 100 requests per day. Also available is CurrencyFreaks (https://currencyfreaks.com/). Free key 1000 requests/month which is not much better than AV.
The GnuCash team is a bit hesitant to switch defaults. While YahooJSON has been working for a while, we have no guarantee that it will continue to be stable.

@bpschuck bpschuck added currency On Hold Needs more details or still under development labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
currency On Hold Needs more details or still under development
Projects
None yet
Development

No branches or pull requests

2 participants