DEV Community

easysolutions906
easysolutions906

Posted on

How to Look Up NAICS and SIC Industry Codes Programmatically

How to Look Up NAICS and SIC Industry Codes Programmatically

Every business loan application, insurance quote, tax filing, and SBA registration in the United States requires an industry classification code. There are two systems in common use: NAICS (North American Industry Classification System) and SIC (Standard Industrial Classification). Despite being fundamental to how businesses are categorized, there is no clean, fast API for looking these up. Most developers end up scraping the Census Bureau website or manually embedding lookup tables.

This article explains what NAICS and SIC codes are, who needs them, and how to look them up programmatically.

NAICS vs SIC

SIC codes were introduced in 1937 and use a 4-digit numbering system. There are roughly 1,000 SIC codes. They are still required by the SEC for public company filings, by OSHA for workplace safety reporting, and by many insurance underwriters for rate classification.

NAICS codes replaced SIC in 1997 and use a 6-digit hierarchical system. There are roughly 2,000 NAICS codes. They are required by the Census Bureau, the IRS, the SBA, and most government contracting systems. The hierarchy works like this:

  • 2 digits: Sector (e.g., 54 = Professional, Scientific, and Technical Services)
  • 3 digits: Subsector (e.g., 541 = Professional, Scientific, and Technical Services)
  • 4 digits: Industry Group (e.g., 5415 = Computer Systems Design and Related Services)
  • 5 digits: NAICS Industry (e.g., 54151 = Computer Systems Design and Related Services)
  • 6 digits: National Industry (e.g., 541511 = Custom Computer Programming Services)

The deeper you go, the more specific the classification. A lender asking for your NAICS code typically wants the full 6-digit code.

Who needs these codes

The list is longer than most people expect:

  • Business lenders require NAICS codes on every loan application to assess industry risk
  • Insurance companies use SIC or NAICS codes to set premium rates by industry
  • Tax preparers need NAICS codes for Schedule C (sole proprietors) and business tax returns
  • SBA loan applications require a primary NAICS code to determine eligibility and size standards
  • Government contractors must register in SAM.gov with their NAICS codes to bid on contracts
  • Commercial real estate platforms classify tenants by NAICS for underwriting
  • Business registration services ask for industry codes during incorporation

Looking up NAICS codes

The MCP server @easysolutions906/naics-api provides the full NAICS 2022 code set with descriptions, hierarchy, and SIC crosswalk.

Lookup by code

Looking up NAICS code 541511:

{
  "code": "541511",
  "title": "Custom Computer Programming Services",
  "description": "This industry comprises establishments primarily engaged in writing, modifying, testing, and supporting software to meet the needs of a particular customer.",
  "sector": "54 - Professional, Scientific, and Technical Services",
  "subsector": "541 - Professional, Scientific, and Technical Services",
  "industryGroup": "5415 - Computer Systems Design and Related Services",
  "sicCrosswalk": ["7371"]
}
Enter fullscreen mode Exit fullscreen mode

The response includes the full hierarchy so you can see exactly where the code sits in the classification tree, plus the SIC code equivalent.

Search by keyword

Searching for "software development" returns matching codes ranked by relevance:

{
  "query": "software development",
  "results": [
    {
      "code": "541511",
      "title": "Custom Computer Programming Services",
      "relevance": 0.95
    },
    {
      "code": "541512",
      "title": "Computer Systems Design Services",
      "relevance": 0.82
    },
    {
      "code": "511210",
      "title": "Software Publishers",
      "relevance": 0.78
    },
    {
      "code": "541519",
      "title": "Other Computer Related Services",
      "relevance": 0.65
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

This is where most developers struggle. A business owner searches "software" and gets multiple codes. The descriptions help differentiate: 541511 is custom programming (consulting/contracting), 511210 is software publishing (SaaS/products), and 541512 is systems design (IT consulting).

SIC crosswalk

Many legacy systems still require SIC codes. The crosswalk maps NAICS to SIC and vice versa:

{
  "naicsCode": "541511",
  "naicsTitle": "Custom Computer Programming Services",
  "sicCodes": [
    { "code": "7371", "title": "Computer Services-Computer Programming" }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The mapping is not always one-to-one. Some NAICS codes map to multiple SIC codes, and some SIC codes span multiple NAICS codes. The crosswalk handles these many-to-many relationships.

Listing by sector

You can also browse the hierarchy. Listing sector 54 returns all subsectors, industry groups, and individual codes within Professional Services:

{
  "sector": "54",
  "title": "Professional, Scientific, and Technical Services",
  "codes": [
    { "code": "541110", "title": "Offices of Lawyers" },
    { "code": "541211", "title": "Offices of Certified Public Accountants" },
    { "code": "541511", "title": "Custom Computer Programming Services" }
  ],
  "totalCodes": 42
}
Enter fullscreen mode Exit fullscreen mode

Setting up the MCP server

Add to your Claude Desktop or Cursor configuration:

{
  "mcpServers": {
    "naics": {
      "command": "npx",
      "args": ["-y", "@easysolutions906/naics-api"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

After restarting, you can ask questions like:

  • "What NAICS code should a SaaS company use?"
  • "Look up NAICS 541511"
  • "What is the SIC equivalent of NAICS 541511?"
  • "List all NAICS codes in the healthcare sector"

The server exposes naics_lookup, naics_search, sic_lookup, and naics_to_sic tools.

Practical integration example

Here is a common pattern for a loan application form. The user types their industry and you suggest NAICS codes:

const suggestNaicsCodes = async (industryDescription) => {
  const res = await fetch(
    `https://your-api-url.com/search?q=${encodeURIComponent(industryDescription)}&limit=5`
  );
  const data = await res.json();

  return data.results.map(({ code, title }) => ({
    code,
    title,
    display: `${code} - ${title}`,
  }));
};

// User types "restaurant" in the industry field
const suggestions = await suggestNaicsCodes('restaurant');
// Returns: 722511 - Full-Service Restaurants, 722513 - Limited-Service Restaurants, etc.
Enter fullscreen mode Exit fullscreen mode

Show the suggestions in a dropdown. When the user selects one, store both the code and title. If the downstream system needs SIC instead of NAICS, use the crosswalk endpoint to convert.

Industry classification codes are one of those things that every business application needs but nobody wants to build from scratch. The Census Bureau publishes the data, but turning it into a searchable, cross-referenced lookup with SIC mapping requires real data work. The @easysolutions906/naics-api MCP server and npm package handle that so you do not have to.

Top comments (0)