mrhappyasthma / IsThisStockGood

A tool for evaluating companies using the Rule #1 investing principles.
http://www.isthisstockgood.com
22 stars 10 forks source link

Another ship's lost #71

Closed lukaqueres closed 3 months ago

lukaqueres commented 11 months ago

Hey @mrhappyasthma,

We have just lost another ship, with Yahoo Quote Summary url ( https://query1.finance.yahoo.com/v10/finance/quoteSummary/MSFT?modules=assetProfile ) returning Unauthorized.

With that, we don't have prices, info about the company and more.

So in that case, we may have to start scrapping these sunken vessels, or search for a brand new ones.

mrhappyasthma commented 11 months ago

Dang... although not entirely surprising given that Yahoo is cracking down on external access.

We can always try to scrape these in a less elegant way. But I'll do some googling and see if I can find any other sites or APIs that can provide us with similar data.

If you happen to know of any or have any ideas, let me know!

mrhappyasthma commented 11 months ago

The list of values we used from this API can be found here: https://github.com/mrhappyasthma/IsThisStockGood/wiki/Data-fetching---scraping-overview#yahoo-finance-quote-summary

jlarocque88 commented 11 months ago

Would this be a good candidate? Alpha Vantage it seems to offer free API keys

mrhappyasthma commented 11 months ago

It may be too limiting We are pleased to provide free stock API service covering the majority of our datasets for up to 5 API requests per minute and 100 requests per day. If you would like to target a larger API call volume, please visit [premium membership](https://www.alphavantage.co/premium/).

We could cache some of the requests, but we'd likely exceed 100 per day on some days.

lukaqueres commented 11 months ago

It is worth looking into tho, still it is not like we have any choice. Unless you could find any other API.

benninkcorien commented 10 months ago

Would it work if you made a version that did use AlphaVantage (and/or other free API's) where you might hit a limit? Then at least a self-hosted version would kind of work again.

Or - if you can cache 'everything' at a central location if you use the paid version of Alphavantage - how much would that cost and how many people would you need to chip in for a version on your domain to work?

I think these are most of the things in their API endpoints that you'd be using:

https://www.alphavantage.co/query?function=EARNINGS&symbol=IBM&apikey=demo

https://www.alphavantage.co/query?function=OVERVIEW&symbol=IBM&apikey=demo

https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=IBM&apikey=demo

https://www.alphavantage.co/query?function=INCOME_STATEMENT&symbol=IBM&apikey=demo

https://www.alphavantage.co/query?function=BALANCE_SHEET&symbol=IBM&apikey=demo

https://www.alphavantage.co/query?function=CASH_FLOW&symbol=IBM&apikey=demo

I know more Python than financial stuff, and my Python is not quite good enough to help with any of this, sorry.

kocielnik commented 10 months ago

Zacks didn't include a key in their API queries.

The API has some values that are close to what we're looking for:

$ curl --silent https://quote-feed.zacks.com/index.php\?t\=TSLA | jq .TSLA.source.sungard.pe_ratio
"70.69"
$ curl --silent https://quote-feed.zacks.com/index.php\?t\=TSLA | jq .TSLA.source.sungard.earnings
"4"

These are not the exact same numbers we need for EPS and PE to calculate the sticker price.

I think we want TTM values, and these are, as it seems, previous-year values.

They're still not so far from values from Yahoo! Finance in this case: PE of 78.78, and EPS of 3.08.

mrhappyasthma commented 3 months ago

StockRow is also down. They changed their format and guarded code with API key.

Seems MSNMoney is our last hope for free, scrapable resources. Started working on it here: https://github.com/mrhappyasthma/IsThisStockGood/commit/4ae7c2744ad7d1d386c5b28acf3700f9b1e75ef7