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

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.

Related

How to fetch the ETF's data into a Google Spreadsheet?

Following this post, where I had listed some of the interesting ETF1s I had found on some of the relevant forums, I received some valuable criticism. Now I want to use a Google spreadsheet to get the updated information of those ETFs in one place, and maybe use it for personal portfolio management. What I need:
preferably fetching data using the ISIN2 code, as the tickers/symbols are not really reliable and consistent between different databases and markets
The information I need are:
the current value of the ETF
the 1-year, 3-year, and 5-year performances/returns
current fund size
TER: Total Expense Ratio
TD: Tracking Differences
1-year volatility
For example, consider the "iShares Core MSCI World" ETF which is listed as "IWDA" on "Euronext Amsterdam" and an ISIN code of "IE00B4L5Y983". What I have read so far:
From this page and this post, I have used the GOOGLEFINANCE function to fetch the current price and some other information from Google Finance. However, I don't know how to fetch/calculate the 1/3/5-year performances, the fund size, TER, and the TD. Moreover, according to this comment, Google Finance, like many other Google products seem to be dying. So it would be great to have a more sustainable solution.
This post, suggests some syntax using index and IMPORTXML functions to fetch from etf.com. And this comment uses the same functions to fetch from nasdaq.com. But I couldn't make either to work, mainly because I don't know what symbol should I use.
This and this comments suggest the DGET and IMPORTDATA functions, to fetch data from api.iextrading.com, but I could not make it to work either.
This post and many other posts on the bogleheads.org forum, use all variants of syntax using the importHTML function to import and pars HTML tables from many different websites. There are many reliable websites that if I learn how to use this function I could fetch data from.
I would appreciate it if you could help me know how I can get the above information. Thanks for your kind support in advance.
P.S.1. From here, I was able to use the commands:
=INDEX(SPLIT(INDEX(importHTML(CONCATENATE("http://etfs.morningstar.com/quote-banner?&t=", C5), "table", 1),1,11), " "), 1, 3)
and
=INDEX(SPLIT(INDEX(importHTML(CONCATENATE("http://etfs.morningstar.com/quote-banner?&t=", C5), "table", 1),1,13), " "), 1, 2)
to pull Total fund size and TER consequently. However, they do not deliver data fro most of the ETFs and also I'm not sure how reliable this website is.
Footnotes:
1: Exchange-Traded Fund
2: International Securities Identification Number

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?

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

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

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.

how to get results from Yahoo Ireland or Yahoo India search, using YQL

I just want to use YQL to get the top 10 results for a particular query, and a region, eg Yahoo India, or Yahoo Ireland.
How do i do this?
Thanks,
Arvind.
You can use a region value when querying against the search.web table, like
select * from search.web where query="pizza" and region="in"
(Try this query the YQL console.)
Available region values are listed in the Supported Regions and Languages for Web and News Search page for the Yahoo! BOSS API, which the search.web data table uses.
Following changes with the Yahoo Pipes V2 'upgrade' some YQL tables have been dropped.
Thankfully some new ones have appeared but are not widely known about yet.
SELECT * FROM microsoft.bing.web WHERE query="pizza india"

Resources