[GNC-dev] Robust error handling and respecting the Apha Vantage API limits in gnc-fq-helper.

Mike Alexander mta at umich.edu
Wed Feb 12 01:50:46 EST 2020


On 11 Feb 2020, at 8:14, Edward d'Auvergne wrote:

> Although most runs pass, I have noticed that some do not [4].  Have
> you seen that behaviour or know what might be happening?

Sometimes AlphaVantage refuses to return a quote.  Right now

  https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=XAU&apikey=xxx

returns

{}

The ILS quote works now, but must not have been working when you tried 
it.  I don't think this is an F::Q problem.  GnuCash deals with this 
failure and uses the inverse quote.  For example

mta at bayswater /<4>bin>./gnc-fq-dump currency XAU USD
1 XAU = 1565.2 USD
mta at bayswater /<4>bin>./gnc-fq-dump currency USD XAU
1 XAU = 1565.2 USD

Note that they both return the same thing since the other quote doesn't 
work.  GnuCash is smart enough to use an inverset currency rate if the 
one it wants isn't stored.

             Mike


More information about the gnucash-devel mailing list