# Find the right NAICS code for your business

To find the right NAICS code with an AI agent, describe your work and ask it to call naics_lookup with a few keywords. It returns matching 2022 NAICS codes with titles, Census descriptions and SBA size standards; the agent compares the candidates and checks how much federal work is bought under each with search_opportunities or search_awards.

New contractors registering in SAM.gov, and established firms adding codes for a new line of work. The primary NAICS code decides which set-asides you can claim and which notices find you, so it is worth choosing with the definitions in front of you rather than from a list of titles.

## The prompt

```
We clean office buildings and also do floor care and window washing for commercial clients. Which NAICS codes fit, what are their size standards, and which one does the federal government buy most under?
```

## What the agent calls

1. naics_lookup: Codes whose title or description matches, with size standards.

```json
{"name":"naics_lookup","arguments":{"q":"janitorial","user_request":"find NAICS for cleaning business"}}
```

2. naics_lookup: A second keyword catches codes the first missed.

```json
{"name":"naics_lookup","arguments":{"q":"window cleaning","user_request":"find NAICS for cleaning business"}}
```

3. search_opportunities: A quick look at how many open notices use the leading candidate.

```json
{"name":"search_opportunities","arguments":{"naics":"561720","open":true,"limit":5,"user_request":"federal demand for 561720"}}
```

## Sample output

Trimmed; field names and structure match the live response, values are shortened or illustrative.

```json
{
  "data": [
    {
      "code": "561720",
      "title": "Janitorial Services",
      "level": 6,
      "description": "This industry comprises establishments primarily engaged in cleaning building interiors, interiors of transportation equipment (e.g., aircraft, rail cars, ships), and/or windows.",
      "size_standard_usd": 22000000,
      "naics_year": 2022
    }
  ],
  "meta": {
    "as_of": "2026-11-12"
  }
}
```

## How to read the answer

- Only 6-digit codes (level 6) can be used in a registration or a notice; shorter codes are groups.
- The Census description decides fit, not the title. Window cleaning sits inside 561720 Janitorial Services, so one code may cover several services.

## Make it yours

- Ask the agent to compare two candidate codes side by side: definition, size standard and open notices.
- Ask which codes your competitors list, using get_entity on their UEIs.

## Pitfalls

- You can list many NAICS codes in SAM.gov but the primary one should be where most of your revenue comes from.
- Choosing a code with a higher size standard to stay small is not how it works: each notice names its own code and standard.

## The same job over REST

```bash
curl "https://samgovapi.io/api/v1/naics?q=janitorial" -H "Authorization: Bearer $SAMGOVAPI_API_KEY"
```

Plan: every plan. Credits: 1 credit per 100 rows returned, minimum 1 per search.

## Questions

### Which NAICS version does the API use?

NAICS 2022, the version SAM.gov and SBA size standards use.

### Can I change my NAICS codes later?

Yes, by updating your registration at sam.gov, which is free.

All recipes: https://samgovapi.io/agents/recipes.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.
