Guide · Node.js · SDK · REST API

Industry Code Validation in Node.js — NAICS & NACE Classification

Every business operating in a regulated environment needs a valid industry classification code. NAICS covers North America, NACE covers the European Union — both are standardised systems for categorising business activities. Here's how to validate them properly in Node.js.

1. What are industry codes?

Industry classification codes are standardised systems for categorising the economic activities of businesses and organisations. They assign a numeric (or alphanumeric) code to every type of business activity — from agriculture and mining to software development and financial services.

The two most widely used systems are NAICS (North American Industry Classification System), used by the United States, Canada, and Mexico, and NACE (Nomenclature statistique des Activités économiques dans la Communauté Européenne), the standard across the European Union.

These codes appear everywhere: business registrations, tax filings, regulatory reports, loan applications, insurance underwriting, and KYC (Know Your Customer) processes. They provide a common language for government agencies, financial institutions, and businesses to describe what a company does.

Both systems are periodically revised — NAICS was last updated in 2022 and NACE uses Rev. 2 as its current edition. Using outdated codes can lead to misclassification, compliance issues, and rejected filings.


2. NAICS vs NACE comparison

While both systems serve the same purpose — classifying business activities — they differ in structure, geography, and granularity.

FeatureNAICSNACE
RegionNorth America (US, CA, MX)European Union
Current edition2022Rev. 2
Code format2–6 digit numericLetter + 2–4 digit numeric
Top level20 sectors (2-digit)21 sections (A–U)
Deepest level6-digit (national detail)4-digit class
Maintained byUS Census Bureau / StatCan / INEGIEurostat
ReplacesSIC (Standard Industrial Classification)Earlier NACE Rev. 1
ℹ️Many organisations need to work with both systems — for example, a multinational company filing in both the US and the EU. The IsValid API supports both NAICS and NACE through the same endpoint, with an optional system parameter to specify which classification you want.

3. Code structure and hierarchy

Both NAICS and NACE organise industries into a tree-like hierarchy, from broad sectors down to specific activity types.

NAICS structure (2–6 digits)

541511
54 = sector5415 = industry group541511 = national industry
LevelDigitsExampleDescription
Sector254Professional, Scientific, and Technical Services
Subsector3541Professional, Scientific, and Technical Services
Industry Group45415Computer Systems Design and Related Services
NAICS Industry554151Computer Systems Design and Related Services
National Industry6541511Custom Computer Programming Services

NACE structure (Sections A–U)

J6262.062.01
J = section62 = division62.0 = group62.01 = class
LevelFormatExampleDescription
SectionLetter (A–U)JInformation and communication
Division2-digit62Computer programming, consultancy and related activities
Group3-digit (XX.X)62.0Computer programming, consultancy and related activities
Class4-digit (XX.XX)62.01Computer programming activities

4. Why industry code validation matters

KYC and onboarding

Financial institutions and payment processors require a valid industry code during customer onboarding. An invalid or unrecognised code can block account opening, delay merchant approvals, or trigger enhanced due diligence. Validating industry codes at the point of entry streamlines KYC workflows.

Risk assessment

Insurance underwriters, lenders, and compliance teams use industry codes to assess risk profiles. A misclassified business may receive incorrect pricing, inappropriate coverage, or be flagged (or missed) during sanctions screening. Accurate industry codes are foundational to risk models.

Regulatory reporting

Government agencies require industry codes in tax filings, statistical surveys, and regulatory submissions. The US Census Bureau, BLS, IRS, and EU statistical offices all rely on accurate NAICS or NACE codes. Filing with an invalid code can result in rejected submissions or audit flags.

SIC replacement

The Standard Industrial Classification (SIC) system, introduced in 1937, has been largely superseded by NAICS (in North America) and NACE (in the EU). However, many legacy systems still store SIC codes. Migrating to current NAICS or NACE codes requires validation to ensure the new codes are recognised and correctly mapped.


5. The right solution

