Gnucash not able to retrieve stock quotes from Yahoo Finance USA fix to USA.pm

If you use Gnucash with stock quotes, you would have found that since early February 2014, it is not able to fetch the stock quotes of companies such as AMZN, IBM, MSFT from the NYSE. Yahoo Finance is the source for Gnucash to retrieve these quotes from the NYSE. Yahoo Finance has made a change to the URL and to make it work, you need to do the following steps:

$ cd /usr/share/perl5/Finance/Quote/Yahoo <enter>
$ sudo vi USA.pm <enter>

Look for a string that says
$YAHOO_URL = ("http://finance.yahoo.com/d");
Replace it with
$YAHOO_URL = ("http://finance.yahoo.com/d/quotes.csv");
:wq

If you are not comfortable with the vi editor, you can do the same steps, but using gedit or mouspad.
$ sudo mousepad USA.pm <enter>

Now scroll through and change the URL as explained above. Save the program.

At the terminal command line, test as follows:
$ gnc-fq-dump yahoo MSFT <enter>

You should see the stock quote. If not, go back and check to make sure you edited the USA.pm file correctly.

Now you can retrieve the US stock quotes from the NYSE using Get Quotes within Gnucash.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s