Analytics Tools
Tools for analyzing and comparing NAICS codes.
compare_codes
Compare two NAICS codes side-by-side to understand their differences.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code1 | string | Yes | First NAICS code |
code2 | string | Yes | Second NAICS code |
Response
{
"comparison": {
"code1": {
"code": "722511",
"title": "Full-Service Restaurants",
"description": "Establishments primarily engaged in providing food services to patrons who order and are served while seated...",
"hierarchy": ["72", "722", "7225", "72251", "722511"]
},
"code2": {
"code": "722513",
"title": "Limited-Service Restaurants",
"description": "Establishments primarily engaged in providing food services where patrons order or select items and pay before eating...",
"hierarchy": ["72", "722", "7225", "72251", "722513"]
}
},
"relationship": {
"type": "siblings",
"common_parent": {
"code": "72251",
"title": "Restaurants and Other Eating Places"
},
"divergence_level": "national_industry"
},
"key_differences": [
{
"aspect": "Service Model",
"code1": "Table service - patrons are served while seated",
"code2": "Counter service - patrons order and pay before eating"
},
{
"aspect": "Payment Timing",
"code1": "Bill presented after meal",
"code2": "Payment before receiving food"
}
]
}Example
{
"code1": "541511",
"code2": "541512"
}find_similar_industries
Find industries related to a given NAICS code based on semantic similarity.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
code | string | Yes | ā | NAICS code |
limit | integer | No | 10 | Maximum results |
same_sector | boolean | No | false | Limit to same sector |
Response
{
"source": {
"code": "722511",
"title": "Full-Service Restaurants"
},
"similar": [
{
"code": "722513",
"title": "Limited-Service Restaurants",
"similarity": 0.89,
"relationship": "sibling"
},
{
"code": "722514",
"title": "Cafeterias, Grill Buffets, and Buffets",
"similarity": 0.85,
"relationship": "sibling"
},
{
"code": "722515",
"title": "Snack and Nonalcoholic Beverage Bars",
"similarity": 0.78,
"relationship": "sibling"
},
{
"code": "722410",
"title": "Drinking Places (Alcoholic Beverages)",
"similarity": 0.72,
"relationship": "cousin"
}
]
}Example
{
"code": "541511",
"limit": 5,
"same_sector": true
}get_cross_references
Get cross-reference information for a NAICS code. Cross-references indicate:
- Exclusions: Activities that belong in a different code
- See Also: Related codes that might apply
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | NAICS code |
Response
{
"code": "311811",
"title": "Retail Bakeries",
"cross_references": {
"exclusions": [
{
"text": "Manufacturing bakery products for sale to other establishments",
"see_code": "311812",
"see_title": "Commercial Bakeries"
},
{
"text": "Retailing bakery products not baked on the premises",
"see_code": "445291",
"see_title": "Baked Goods Retailers"
}
],
"see_also": [
{
"code": "311812",
"title": "Commercial Bakeries",
"reason": "For wholesale bakery production"
},
{
"code": "722515",
"title": "Snack and Nonalcoholic Beverage Bars",
"reason": "For bakery cafes with seating"
}
]
}
}Example
{
"code": "541511"
}Importance
Cross-references are critical for accurate classification. A code that seems correct based on the title may have exclusions that redirect the business to a different code.
Common mistake:
āThis is a bakery, so Iāll use 311811 (Retail Bakeries)ā
Reality check:
If the bakery primarily sells wholesale to other businesses, it should be 311812 (Commercial Bakeries)
get_sector_summary
Get summary statistics for a NAICS sector.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sector_code | string | Yes | 2-digit sector code |
Response
{
"sector": {
"code": "72",
"title": "Accommodation and Food Services"
},
"statistics": {
"total_codes": 45,
"subsectors": 2,
"industry_groups": 7,
"naics_industries": 15,
"national_industries": 21
},
"subsectors": [
{
"code": "721",
"title": "Accommodation",
"code_count": 9
},
{
"code": "722",
"title": "Food Services and Drinking Places",
"code_count": 36
}
],
"largest_industry_groups": [
{
"code": "7225",
"title": "Restaurants and Other Eating Places",
"code_count": 15
}
]
}Example
{
"sector_code": "54"
}get_similar_codes
Get pre-computed similar NAICS codes from the semantic relationship graph. This uses pre-computed FAISS similarity relationships, making it much faster than real-time similarity search.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
naics_code | string | Yes | ā | NAICS code to find similar codes for |
min_similarity | float | No | 0.75 | Minimum similarity threshold (0-1) |
include_cross_sector | boolean | No | true | Include codes from different sectors |
limit | integer | No | 10 | Maximum results per category |
Response
{
"node_code": "449110",
"title": "Furniture Retailers",
"level": "national_industry",
"sector_code": "44",
"same_sector_alternatives": [
{
"code": "449210",
"title": "Electronics and Appliance Retailers",
"level": "national_industry",
"similarity": 0.82
},
{
"code": "449120",
"title": "Home Furnishings Retailers",
"level": "national_industry",
"similarity": 0.79
}
],
"cross_sector_alternatives": [
{
"code": "459410",
"title": "Office Supplies and Stationery Retailers",
"level": "national_industry",
"similarity": 0.77,
"target_sector": "45",
"note": "Cross-sector: 44 -> 45"
},
{
"code": "423210",
"title": "Furniture Merchant Wholesalers",
"level": "national_industry",
"similarity": 0.74,
"target_sector": "42",
"note": "Cross-sector: 44 -> 42"
}
],
"stats": {
"same_sector_count": 5,
"cross_sector_count": 8
}
}Example
{
"naics_code": "722511",
"min_similarity": 0.75,
"include_cross_sector": true,
"limit": 5
}When to Use
- Faster than
find_similar_industries: Uses pre-computed relationships instead of real-time search - Cross-sector discovery: Surfaces codes in OTHER sectors that may apply
- Classification validation: Check if a similar code in a different sector might be a better fit
get_cross_sector_alternatives
Get codes in different sectors that are semantically similar. This is a powerful tool for discovering when a business activity might be classified in a completely different sector than initially expected.
Why This Matters
NAICS sectors are broad categories, but real businesses often span boundaries:
- A ābakeryā might be Manufacturing (311) or Retail (445) or Food Service (722)
- A āsoftware companyā might be Information (51) or Professional Services (54)
Cross-sector alternatives reveal these boundary cases for human evaluation.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
naics_code | string | Yes | ā | NAICS code to find alternatives for |
min_similarity | float | No | 0.70 | Minimum similarity threshold |
top_n | integer | No | 10 | Maximum results |
Response
{
"naics_code": "424130",
"title": "Industrial and Personal Service Paper Merchant Wholesalers",
"sector_code": "42",
"cross_sector_alternatives": [
{
"code": "322219",
"title": "Other Paperboard Container Manufacturing",
"level": "national_industry",
"similarity": 0.79,
"target_sector": "32",
"relationship_note": "Cross-sector: 42 -> 32",
"hierarchy": ["32", "322", "3222", "32221", "322219"]
},
{
"code": "322299",
"title": "All Other Converted Paper Product Manufacturing",
"level": "national_industry",
"similarity": 0.78,
"target_sector": "32",
"relationship_note": "Cross-sector: 42 -> 32",
"hierarchy": ["32", "322", "3222", "32229", "322299"]
}
],
"total_found": 9,
"note": "Cross-sector alternatives are codes in DIFFERENT sectors that are semantically similar. High similarity suggests the business activity might legitimately fit in either sector - evaluate based on PRIMARY activity."
}Example
{
"naics_code": "541511",
"min_similarity": 0.70,
"top_n": 5
}Interpreting Results
| Similarity | Interpretation |
|---|---|
| > 0.85 | Strong alternative - carefully evaluate which fits better |
| 0.75 - 0.85 | Consider if the business has activities in both areas |
| 0.70 - 0.75 | Tangentially related - may not be a true alternative |
get_relationship_stats
Get statistics about a codeās semantic relationships. Provides a quick summary before diving into detailed alternatives.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
naics_code | string | Yes | NAICS code to get stats for |
Response
{
"node_code": "449110",
"title": "Furniture Retailers",
"level": "national_industry",
"sector_code": "44",
"stats": {
"same_sector_count": 5,
"cross_sector_count": 8,
"total_count": 13,
"max_similarity": 0.82,
"avg_similarity": 0.76,
"has_cross_sector": true
}
}Example
{
"naics_code": "722511"
}When to Use
- Quick check: See if a code has alternatives before fetching them
- Flag boundary cases:
has_cross_sector: trueindicates potential classification ambiguity - Prioritize review: High
cross_sector_countsuggests the code needs careful evaluation
Interpreting Stats
| Metric | Interpretation |
|---|---|
High cross_sector_count | Code has broad semantic overlap with other sectors |
Low cross_sector_count | Code is highly specific to its sector |
High avg_similarity | Strong alternatives exist - may need careful selection |
has_cross_sector: true | Flag for potential classification boundary case |
Cross-Sector Analysis Workflow
When classifying a business that might span sectors:
1. classify_business(description)
2. get_relationship_stats(top_result.code)
3. If has_cross_sector=true:
a. get_cross_sector_alternatives(code)
b. compare_codes(original_code, top_cross_sector_code)
c. get_cross_references(both_codes)
4. Document decision if classification is ambiguousAll Sectors Reference
| Code | Title |
|---|---|
| 11 | Agriculture, Forestry, Fishing and Hunting |
| 21 | Mining, Quarrying, and Oil and Gas Extraction |
| 22 | Utilities |
| 23 | Construction |
| 31-33 | Manufacturing |
| 42 | Wholesale Trade |
| 44-45 | Retail Trade |
| 48-49 | Transportation and Warehousing |
| 51 | Information |
| 52 | Finance and Insurance |
| 53 | Real Estate and Rental and Leasing |
| 54 | Professional, Scientific, and Technical Services |
| 55 | Management of Companies and Enterprises |
| 56 | Administrative and Support and Waste Management |
| 61 | Educational Services |
| 62 | Health Care and Social Assistance |
| 71 | Arts, Entertainment, and Recreation |
| 72 | Accommodation and Food Services |
| 81 | Other Services (except Public Administration) |
| 92 | Public Administration |