The IsValid Industry Code API provides two endpoints: a validate endpoint that checks whether an industry code is valid and returns its description, hierarchy, and system information, and a list endpoint that returns all codes for a given system, level, or parent code.

2
Systems
NAICS + NACE
2,000+
Codes
full hierarchy
100/day
Free tier
no credit card

Get your free API key at isvalid.dev. The free tier includes 100 calls per day — enough for most development and low-volume production use.

Full parameter reference and response schema: Industry Code Validation API docs →


6. Node.js code example

Using the isvalid-sdk Node.js SDK or the built-in fetch API. Install with npm install isvalid-sdk.

// industry-validator.mjs
import { IsValid } from "isvalid-sdk";

const iv = new IsValid({ apiKey: process.env.ISVALID_API_KEY });

// ── Validate a NAICS code ───────────────────────────────────────────────

const result = await iv.industry("541511");

console.log(result.valid);       // true
console.log(result.system);      // 'NAICS'
console.log(result.description); // 'Custom Computer Programming Services'
console.log(result.level);       // '6-digit'
console.log(result.hierarchy);   // [{ code: '54', description: '...' }, ...]

// ── Validate a NACE code ────────────────────────────────────────────────

const nace = await iv.industry("62.01", { system: "nace" });

console.log(nace.valid);       // true
console.log(nace.system);      // 'NACE'
console.log(nace.description); // 'Computer programming activities'
console.log(nace.edition);     // 'Rev. 2'
console.log(nace.level);       // 'class'
console.log(nace.parent);      // '62.0'

// ── Check a sector-level NAICS code ─────────────────────────────────────

const sector = await iv.industry("54");

console.log(sector.description); // 'Professional, Scientific, and Technical Services'
console.log(sector.level);       // '2-digit'
console.log(sector.edition);     // '2022'

You can also list industry codes by system, level, or parent:

// List all 4-digit NAICS industry groups under sector 54
const groups = await iv.industry.list({
  system: "naics",
  level: "4-digit",
  parent: "54",
});

for (const g of groups) {
  console.log(`${g.code} — ${g.description}`);
}
// → 5411 — Legal Services
// → 5412 — Accounting, Tax Preparation, Bookkeeping...
// → ...
// → 5415 — Computer Systems Design and Related Services
// → ...

In an Express application, you might validate industry codes during business onboarding:

// app.mjs (Express)
import express from "express";
import { IsValid } from "isvalid-sdk";

const app = express();
app.use(express.json());

const iv = new IsValid({ apiKey: process.env.ISVALID_API_KEY });

app.post("/businesses", async (req, res) => {
  const { name, industryCode, country } = req.body;

  // Determine the system based on region
  const system = ["US", "CA", "MX"].includes(country) ? "naics" : "nace";

  // Validate the industry code
  const check = await iv.industry(industryCode, { system });

  if (!check.valid) {
    return res.status(400).json({
      error: "Invalid industry code",
      hint: `Provide a valid ${system.toUpperCase()} code`,
    });
  }

  // Use the validated data
  const business = await saveBusiness({
    name,
    industryCode: check.code,
    industryDescription: check.description,
    industrySystem: check.system,
    industryLevel: check.level,
    hierarchy: check.hierarchy,
    country,
  });

  res.json({ success: true, business });
});

app.listen(3000);
Use the list endpoint to build industry code pickers in your UI. Start with sectors (NAICS) or sections (NACE), then drill down through the hierarchy — giving users a guided classification experience.

7. cURL example

Validate a NAICS code:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/industry?value=541511"

Validate a NACE code:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/industry?value=62.01&system=nace"

Validate a NAICS sector:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/industry?value=54&system=naics"

List NAICS codes under a parent:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/industry/list?system=naics&level=4-digit&parent=54"

8. Understanding the response

Response for a NAICS code:

