Skip to content
All library documents

Building Stock Industry Classifications from Public and Licensed Data

Article Quant Q&A · Author: Ceeerson

Summary

The document surveys ways to obtain industry labels for stocks, noting that classification systems differ and are often maintained by index providers. It identifies GICS and ICB as proprietary schemes and cautions that a researcher should first decide how much consistency and detail the analysis requires. For a broad grouping, it suggests combining sector ETF holdings into a regularly refreshed, point-in-time stock list; public company lists and online sources are other possible starting points.

It also describes access to Morningstar sector and industry codes through a historical research platform, where a Python data pipeline can retrieve codes for listed US securities and map codes to names. The responses offer alternatives rather than a single universally authoritative source. ETF constituents represent particular funds and may not cover every stock or match a formal classification; web-scraped data and third-party services can change availability, coverage, and licensing terms. The examples are historical and do not establish that the named platform or datasets remain accessible today.

Key ideas

  • Industry labels differ across classification providers, and formal schemes may require paid access.
  • ETF holdings can be combined to create a broad sector-based stock universe.
  • A point-in-time database should preserve classification membership as it changes over time.
  • Research platforms may provide coded industry fields that can be mapped to readable names.
  • Public lists and scraped data can vary in completeness, licensing, and current availability.

Tags

Full text
# Classifying stocks by industry (free)


# Classifying stocks by industry (free)












Is there anyway to get the stock symbols of an exchange classified by industry? For example: AMD-semiconductor

The best I could find was this page:

https://money.cnn.com/data/sectors/tech/electronic/?sector=1300&industry=1305

I wasn't sure if my best bet would be to make something that grabs data off this site or if there was something more convenient already. What do you all think?

Thanks

## Answer by lehalle (score 5, accepted)

https://quant.stackexchange.com/a/40457

First of all, you need to know they are different sector classifications. The main ones are:

- GICS (Global Industry Classification Standard) maintained by MSCI and S&P. It is thus "private" and you will (/should?) have to pay to be updated on it.

- ICB (Industry Classification Benchmark) is maintained by Dow Jones and FTSE. Again it is a private one.

In fact any index provider has to maintain its own list. This means that you should not focus on obtaining a very specific classification, any rough list should be enough.

My advice would be to look at ETF compositions. A lot of ETF indexed on sectors are available, and you will easily find a web site with the composition of an ETF. For instance, I googled "Consumer Staples ETF composition" and found the web page of the iShares Global Consumer Staples ETF. There is an excel spread sheet to download there, with the list of stocks included in this ETF. If you look for a 10 to 15 sectors classification, it is about a dozen of google search and a python code to import these lists every week to have a point in time database.

Another solution I found on the web is to rely on wikipedia pages, like its List of S&P 500 companies. This blog post comments a code to obtain this list in python.

## Answer by ernestoeperez88 (score 4)

https://quant.stackexchange.com/a/40466

For US stocks, you can use Quantopian's Research platform to access Morningstar's Industry & Sector Classification data for free.

All you need is some basic python programming skills. This dataset (and many others) can be accessed using Quantopian's Pipeline API (check out this tutorial).

The following example outputs a pandas DataFrame containing industry codes for all stocks that traded on major US exchanges last Friday (06/22/2018):

```
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data import Fundamentals
from quantopian.research import run_pipeline

def make_pipeline():
    industry_code = Fundamentals.morningstar_industry_code.latest
    return Pipeline(
        columns={
            'industry_code': industry_code,
        }
    )

df = run_pipeline(make_pipeline(), start_date='2018-06-22', end_date='2018-06-22')
```

From here you can do all kinds of analyses and filtering using python. Check out Quantopian's Help page to get mappings from industry code to industry name.

## Answer by Chris (score 0)

https://quant.stackexchange.com/a/85864

Just in case the qestion is still relevant ... I had the same need and developed a Pytohn solution, which retrieves GICS and GECS classificaiotn data from the internet. https://pypi.org/project/equities-classifier/ https://dornech.github.io/equities-classifier/

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.