Agree on the YahooJSON take. Given that Yahoo is a huge boat, though, it 
probably requires huge momentum to rinkle the feathers and make changes like 
that.

For AV, I think embedding a single constant API key, which could be over ridden 
with an env var or from GNC, would work equally well as opposed to creating a 
random one. My belief is that when key is not valid it is ignored altogether 
and uses only IP for tracking to limit 25/day limit. While the change to 
provide a random key would be trivial, I would be concern with adding another 
module dependency to do so. May be simple like this might suffice:

  $this->{API_KEY} = $ENV{'ALPHAVANTAGE_API_KEY'} || join '' => map $set[rand 
('A' .. 'Z')], 1 .. 16;

I been using API from Bank of Italy 
(https://tassidicambio.bancaditalia.it/terzevalute-wf-ui-web/assets/files/Operating_Instructions.pdf)
 in my own custom module and that API seems to be fine without need for a API 
key or any wizardry from http.  Good thing about Bank of Italy JSON reply is 
that it provides date for the query of last exchange rate or you can specify a 
date for the exchange rate to get in the request.   

-----Original Message-----
From: Bruce Schuck <bsch...@asgard-systems.com> 
Sent: Monday, January 06, 2025 12:29 PM
To: gnucash-user@gnucash.org
Cc: 'Tomas Volf' <~@wolfsden.cz>; 'David H' <hell...@gmail.com>; Kalpesh Patel 
<kalpesh.pa...@usa.net>
Subject: Re: [GNC] Problem getting Finance::Quote working

On 1/6/25 6:58 AM, Kalpesh Patel wrote:

> Bruce, wasn't there a chatter few releases earlier to move away from 
> AV being default as the currency conversion module by F::Q? Did that 
> culminate into a change?

> I have been overwrite it using 'FQ_CURRENCY=YahooJSON' so haven't 
> followed it's full development as keenly as I should.
Kalpesh,

There did not seem to be much enthusiasm or interest, so at that time the idea 
died on the vine. Pretty much all the "stable" sources require an API 
key/token, as we all well know that using YahooJSON can be problematic when 
Yahoo makes changes.

Since AlphaVantage for the time being allows any string, I have been toying 
with the idea of generating a random API token in the AV currency module is one 
is not supplied. Easy add using String::Random to produce what looks like a 
regular 16 character AV token. I am going to change it to have the environment 
variable take precedence over what may have been passed in.

Bruce S

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to