# NAICS API
> The North American Industry Classification System (NAICS 2022) as an API — 2,100+ industry codes in a 5-level hierarchy (sector → subsector → industry group → industry → national industry). Look up any code (e.g. 541511 → Custom Computer Programming Services) with its full ancestor chain and direct children; search industries by title (e.g. "software", "restaurant"); or navigate the tree from the 20 top-level sectors down. NAICS is the standard used by US, Canadian and Mexican statistical agencies to classify business establishments. Ideal for business classification, market research, CRM enrichment, lead segmentation and economic analysis.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/naics-api/..."
```

## Pricing
- **Free** (Free) — 5,000 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 70,000 calls/Mo, 8 req/s
- **Pro** ($11/Mo) — 350,000 calls/Mo, 20 req/s
- **Mega** ($29/Mo) — 1,800,000 calls/Mo, 50 req/s

## Endpoints

### NAICS

#### `GET /v1/children` — Direct children of a code (or all sectors)

**Parameters:**
- `code` (query, optional, string) — Parent code, e.g. 54 (omit to list all 20 sectors) Example: `54`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/naics-api/v1/children?code=54"
```

**Response:**
```json
{
    "data": {
        "code": "54",
        "count": 1,
        "level": "sector",
        "title": "Professional, Scientific, and Technical Services",
        "children": [
            {
                "code": "541",
                "level": "subsector",
                "title": "Professional, Scientific, and Technical Services",
                "parent": "54"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T04:30:16.388Z",
        "request_id": "935e5408-bc3f-4d1a-bff3-189ab8c448dc"
    },
    "status": "ok",
    "message": "Children listed",
    "success": true
}
```

#### `GET /v1/code` — A NAICS code with ancestors + children

**Parameters:**
- `code` (query, required, string) — 2-6 digit NAICS code, e.g. 541511 Example: `541511`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/naics-api/v1/code?code=541511"
```

**Response:**
```json
{
    "data": {
        "code": "541511",
        "level": "national_industry",
        "title": "Custom Computer Programming Services",
        "parent": "54151",
        "children": [],
        "ancestors": [
            {
                "code": "54",
                "level": "sector",
                "title": "Professional, Scientific, and Technical Services",
                "parent": null
            },
            {
                "code": "541",
                "level": "subsector",
                "title": "Professional, Scientific, and Technical Services",
                "parent": "54"
            },
            {
                "code": "5415",
                "level": "industry_group",
                "title": "Computer Systems Design and Related Services",
                "parent": "541"
            },
            {
                "code": "54151",
                "level": "industry",
                "title": "Computer Systems Design and Related Services",
                "parent": "5415"
            }
        ],
        "children_count": 0
    },
    "meta": {
        "timestamp": "2026-05-31T04:30:16.462Z",
        "request_id": "3a25a187-898a-41ac-9d2a-1250f7b3d4d7"
    },
    "status": "ok",
    "message": "NAICS code retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search industries by title

**Parameters:**
- `q` (query, required, string) — Title search, e.g. software Example: `software`
- `level` (query, optional, string) — sector | subsector | industry_group | industry | national_industry
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/naics-api/v1/search?q=software&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 5,
        "level": null,
        "limit": 20,
        "query": "software",
        "total": 5,
        "offset": 0,
        "results": [
            {
                "code": "42343",
                "level": "industry",
                "title": "Computer and Computer Peripheral Equipment and Software Merchant Wholesalers",
                "parent": "4234"
            },
            {
                "code": "423430",
                "level": "national_industry",
                "title": "Computer and Computer Peripheral Equipment and Software Merchant Wholesalers",
                "parent": "42343"
            },
            {
                "code": "5132",
                "level": "industry_group",
                "title": "Software Publishers",
                "parent": "513"
            },
            {
                "code": "51321",
                "level": "industry",
                "title": "Software Publishers",
                "parent": "5132"
            },
            {
                "code": "513210",
                "level": "national_industry",
                "title": "Software Publishers",
                "parent": "51321"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T04:30:16.533Z",
        "request_id": "03a12f86-4d70-4b48-aafb-e82389a95b2c"
    },
    "status": "ok",
    "message": "NAICS codes listed",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Totals & level breakdown

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/naics-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "5-level hierarchy. Sectors may be ranges (e.g. 31-33 Manufacturing). Codes are North American (US/CA/MX) standard.",
        "total": 2125,
        "fields": [
            "code",
            "title",
            "level",
            "parent",
            "ancestors",
            "children"
        ],
        "levels": [
            {
                "count": 20,
                "level": "sector"
            },
            {
                "count": 96,
                "level": "subsector"
            },
            {
                "count": 308,
                "level": "industry_group"
            },
            {
                "count": 689,
                "level": "industry"
            },
            {
                "count": 1012,
                "level": "national_industry"
            }
        ],
        "source": "U.S. Census Bureau — NAICS 2022 (2-6 digit codes)",
        "version": "2022"
    },
    "meta": {
        "timestamp": "2026-05-31T04:30:16.604Z",
        "request_id": "a3e62d02-1208-492f-bddf-b62ece05a9a3"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/naics-api
OpenAPI spec: https://www.oanor.com/api/naics-api/openapi.json
