Closed lukaqueres closed 3 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!
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
Would this be a good candidate? Alpha Vantage it seems to offer free API keys
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.
It is worth looking into tho, still it is not like we have any choice. Unless you could find any other API.
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?
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
operatingCashflow
import requests
TICKER = "AAPL"
APIKEY = "yourkey"
url = f"https://www.alphavantage.co/query?function=BALANCE_SHEET&symbol={TICKER}&apikey={APIKEY}"
req = requests.get(url)
data = req.json()
with open('data.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=4)
I know more Python than financial stuff, and my Python is not quite good enough to help with any of this, sorry.
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.
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
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.