> ## Documentation Index
> Fetch the complete documentation index at: https://docs.companyenrich.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Look up a company's NAICS codes

> Get the NAICS codes for any company from its domain or name with the Company Enrichment API, for one company or a list, and count companies by code.

To look up a company's NAICS codes, enrich its domain with the [Company Enrichment API](https://docs.companyenrich.com/docs/company-enrichment-api.md) and add `expand=naicsCodes`. The response lists the codes as strings in `naicsCodes`, next to the company's primary `industry`. The request costs 2 credits: 1 for the company and 1 for the expansion.

> [!TIP]
>
> For a single lookup in the browser, with no API key, use the free [NAICS company lookup](https://companyenrich.com/free-tools/naics-lookup).

## Get NAICS codes from a domain

```bash cURL theme={null}
curl "https://api.companyenrich.com/v2/companies/enrich?domain=stripe.com&expand=naicsCodes" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

```javascript JavaScript theme={null}
import { CompanyEnrich } from '@companyenrich/sdk';

const client = new CompanyEnrich(); // reads COMPANYENRICH_API_KEY

const company = await client.companies.enrich({
  domain: 'stripe.com',
  expand: ['naicsCodes'],
});

console.log(company.name, company.industry, company.naicsCodes);
```

```python Python theme={null}
from companyenrich import CompanyEnrich

client = CompanyEnrich()  # reads COMPANYENRICH_API_KEY

company = client.companies.enrich("stripe.com", expand=["naicsCodes"])

print(company.get("name"), company.get("industry"), company.get("naicsCodes"))
```

```ruby Ruby theme={null}
require "companyenrich"

client = CompanyEnrich::Client.new # reads COMPANYENRICH_API_KEY

company = client.companies.enrich("stripe.com", expand: ["naicsCodes"])

puts company["name"], company["industry"]
p company["naicsCodes"]
```

```php PHP theme={null}
<?php

require 'vendor/autoload.php';

use CompanyEnrich\Client;

$client = new Client(); // reads COMPANYENRICH_API_KEY

$company = $client->companies->enrich('stripe.com', expand: ['naicsCodes']);

echo $company['name'] ?? '', ' ', $company['industry'] ?? '', PHP_EOL;
print_r($company['naicsCodes'] ?? []);
```

```bash CLI theme={null}
companyenrich company enrich stripe.com --expand naicsCodes --fields name,domain,industry,naicsCodes
```

The codes are in `naicsCodes`. This example is shortened and shows a fictional company.

```json theme={null}
{
  "id": "3f2b8c1e-6a4d-4f7a-9b21-0c5d8e7f1a23",
  "name": "Acme Analytics",
  "domain": "acme-analytics.example",
  "industry": "Software Publishers",
  "industries": ["Software Publishers"],
  "updatedAt": "2026-10-01T12:00:00Z",
  "naicsCodes": ["511210"]
}
```

`naicsCodes` is an array, because a company can belong to more than one industry. Each code is a string of digits. The later examples on this page reuse the `client` created here.

## Look up NAICS codes by company name

When you do not have a domain, send the company name to the properties lookup with the same expansion. A name alone can match several companies, and the API returns the highest-ranked one, so add `linkedinUrl` when you have it.

```bash cURL theme={null}
curl -X POST https://api.companyenrich.com/v2/companies/enrich \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Stripe",
    "expand": ["naicsCodes"]
  }'
```

```javascript JavaScript theme={null}
const company = await client.companies.enrichByProperties({
  name: 'Stripe',
  expand: ['naicsCodes'],
});

console.log(company.name, company.domain, company.naicsCodes);
```

```python Python theme={null}
company = client.companies.enrich_by_properties(
    name="Stripe",
    expand=["naicsCodes"],
)

print(company.get("name"), company.get("domain"), company.get("naicsCodes"))
```

```ruby Ruby theme={null}
company = client.companies.enrich_by_properties(
  name: "Stripe",
  expand: ["naicsCodes"]
)

puts company["name"], company["domain"]
p company["naicsCodes"]
```

```php PHP theme={null}
$company = $client->companies->enrichByProperties(
    name: 'Stripe',
    expand: ['naicsCodes'],
);

echo $company['name'] ?? '', ' ', $company['domain'] ?? '', PHP_EOL;
print_r($company['naicsCodes'] ?? []);
```

```bash CLI theme={null}
companyenrich company enrich --name "Stripe" --expand naicsCodes --fields name,domain,naicsCodes
```

Check the `domain` in the response to confirm that the API matched the company you meant. A name that matches no company returns `404`. See [When a company is not found](https://docs.companyenrich.com/docs/company-enrichment-api.md#when-a-company-is-not-found).

## Get NAICS codes for a list of companies

A batch request takes up to 50 domains. With the `naicsCodes` expansion, each company found costs 2 credits.

```bash cURL theme={null}
curl -X POST https://api.companyenrich.com/v2/companies/enrich/batch \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domains": ["stripe.com", "adyen.com", "notion.com"],
    "expand": ["naicsCodes"]
  }'
