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

# Classify NAICS industries

> Classify any brand into 2022 NAICS industry codes from its domain or name.

<Badge color="orange">10 Credits</Badge>


## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/context.dev/openapi.documented.yml get /web/naics
openapi: 3.0.0
info:
  title: Context API
  description: API for retrieving context data from any website
  version: 1.0.0
servers:
  - url: https://api.context.dev/v1
security: []
paths:
  /web/naics:
    get:
      tags:
        - Web Extraction
      summary: Classify NAICS industries
      description: >-
        Classify any brand into 2022 NAICS industry codes from its domain or
        name.
      parameters:
        - name: input
          in: query
          required: true
          schema:
            type: string
          description: >-
            Brand domain or title to retrieve NAICS code for. If a valid domain
            is provided, it will be used for classification, otherwise, we will
            search for the brand using the provided title.
        - name: minResults
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 10
            default: 1
          description: >-
            Minimum number of NAICS codes to return. Must be at least 1.
            Defaults to 1.
        - name: maxResults
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 10
            default: 5
          description: >-
            Maximum number of NAICS codes to return. Must be between 1 and 10.
            Defaults to 5.
        - $ref: '#/components/parameters/TimeoutMS'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the response, e.g., 'ok'
                  domain:
                    type: string
                    description: Domain found for the brand
                  type:
                    type: string
                    description: >-
                      Industry classification type, for naics api it will be
                      `naics`
                  codes:
                    type: array
                    description: Array of NAICS codes and titles.
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: NAICS code
                        name:
                          type: string
                          description: NAICS title
                        confidence:
                          type: string
                          enum:
                            - high
                            - medium
                            - low
                          description: >-
                            Confidence level for how well this NAICS code
                            matches the company description
                      required:
                        - code
                        - name
                        - confidence
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  error_code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
                      - VALID
                      - NOT_FOUND
                      - FORBIDDEN
                      - USAGE_EXCEEDED
                      - RATE_LIMITED
                      - UNAUTHORIZED
                      - DISABLED
                      - INSUFFICIENT_PERMISSIONS
                      - TIMEOUT_EXCEEDS_MAXIMUM
                      - WEBSITE_ACCESS_ERROR
                      - INPUT_VALIDATION_ERROR
                    description: Error code indicating the type of error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
                      - VALID
                      - NOT_FOUND
                      - FORBIDDEN
                      - USAGE_EXCEEDED
                      - RATE_LIMITED
                      - UNAUTHORIZED
                      - DISABLED
                      - INSUFFICIENT_PERMISSIONS
                      - TIMEOUT_EXCEEDS_MAXIMUM
                      - WEBSITE_ACCESS_ERROR
                      - INPUT_VALIDATION_ERROR
                    description: Error code indicating the type of error
        '404':
          description: Brand not found.
        '408':
          description: Request Timeout
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Timeout error message
                  error_code:
                    type: string
                    enum:
                      - REQUEST_TIMEOUT
                    description: Error code indicating request timeout
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import ContextDev from 'context.dev';


            const client = new ContextDev({
              apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.industry.retrieveNaics({ input:
            'input' });


            console.log(response.codes);
        - lang: Python
          source: |-
            import os
            from context.dev import ContextDev

            client = ContextDev(
                api_key=os.environ.get("CONTEXT_DEV_API_KEY"),  # This is the default and can be omitted
            )
            response = client.industry.retrieve_naics(
                input="input",
            )
            print(response.codes)
        - lang: Ruby
          source: |-
            require "context_dev"

            context_dev = ContextDev::Client.new(api_key: "My API Key")

            response = context_dev.industry.retrieve_naics(input: "input")

            puts(response)
components:
  parameters:
    TimeoutMS:
      name: timeoutMS
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/TimeoutMS'
      description: >-
        Optional timeout in milliseconds for the request. If the request takes
        longer than this value, it will be aborted with a 408 status code.
        Maximum allowed value is 300000ms (5 minutes).
  schemas:
    TimeoutMS:
      type: integer
      minimum: 1000
      maximum: 300000
      description: >-
        Optional timeout in milliseconds for the request. If the request takes
        longer than this value, it will be aborted with a 408 status code.
        Maximum allowed value is 300000ms (5 minutes).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````