> ## 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 Schools

> Search and retrieve school/university suggestions for education-based lead filtering

Provides autocomplete suggestions for schools and universities. This endpoint powers the autocomplete functionality in education filter dropdowns, helping users discover valid school names when filtering leads by educational background.

## Authentication

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

<Note>
  This endpoint proxies requests to the company search metadata API with a
  school filter. Results are cached for 7 days to improve performance.
</Note>

## Request

<ParamField query="search" type="string">
  Search query to filter school names. Returns schools that match this text.
  **Example:** `"Stanford"`, `"MIT"`, `"Harvard"`
</ParamField>

<ParamField query="size" type="integer" default="10">
  Number of results to return per page. Maximum recommended is 100.
</ParamField>

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

## Response

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

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

  <Expandable title="SchoolItem properties">
    <ResponseField name="id" type="string" required>
      Unique identifier for the school.
    </ResponseField>

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

    <ResponseField name="logo" type="string">
      URL to the school's logo image. Can be null.
    </ResponseField>

    <ResponseField name="url" type="string">
      LinkedIn or external profile URL for the school. Can be null.
    </ResponseField>

    <ResponseField name="domain" type="string">
      Primary domain associated with the school. Can be null.
    </ResponseField>

    <ResponseField name="domainLtd" type="string">
      Top-level domain variation. Can be null.
    </ResponseField>

    <ResponseField name="website" type="string">
      Official website URL for the school. Can be null.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="totalElements" type="integer">
  Total number of matching schools 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 - Schools search theme={null}
  {
    "content": [
      {
        "id": "school_001",
        "name": "Stanford University",
        "logo": "https://media.licdn.com/dms/image/C4D0BAQGpkTfVh3vJrQ/company-logo_200_200/0/1631355051949",
        "url": "https://www.linkedin.com/school/stanford-university/",
        "domain": "stanford.edu",
        "domainLtd": "edu",
        "website": "https://www.stanford.edu"
      },
      {
        "id": "school_002",
        "name": "Stanford Graduate School of Business",
        "logo": "https://media.licdn.com/dms/image/C4E0BAQHpBPxGvjLtGQ/company-logo_200_200/0/1625167812432",
        "url": "https://www.linkedin.com/school/stanford-gsb/",
        "domain": "gsb.stanford.edu",
        "domainLtd": "edu",
        "website": "https://www.gsb.stanford.edu"
      }
    ],
    "totalElements": 15,
    "totalPages": 2,
    "size": 10,
    "number": 0,
    "first": true,
    "last": false,
    "empty": false,
    "numberOfElements": 10
  }
  ```

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

  ```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 Stanford schools

```bash theme={null}
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/schools?search=stanford&size=10" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Get Ivy League schools

```bash theme={null}
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/schools?search=harvard" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Paginate through results

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

### Search without filter (browse all)

```bash theme={null}
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/schools?size=25" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Notes

* Results are cached for 7 days to improve performance. The cache is shared across all users.
* Use the `search` parameter for type-ahead/autocomplete functionality - it filters results that match the search text.
* The default page size is 10 items. Increase the `size` parameter for more results per request.
* Schools include universities, colleges, business schools, and other educational institutions.
* The `logo` field provides LinkedIn-hosted images when available.
