Finance::Quote still not working with alphavantage

John Ralls jralls at ceridwen.us
Sun Nov 19 12:32:47 EST 2017


> On Nov 19, 2017, at 9:14 AM, Frank Saporito <frank.saporito.md at gmail.com> wrote:
> 
> I have been working on this problem for several days and reluctantly have to
> bother the mailing list members for help.
> 
> I followed the instructions on: 
> 
> https://wiki.gnucash.org/wiki/FAQ#Q:_Why_doesn.27t_online_quoting_work.3F
> <https://wiki.gnucash.org/wiki/FAQ#Q:_Why_doesn.27t_online_quoting_work.3F>  
> 
> I have an alphavantage API key
> I have Finance::Quote ver 1.47
> I run GnuCash in CentOS 6 (not that it matters)
> I have update appended /etc/gnucash/environment as follows:
>    ALPHAVANTAGE_API_KEY= (my api key)
> I restarted GnuCash
> I changed the securities to get online quotes from alphavantage
> 
> Even so, GnuCash price editor is unable to retrieve quotes.
> 
> I believe that, despite the correct API key (I tested it via a LO Calc)
> identified in the environment file, it is not being accepted by GnuCash
> based on the return for the gnc-fq-dump below:
> 
> # gnc-fq-dump -v alphavantage T 
> Finance:: Quote fields Gnucash uses:
>    symbol: T (deduced)          <=== required
>      date: ** missing **        <=== required
>  currency: ** missing **        <=== required
>      last:                      <=\       
>       nav:                      <=== one of these
>     price:                      <=/        
>  timezone:                      <=== optional
> 
> ** This stock quote cannot be used by gnucash!!
> 
> 
> All fields returned by Finance::Quote for stock T
> 
> stock           field  value
> -----           -----  -----
> T            errormsg: Expected ALPHAVANTAGE_API_KEY to be set; get an API
> key at https://www.alphavantage.co
> T                last: **missing**
> T                 nav: **missing**
> T               price: **missing**
> T             success: 0
> 
> I have checked the environment file numerous times.  Gedit was used to
> update the environment file.
> 
> Any suggestions would be greatly appreciated.
> 

The environment file only works when Finance::Quote is called from the GnuCash GUI. You need to set ALPHAVANTAGE_API_KEY as a shell environment variable for gnc-fq-dump to see it.

I've added a bullet to the FAQ item explaining this.

Regards,
John Ralls



More information about the gnucash-user mailing list