{
  "valid": true,
  "system": "NAICS",
  "edition": "2022",
  "code": "541511",
  "description": "Custom Computer Programming Services",
  "level": "6-digit",
  "parent": "54151",
  "hierarchy": [
    { "code": "54", "description": "Professional, Scientific, and Technical Services" },
    { "code": "541", "description": "Professional, Scientific, and Technical Services" },
    { "code": "5415", "description": "Computer Systems Design and Related Services" },
    { "code": "54151", "description": "Computer Systems Design and Related Services" }
  ]
}

Response for a NACE code:

{
  "valid": true,
  "system": "NACE",
  "edition": "Rev. 2",
  "code": "62.01",
  "description": "Computer programming activities",
  "level": "class",
  "parent": "62.0",
  "hierarchy": [
    { "code": "J", "description": "Information and communication" },
    { "code": "62", "description": "Computer programming, consultancy and related activities" },
    { "code": "62.0", "description": "Computer programming, consultancy and related activities" }
  ]
}

Invalid industry code:

{
  "valid": false
}
FieldTypeDescription
validbooleanWhether the industry code exists in the specified system
systemstringClassification system: "NAICS" or "NACE"
editionstringEdition of the classification: "2022" for NAICS, "Rev. 2" for NACE
codestringThe normalised industry code
descriptionstringOfficial description of the industry activity
levelstringHierarchy level (e.g. "2-digit", "6-digit" for NAICS; "section", "class" for NACE)
parentstring | nullParent code in the hierarchy, or null for top-level codes
hierarchyarrayFull ancestor chain from the top level down to the parent
⚠️The hierarchy array contains ancestors only — it does not include the code itself. For top-level codes (NAICS sectors or NACE sections), the parent field is null and hierarchy is an empty array.

9. Edge cases to handle

NAICS 2022 vs older editions

NAICS is revised every five years (2002, 2007, 2012, 2017, 2022). Codes that existed in the 2017 edition may have been split, merged, or renumbered in 2022. The API validates against the current 2022 edition. If your system stores historical NAICS codes, verify them against the current edition before using them in new filings.

// Code 519130 was valid in NAICS 2017 but restructured in 2022
const old = await iv.industry("519130");
console.log(old.valid); // may be false in 2022 edition

// Always validate against the current edition
const current = await iv.industry("541511");
console.log(current.valid);   // true
console.log(current.edition); // '2022'

NACE Rev. 2 specifics

NACE codes use a dot separator between the division and group/class digits (e.g. 62.01). The API expects this format for NACE codes. NACE sections are single letters (A through U) and represent the broadest classification level.

// NACE codes use dot notation
const nace = await iv.industry("62.01", { system: "nace" });
console.log(nace.valid); // true

// NACE section (single letter)
const section = await iv.industry("J", { system: "nace" });
console.log(section.description); // 'Information and communication'

Cross-system mapping

NAICS and NACE are independent systems — there is no one-to-one mapping between them. A NAICS code like 541511 (Custom Computer Programming Services) roughly corresponds to NACE 62.01 (Computer programming activities), but the boundaries differ. If your application needs to support both systems, validate each code against its own system using the system parameter rather than attempting to convert between them.

Auto-detection vs explicit system

When the system parameter is omitted, the API attempts to auto-detect the classification system based on the code format. For unambiguous codes this works well, but some numeric codes could theoretically exist in both systems. For production use, always specify the system parameter explicitly to avoid ambiguity.


10. Summary

Do not hardcode industry code tables — both NAICS and NACE are revised periodically
Do not assume NAICS and NACE codes map one-to-one — they are independent systems
Do not omit the system parameter in production — always specify naics or nace explicitly
Use the validate endpoint for instant industry code lookup with descriptions and hierarchy
Use the list endpoint to build cascading industry code pickers in your UI
Store the system, edition, and hierarchy alongside the code for audit and compliance

See also

Validate industry codes instantly

Free tier includes 100 API calls per day. No credit card required. Validate any NAICS or NACE code and get descriptions, hierarchy, and edition info.