How to get Yahoo Finance Key Statistics such as return on equity - yahoo-finance

I would like to get key statistics data for a given symbol in Yahoo! Finance.
I found a few ways to get statistics data using Yahoo Finance API.
For example, to get Apple’s name (n), ask (a), bid (b), market cap(j1),
http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=nabj1
(e.g. http://www.jarloo.com/yahoo_finance/)
But I would like to extract more information such as return on equity and enterprise value.
How can I do this?
I cannot even fetch these values from web scraping either.

Key statistics can be accessed by calling the following API-Call:
https://query1.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=defaultKeyStatistics
This includes enterprise value and book value.
I have not found a way to get return on equity directly from Yahoo Finance but it could be calculated from other values found in this answer.
Edit:
Return on equity can be found in the financial data:
https://query1.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=financialData

Related

How do I get the cid of a stock for Google Finance?

While this question was asked beforehand in the following post:
How to get cid from market and symbol from google finance
The answer didn't actually answer the question. Since google finance no longer allows for historical prices beyond a year unless one inputs the appropriate cid into the URL, how does one get the corresponding cid's in order to directly input into the URL the historical prices of specific times? Is there a table available or something along those lines?

Yahoo Finance API get list of all mutual funds and ETFs tickers

I'm looking for a way to get list of all mutual funds and ETFs tickers from Yahoo Finance. I've found few solutions like for example:
https://github.com/Benny-/Yahoo-ticker-symbol-downloader
or
http://investexcel.net/all-yahoo-finance-stock-tickers/
But unfortunantely after checking dozens of random tickers most of them didn't belong to mutual funds category. Having list of this tickers seems useful as long I could find a way to check ticker's category.
On Yahoo Finance website using search box, popup show ticker's category. How to replicate this functionality programmatically or using for example YQL?
EDIT:
After following Daniel's advise I've successfully filtered tickers and
updated them on my GitHub:
https://github.com/MichaelDz6/Yahoo_Finance_ETFs_Web_Scraper
It's possible to tell wether ticker is mutual fund or ETF but it's hard to distinct between mutual fund and ETF.
As an example let's take mututal fund with ticker TIBIX. From what I know only mutual funds and ETFs have category "Fund Family" in their profile tab. So you need YQL that checks whether ticker contains HTML span containing "Fund Family" inside.
Raw YQL query
select * from htmlstring where url='https://finance.yahoo.com/quote/TIBIX/profile?p=TIBIX' and xpath='//span/*[contains(.,"Fund Family")]//text()'
Endpoint for the query
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20htmlstring%20where%20url%3D'https%3A%2F%2Ffinance.yahoo.com%2Fquote%2FTIBIX%2Fprofile%3Fp%3DTIBIX'%20and%20xpath%3D'%2F%2Fspan%2F*%5Bcontains(.%2C%22Fund%20Family%22)%5D%2F%2Ftext()'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
If you ticker is mutual fund or ETF, query should return such response:
{"query":{"count":1,"created":"2017-09-25T07:07:10Z","lang":"en-US","results":{"result":"Fund Family"}}}
Either way result will be empty.

How to get stock of finance yahoo API

I want to get data of some selected stock of finance yahoo API. I am listing these API here .
Chart
http://finance.yahoo.com/echarts?s=AAPL+Interactive#
Key statistics
http://finance.yahoo.com/q/ks?s=AAPL+Key+Statistics
Competitors
http://finance.yahoo.com/q/co?s=AAPL+Competitors
Analyst Opinion
http://finance.yahoo.com/q/ao?s=AAPL+Analyst+Opinion
Analyst Estimates
http://finance.yahoo.com/q/ae?s=AAPL+Analyst+Estimates
Major Holders
http://finance.yahoo.com/q/mh?s=AAPL+Major+Holders
Income Statement (annual and Quarterly)
http://finance.yahoo.com/q/is?s=AAPL
Balance Sheet (annual and Quarterly)
http://finance.yahoo.com/q/bs?s=AAPL+Balance+Sheet&annual
Cash Flow (annual and Quarterly)
http://finance.yahoo.com/q/cf?s=AAPL+Cash+Flow&annual
Is there any api which give me exact solution for this.Even it is paid.Please Provide me correct and sufficient information also thanks in advance.
You can get most of what you're looking for using the yahoo_fin package in Python. Its documentation is here: http://theautomatic.net/yahoo_fin-documentation/.
Here's some examples:
Pulling analyst info (e.g. https://finance.yahoo.com/quote/AAPL/analysts?p=AAPL):
from yahoo_fin.stock_info import *
get_analysts_info("AAPL")
Income statment:
get_income_statement("AAPL")
Cash flow statment:
get_cash_flow("AAPL")
Balance sheet:
get_balance_sheet("AAPL")
Key statistics (e.g. https://finance.yahoo.com/quote/AAPL/key-statistics?p=AAPL):
get_stats("AAPL")
Major holders (e.g. https://finance.yahoo.com/quote/AAPL/holders?p=AAPL):
get_holders("AAPL")
You just need to replace "AAPL" with whatever ticker you want data for.

"Historical quote data is unavailable for the specified date range" for Yahoo finance when querying stock history

I've got a very strange problem when query stock history prices via yahoo finance,
I cannot query google stock prices from Jan-04-2010 to Apr-19-2013, i.e.
http://finance.yahoo.com/q/hp?s=GOOG&a=00&b=04&c=2010&d=03&e=19&f=2013&g=d
got a error: "Historical quote data is unavailable for the specified date range."
but I can query prices from Jan-04-2010 to Apr-19-2014, i.e.
http://finance.yahoo.com/q/hp?s=GOOG&a=02&b=27&c=2011&d=03&e=19&f=2014&g=d
Anyone know what's wrong with my first query?
thanks.
I think Google symbol has been changed to Googl try this it works for me:
http://finance.yahoo.com/q/hp?s=GOOGl&a=00&b=04&c=2010&d=03&e=19&f=2013&g=d

How to get a ticker symbol from a company name with the Google Finance API?

This matter (getting a symbol form a company name) has already been solved in the following thread with Yahoo's API and I found the first and third answers quite useful.
I also noticed that the second answer dealt with Google Finance but it uses ticker symbols and not the company name ...
Unfortunately, I learnt that Yahoo sometimes uses different ticker symbols from the stock exchanges.
So I would like to do the same thing — that is, I give a company name and I get its symbol — but with the Google Finance API, instead of Yahoo's.
Is that possible ? Thanks
Back when Google Finance first provided a Google Sheets formula, it was this:
=GoogleLookup(A1, "ticker")
But this no longer works, and Google has been dropping the ball on Finance for quite some time now. The REVERSE lookup is possible tho; ie, given the TICKER SYMBOL you can look up the official corporate name (according to GoogleFinance)...
=GOOGLEFINANCE(B1, "name")
Where A1 is the cell in Google Sheets with the corporate name,
and B1 is the cell in GS w the ticker symbol.
Basically, you now need the ticker symbol to do anything with 'GOOGLEFINANCE'.
'LOOKUP' is still around but has been changed.
If you want ticker symbols, you have to write some API calls, and those solutions can be found elsewhere.

Resources