[GNC] Revisiting Quotes (Bruce Schuck)

Bruce Schuck bschuck at asgard-systems.com
Tue May 30 01:32:19 EDT 2023


> While I would confirm if the Python source is grabbing the normal 
> webpage or the API calls we use(d) in F::Q, this did give me the idea
> to search CPAN. I found the module Yahoo::Finance which may also be a
> good start and possibly does the heavy lifting already.

Colin,

The Yahoo::Finance Perl module is based on the 
https://query2.finance.yahoo.com/v7/... URL. So it's currently broken. 
Looking at the source for the yfinance Python library, it uses a couple 
different Yahoo URLs including at least one instance of a 
https://query2.finance.yahoo.com/v10/... URL.

Which means that if Yahoo blocks access to the v10 and v11 URLs, both 
Finance::Quote::YahooJSON and yfinance will break.

It was worth a look though.

As I said, extracting the data from the HTML returned from 
https://finance.yahoo.com/quote/AAPL?p=AAPL&.tsrc=fin-srch is doable. 
Just not as simple as parsing JSON. I recently created the 
Finance::Quote::BVB module to replace a broken module of a different 
name for Romanian stocks. It is a web scrape of the HTML.

Thanks.

Bruce S.


More information about the gnucash-user mailing list