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

# Autocomplete Classifications

> Search and retrieve classification values for filtering leads by skills, industries, languages, and more

Provides autocomplete suggestions for classification-based filters used in lead search. This endpoint powers the autocomplete functionality in filter dropdowns, helping users discover valid classification values for skills, headlines, degrees, fields of study, languages, industries, keywords, and technologies.

## Authentication

This endpoint requires authentication. The user must be signed in to access autocomplete data.

<Note>
  This endpoint proxies requests to the Lance classification API. Results are
  cached for 7 days to improve performance.
</Note>

## Request

<ParamField query="group" type="string" default="PERSON">
  The entity group to search classifications for.

  **Allowed values:** `PERSON`, `COMPANY`
</ParamField>

<ParamField query="key" type="string" required>
  The classification type to search. Determines which category of values to return.

  **Allowed values:**

  * `SKILL` - Professional skills (e.g., "Python", "Project Management")
  * `HEADLINE` - LinkedIn headline keywords
  * `DEGREE` - Academic degrees (e.g., "Bachelor's", "MBA")
  * `FIELD_OF_STUDY` - Academic fields (e.g., "Computer Science", "Business")
  * `LANGUAGE` - Spoken languages (e.g., "English", "German")
  * `INDUSTRY` - Industry classifications (e.g., "Software", "Finance")
  * `KEYWORD` - General keywords
  * `TECHNOLOGY` - Technologies and tools (e.g., "React", "AWS")
</ParamField>

<ParamField query="value" type="string">
  Search query to filter classification values. Returns classifications that
  match this text.
</ParamField>

<ParamField query="size" type="integer" default="25">
  Number of results to return per page.
</ParamField>

<ParamField query="page" type="integer" default="0">
  Zero-based page number for pagination.
</ParamField>

## Response

Returns a paginated list of classification items matching the search criteria.

<ResponseField name="content" type="ClassificationItem[]">
  Array of classification items matching the query.

  <Expandable title="ClassificationItem properties">
    <ResponseField name="id" type="string">
      Unique identifier for the classification. Can be null.
    </ResponseField>

    <ResponseField name="key" type="string" required>
      The classification type (matches the `key` query parameter).
    </ResponseField>

    <ResponseField name="value" type="string" required>
      The classification value to display and use in filters.
    </ResponseField>

    <ResponseField name="index" type="integer" required>
      Sort index for ordering results.
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Additional metadata about the classification. Can be null.

      <Expandable title="Metadata properties">
        <ResponseField name="category" type="string">
          Category grouping for the classification. Can be null.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="totalElements" type="integer">
  Total number of matching classifications across all pages.
</ResponseField>

<ResponseField name="totalPages" type="integer">
  Total number of pages available.
</ResponseField>

<ResponseField name="size" type="integer">
  Number of items per page.
</ResponseField>

<ResponseField name="number" type="integer">
  Current page number (zero-based).
</ResponseField>

<ResponseField name="first" type="boolean">
  Whether this is the first page.
</ResponseField>

<ResponseField name="last" type="boolean">
  Whether this is the last page.
</ResponseField>

<ResponseField name="empty" type="boolean">
  Whether the result set is empty.
</ResponseField>

<ResponseField name="numberOfElements" type="integer">
  Number of elements in the current page.
</ResponseField>

## Response Examples

<ResponseExample>
  ```json 200 - Skills search theme={null}
  {
    "content": [
      {
        "id": "skill_001",
        "key": "SKILL",
        "value": "Python",
        "index": 0,
        "metadata": {
          "category": "Programming Languages"
        }
      },
      {
        "id": "skill_002",
        "key": "SKILL",
        "value": "Python Django",
        "index": 1,
        "metadata": {
          "category": "Web Frameworks"
        }
      },
      {
        "id": "skill_003",
        "key": "SKILL",
        "value": "Python Flask",
        "index": 2,
        "metadata": {
          "category": "Web Frameworks"
        }
      }
    ],
    "totalElements": 45,
    "totalPages": 2,
    "size": 25,
    "number": 0,
    "first": true,
    "last": false,
    "empty": false,
    "numberOfElements": 25
  }
  ```

  ```json 200 - Industry search theme={null}
  {
    "content": [
      {
        "id": "ind_001",
        "key": "INDUSTRY",
        "value": "Software Development",
        "index": 0,
        "metadata": null
      },
      {
        "id": "ind_002",
        "key": "INDUSTRY",
        "value": "Software as a Service (SaaS)",
        "index": 1,
        "metadata": null
      }
    ],
    "totalElements": 2,
    "totalPages": 1,
    "size": 25,
    "number": 0,
    "first": true,
    "last": true,
    "empty": false,
    "numberOfElements": 2
  }
  ```

  ```json 200 - Empty results theme={null}
  {
    "content": [],
    "totalElements": 0,
    "totalPages": 0,
    "size": 25,
    "number": 0,
    "first": true,
    "last": true,
    "empty": true,
    "numberOfElements": 0
  }
  ```

  ```json 400 - Missing key parameter theme={null}
  {
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Missing required parameter: key"
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "error": {
      "code": "UNAUTHORIZED",
      "message": "Unauthorized"
    }
  }
  ```

  ```json 500 - Server Error theme={null}
  {
    "error": {
      "code": "INTERNAL_ERROR",
      "message": "An unexpected error occurred"
    }
  }
  ```
</ResponseExample>

## Usage Examples

### Search for Python skills

```bash theme={null}
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/classifications?key=SKILL&value=python&size=10" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Get all industries

```bash theme={null}
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/classifications?key=INDUSTRY&group=COMPANY" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Paginate through languages

```bash theme={null}
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/classifications?key=LANGUAGE&page=1&size=50" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Notes

* Results are cached for 7 days to improve performance. The cache is shared across all users.
* The `group` parameter affects which classifications are returned - `PERSON` returns people-related classifications while `COMPANY` returns company-specific ones.
* Use the `value` parameter for type-ahead/autocomplete functionality - it filters results that match the search text.
* The `key` parameter is required and determines the type of classifications returned.
