yahoo-finance-api icon indicating copy to clipboard operation
yahoo-finance-api copied to clipboard

Statistics Tab

Open eversionsystems opened this issue 3 years ago • 6 comments

I've checked the code and it doesn't look like the "Statistics" tab data is queryable for a stock.

Is the data on this page able to be returned? I'm trying to access data in the balance sheet for Total Debt/Equity (mrq).

Thanks again love your work!

eversionsystems avatar Dec 26 '21 11:12 eversionsystems

I'm not aware of an API endpoint to retrieve that data. If you find one, let's talk about adding it to the library. (To be clear, parsing the HTML I'm not considering an option).

As a workaround, some of these stats should be available on the stock object.

scheb avatar Dec 26 '21 12:12 scheb

Ok thanks for the response. I don't see those stats in the stock object unfortunately.

eversionsystems avatar Dec 26 '21 21:12 eversionsystems

Good news, I found an endpoint which has the debt to equity value returned. Here is an example of how to use it.

https://query1.finance.yahoo.com/v10/finance/quoteSummary/FMG.AX?modules=assetProfile,defaultKeyStatistics,financialData,recommendationTrend,upgradeDowngradeHistory,majorHoldersBreakdown,insiderHolders,netSharePurchaseActivity,earnings,earningsHistory,earningsTrend,industryTrend,indexTrend,sectorTrend

Do you have time to implement this feature?

eversionsystems avatar Dec 26 '21 21:12 eversionsystems

The data from defaultKeyStatistics and financialData seems to be pretty much what's shown on that statistics page. I could imagine this being interesting to other people as well.

I'd accept a PR to add a method for retrieving these statistics, my suggestion would be to parse it into a StatisticsData object.

scheb avatar Dec 27 '21 11:12 scheb

Ok let me code something up then.

eversionsystems avatar Dec 27 '21 22:12 eversionsystems

Great, a first rough draft would be good enough. Would suggest to implement some of the fields, so we get an idea of the implementation and then we can extend from there.

scheb avatar Dec 28 '21 09:12 scheb