Skip to Content
API ReferenceHierarchy Tools

Hierarchy Tools

Tools for navigating the NAICS code hierarchy.

NAICS Structure

NAICS codes have 5 levels of hierarchy:

Sector (2-digit) → 31-33 Manufacturing └─ Subsector (3-digit) → 311 Food Manufacturing └─ Industry Group → 3111 Animal Food Manufacturing └─ NAICS Industry→ 31111 Animal Food Manufacturing └─ National → 311111 Dog and Cat Food Manufacturing

get_code_hierarchy

Get the complete hierarchy for a NAICS code, from sector to the code itself.

Parameters

ParameterTypeRequiredDescription
codestringYesNAICS code (2-6 digits)

Response

{ "code": "311111", "title": "Dog and Cat Food Manufacturing", "description": "This industry comprises establishments...", "level": "national_industry", "hierarchy": [ { "code": "31-33", "title": "Manufacturing", "level": "sector" }, { "code": "311", "title": "Food Manufacturing", "level": "subsector" }, { "code": "3111", "title": "Animal Food Manufacturing", "level": "industry_group" }, { "code": "31111", "title": "Animal Food Manufacturing", "level": "naics_industry" }, { "code": "311111", "title": "Dog and Cat Food Manufacturing", "level": "national_industry" } ] }

Example

{ "code": "722511" }

get_children

Get the immediate children of a NAICS code.

Parameters

ParameterTypeRequiredDescription
codestringYesParent NAICS code

Response

{ "parent": { "code": "311", "title": "Food Manufacturing", "level": "subsector" }, "children": [ { "code": "3111", "title": "Animal Food Manufacturing", "level": "industry_group" }, { "code": "3112", "title": "Grain and Oilseed Milling", "level": "industry_group" }, { "code": "3113", "title": "Sugar and Confectionery Product Manufacturing", "level": "industry_group" } ], "total_children": 9 }

Example

{ "code": "72" }

get_siblings

Get codes at the same level under the same parent.

Parameters

ParameterTypeRequiredDescription
codestringYesNAICS code

Response

{ "code": "311111", "title": "Dog and Cat Food Manufacturing", "parent": { "code": "31111", "title": "Animal Food Manufacturing" }, "siblings": [ { "code": "311111", "title": "Dog and Cat Food Manufacturing", "is_current": true }, { "code": "311119", "title": "Other Animal Food Manufacturing", "is_current": false } ], "total_siblings": 2 }

Example

{ "code": "722511" }

get_parent

Get the direct parent of a NAICS code.

Parameters

ParameterTypeRequiredDescription
codestringYesNAICS code

Response

{ "code": "311111", "title": "Dog and Cat Food Manufacturing", "level": "national_industry", "parent": { "code": "31111", "title": "Animal Food Manufacturing", "level": "naics_industry" } }

Example

{ "code": "541511" }

get_ancestors

Get all ancestors from the code up to the sector level.

Parameters

ParameterTypeRequiredDescription
codestringYesNAICS code

Response

{ "code": "311111", "title": "Dog and Cat Food Manufacturing", "ancestors": [ { "code": "31111", "title": "Animal Food Manufacturing", "level": "naics_industry" }, { "code": "3111", "title": "Animal Food Manufacturing", "level": "industry_group" }, { "code": "311", "title": "Food Manufacturing", "level": "subsector" }, { "code": "31-33", "title": "Manufacturing", "level": "sector" } ] }

Example

{ "code": "722513" }

Usage Patterns

Exploring a Sector

1. get_children("72") → Get subsectors 2. get_children("722") → Get industry groups 3. get_children("7225") → Get NAICS industries 4. get_children("72251") → Get national industries

Understanding a Classification

1. get_code_hierarchy("722511") → See full context 2. get_siblings("722511") → See alternatives 3. get_cross_references("722511")→ See exclusions

Finding the Right Level

1. Start with search_naics_codes() 2. Use get_children() to find more specific codes 3. Use get_parent() to find broader codes