Skip to Content
API ReferenceAnalytics Tools

Analytics Tools

Tools for analyzing and comparing NAICS codes.

compare_codes

Compare two NAICS codes side-by-side to understand their differences.

Parameters

ParameterTypeRequiredDescription
code1stringYesFirst NAICS code
code2stringYesSecond 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

ParameterTypeRequiredDefaultDescription
codestringYes—NAICS code
limitintegerNo10Maximum results
same_sectorbooleanNofalseLimit 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

ParameterTypeRequiredDescription
codestringYesNAICS 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

ParameterTypeRequiredDescription
sector_codestringYes2-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

ParameterTypeRequiredDefaultDescription
naics_codestringYes—NAICS code to find similar codes for
min_similarityfloatNo0.75Minimum similarity threshold (0-1)
include_cross_sectorbooleanNotrueInclude codes from different sectors
limitintegerNo10Maximum 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

ParameterTypeRequiredDefaultDescription
naics_codestringYes—NAICS code to find alternatives for
min_similarityfloatNo0.70Minimum similarity threshold
top_nintegerNo10Maximum 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

SimilarityInterpretation
> 0.85Strong alternative - carefully evaluate which fits better
0.75 - 0.85Consider if the business has activities in both areas
0.70 - 0.75Tangentially 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

ParameterTypeRequiredDescription
naics_codestringYesNAICS 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: true indicates potential classification ambiguity
  • Prioritize review: High cross_sector_count suggests the code needs careful evaluation

Interpreting Stats

MetricInterpretation
High cross_sector_countCode has broad semantic overlap with other sectors
Low cross_sector_countCode is highly specific to its sector
High avg_similarityStrong alternatives exist - may need careful selection
has_cross_sector: trueFlag 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 ambiguous

All Sectors Reference

CodeTitle
11Agriculture, Forestry, Fishing and Hunting
21Mining, Quarrying, and Oil and Gas Extraction
22Utilities
23Construction
31-33Manufacturing
42Wholesale Trade
44-45Retail Trade
48-49Transportation and Warehousing
51Information
52Finance and Insurance
53Real Estate and Rental and Leasing
54Professional, Scientific, and Technical Services
55Management of Companies and Enterprises
56Administrative and Support and Waste Management
61Educational Services
62Health Care and Social Assistance
71Arts, Entertainment, and Recreation
72Accommodation and Food Services
81Other Services (except Public Administration)
92Public Administration