Blog·Craft·

The search result shows what matched

A NAICS result can match an activity term that is absent from its title. The match field explains why the result appeared.

Search for "coffee shop" in an industry classification and the result is "Snack and Nonalcoholic Beverage Bars." The title is useful once you know the classification, but it doesn't show the words you searched for. In a picker, that can look like a search that missed.

NAICS search returns a match object alongside the industry's name. For example, this response excerpt shows the connection for GET /naics?q=coffee%20shop&limit=5:

{
  "q": "coffee shop",
  "country": "US",
  "year": 2022,
  "results": [
    {
      "naics": "722515",
      "name": "Snack and Nonalcoholic Beverage Bars",
      "match": {
        "field": "term",
        "text": "Coffee shops, on premise brewing",
        "corrections": []
      }
    }
  ]
}

name stays the classification's title. match.text is the activity term that matched the search. Showing it beneath the title gives someone choosing a code a reason to open that result, without renaming the industry to whatever they typed.

The field can also be name when the title matched, or naics when the query matched a code. corrections records spelling corrections when the search used them. It's empty here because ordinary plural matching doesn't count as a spelling correction. These fields describe how the query matched the result. They don't say that the result has been assigned to a particular business.

That still leaves a classification decision. The endpoint serves the US 2022 edition, and a short phrase doesn't describe everything a business does. On a paid plan, GET /naics/722515?deep=true adds the full definition and exclusions under deep. Exclusions explain activities that belong elsewhere. For this code, preparing and serving snacks or nonalcoholic beverages from a mobile vehicle points to 722330, Mobile Food Services.

Search does not match exclusion text. That would make an industry show up for an activity its definition tells you to put somewhere else. Use the matching term to understand the search result, then read the definition and exclusions before choosing the code.