Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting stocks by industry via Yahoo Finance

i want to list all available industries ( like: http://biz.yahoo.com/p/ ) and show all corresponding stocks. Until now I'm using YAHOO.Finance.SymbolSuggest.ssCallback for the symbol suggestion and http://finance.yahoo.com/d/quotes.csv?s=... for getting the stock's data.

Does anyone have any idea how to get all industries and corresponding stocks? Is there another hidden Yahoo API?

like image 985
Andy Avatar asked Jul 05 '12 07:07

Andy


2 Answers

Lists of all available industries are called GICS Sectors for Standard and Poor's (S&P500 will use that) and ICB for Dow Jones and FTSE. Hence it used by Nasdaq, Nyse and others markets. It seems like Yahoo uses a third industry classification by Morning Star, but since I'm not quite sure I will give both ways of retrieving data.

Morning Star

I don't know if Yahoo really sticks to this classification, but some names were really close so let's see it: You need to go to their Index Data and in each sector, click on it and then at the bottom View complete index holdings. It's not as precise as in Yahoo industry list, but it's all you can do with Morning Star. Not very convincing, I know...

GICS Sectors

GICS Sectors are now a trademark of Standard and Poor's and then data have to be sought for in S&P's website.
Short answer: take a look at this page, you will need to be registered (it's free and easy) and you can download spreadsheets (xls) with stocks and corresponding sectors. Nevertheless, things aren't always easy, and you will have to do a bit of a search to retrieve all stocks with their corresponding industries. For example, the file INDICATED_RATE_CHANGE.xls will give you some companies and their sectors in each month of 2012. Using that and SP500_DividendAristocrats_2012.xls you should be able to retrieve at least a large part of S&P 500 companies.

ICB

ICB is used by NYSE, NASDAQ etc... Then it's a lot simpler than S&P and MorningStar. Here is your answer. BOOM! Direct link! Link is dead :(

Finally

I strongly advise you to use the simpler and most-used industry classification index: the ICB. It will always be available and publicly displayed since millions of investors relay everyday on it, without having to use S&P financial services or MorningStar brokerage services...

EDIT

You can look at nasdaq.com to retrieve all companies and their corresponding sector: here for Nasdaq and here for Nyse

like image 93
Romain Avatar answered Sep 17 '22 16:09

Romain


Get all industry-IDs from here: http://biz.yahoo.com/ic/ind_index.html (look at the links)

Then use YQL ( https://developer.yahoo.com/yql/console/ )

with a query like this: select * from yahoo.finance.industry where id=912

like image 34
Fluchtpunkt Avatar answered Sep 20 '22 16:09

Fluchtpunkt