```

```javascript JavaScript theme={null}
const { items } = await client.companies.enrichBatch({
  domains: ['stripe.com', 'adyen.com', 'notion.com'],
  expand: ['naicsCodes'],
});

for (const item of items) {
  console.log(item.domain, item.status, item.company?.naicsCodes);
}
```

```python Python theme={null}
batch = client.companies.enrich_batch(
    ["stripe.com", "adyen.com", "notion.com"],
    expand=["naicsCodes"],
)

for item in batch["items"]:
    company = item.get("company") or {}
    print(item["domain"], item["status"], company.get("naicsCodes"))
```

```ruby Ruby theme={null}
batch = client.companies.enrich_batch(
  ["stripe.com", "adyen.com", "notion.com"],
  expand: ["naicsCodes"]
)

batch["items"].each do |item|
  puts "#{item['domain']} #{item['status']} #{item.dig('company', 'naicsCodes')}"
end
```

```php PHP theme={null}
$batch = $client->companies->enrichBatch(
    ['stripe.com', 'adyen.com', 'notion.com'],
    expand: ['naicsCodes'],
);

foreach ($batch['items'] as $item) {
    echo $item['domain'], ' ', $item['status'], ' ',
        implode(',', $item['company']['naicsCodes'] ?? []), PHP_EOL;
}
```

```bash CLI theme={null}
companyenrich company enrich stripe.com adyen.com notion.com --expand naicsCodes \
  --fields domain,status,company.industry,company.naicsCodes
```

For more than 50 domains, see [Enrich a list of company domains](https://docs.companyenrich.com/docs/enrich-a-list-of-company-domains.md).

## Count the companies that share a NAICS code

The company search `naicsCodes` filter takes a code or a prefix of 2 to 6 digits. The count endpoint costs no credits, so you can size an industry before you pay for any records.

```bash cURL theme={null}
curl -X POST https://api.companyenrich.com/v2/companies/search/count \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {"naicsCodes": ["5112"], "country": "US"}
  }'
```

```javascript JavaScript theme={null}
const { total } = await client.companies.count({
  filter: { naicsCodes: ['5112'], country: 'US' },
});
console.log(total);
```

```python Python theme={null}
result = client.companies.count(
    filter={"naicsCodes": ["5112"], "country": "US"},
)
print(result["total"])
```

```ruby Ruby theme={null}
result = client.companies.count(
  filter: { naicsCodes: ["5112"], country: "US" }
)
puts result["total"]
```

```php PHP theme={null}
$result = $client->companies->count(
    filter: ['naicsCodes' => ['5112'], 'country' => 'US'],
);
echo $result['total'], PHP_EOL;
```

```bash CLI theme={null}
companyenrich company count --naics 5112 --country US
```

`total` is the number of companies that match. Send the same filter to the [Company Search API](https://docs.companyenrich.com/docs/company-search-api.md) to get the companies themselves.

## Common questions

### Can a company have more than one NAICS code?

Yes. `naicsCodes` is an array, and a company that works in several industries has several codes.

### How do I get the industry name for a NAICS code?

Every company record has the name of its primary industry in `industry`, with no expansion needed. The free [`GET /v2/industries`](https://docs.companyenrich.com/api-reference/v2/get-industries) endpoint lists every industry with its NAICS code prefixes. In the CLI, `companyenrich industries software` searches that list by name.

### Does the API return SIC codes?

No. The company record has NAICS codes and industry names, not SIC codes.

### What does a NAICS lookup cost?

2 credits for each company returned: 1 for the company and 1 for the `naicsCodes` expansion. A domain with no match returns `404` and costs nothing. Counting companies by NAICS code is free.

## Related pages

> [card] [Company search filters](https://docs.companyenrich.com/docs/company-search-api-filters.md)
>
> Filter companies by NAICS code, size, location, and more.

> [card] [Enrich a list of company domains](https://docs.companyenrich.com/docs/enrich-a-list-of-company-domains.md)
>
> Classify a whole file of domains in one job.

> [card] [Company schema](https://docs.companyenrich.com/docs/company-schema.md)
>
> Every field in a company record.

> [card] [Company Enrichment API](https://docs.companyenrich.com/docs/company-enrichment-api.md)
>
> Lookup methods, parameters, pricing, and limits.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.