Fetching a company’s NAICS codes

Hide code cell content

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

import lseg.data as ld

ld.open_session()
<lseg.data.session.Definition object at 0x7fecac5a23c0 {name='rdp'}>

You can use the LSEG Data Library for Python to retrieve the North American Industry Classification System (NAICS) codes associated with a company. It is a standard used by US statistical agencies to classify business establishments for economic analysis.

To do acquire the data, pass a company’s Refinitiv Instrument Code to the get_data method with a request for NAICS related fields.

Here’s a query for Thomson Reuters:

ld.get_data(
    'TRI.N',
    fields=[
        # Basic stuff
        "TR.CommonName",
        "TR.TickerSymbol",
        # NAICS codes
        "TR.NAICSSectorCode",
        "TR.NAICSSector",
        "TR.NAICSSubsectorCode",
        "TR.NAICSSubsector",
        "TR.NAICSIndustryGroupCode",
        "TR.NAICSIndustryGroup",
        "TR.NAICSIndustryCode",
        "TR.NAICSIndustry",
        "TR.NAICSActivityCode",
        "TR.NAICSActivity",
    ]
)
Instrument Company Common Name Ticker Symbol NAICS Sector Code NAICS Sector Name NAICS Subsector Code NAICS Subsector Name NAICS Industry Group Code NAICS Industry Group Name
0 TRI.N Thomson Reuters Corp TRI 51 Information 518 Computing Infrastructure Providers, Data Proce... 5182 Computing Infrastructure Providers, Data Proce...

Hide code cell content

ld.close_session()