3
$\begingroup$

Does anyone know where I can find a list of all stocks traded on the NYSE in a table that also includes what sector they are in? I want to look at some data using info both from the individual stock and from the sector but I cannot find a comprehensive list containing both pieces of information.

$\endgroup$

4 Answers 4

2
$\begingroup$

I just ran the Mathematica code below to make a list of stocks and sectors you can access here:

https://www.dropbox.com/s/zkzpcnksvfygamp/nyse.xls

Mathematica uses curated data from Yahoo. Items that lack sector information have been omitted. The list may be incomplete but it might provide something for you to work with.

members = FinancialData["NYSE", "Members"];
names = If[SameQ[Head[#], FinancialData], "-", #] &@
     FinancialData[#, "Name"] & /@ members;
companies = If[SameQ[Head[#], FinancialData], "-", #] &@
     FinancialData[#, "Company"] & /@ members;
sectors = If[SameQ[Head[#], FinancialData], "-", #] &@
     FinancialData[#, "Sector"] & /@ members;
data = Transpose[{members, names, companies, sectors}];
data2 = DeleteCases[data, {_, _, _, Missing["NotAvailable"] | "-"}];
data3 = SortBy[data2, Last];
Export["nyse.xls", 
  Prepend[data3, {"Symbol", "Name", "Company", "Sector"}]];
$\endgroup$
0
$\begingroup$

Your best bet is to use the stock screener over at FINVIZ. You can limit the results to NYSE listed stocks and can easily export to CSV using the "export" link at the bottom right of the table.

Bear in mind, industry/sector classifications are no uniform. You'll find different classification methods depending on where you look.

$\endgroup$
0
$\begingroup$

As @Louis said, from Finviz's stock screener you can filter by exchange and sort column by sector.

>>> import urllib2 
>>> url = "http://www.finviz.com/export.ashx?v=111&f=exch_nyse&o=sector"
>>> file = open("tickers.txt",'wb')
>>> data = urllib2.urlopen(url).readlines()
>>> for l in data:
... file.write(l)
>>> file.close()
$\endgroup$
0
$\begingroup$

You can find the complete list on the old NASDAQ website.

https://old.nasdaq.com/screening/company-list.aspx

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.