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

# Input Parameters - Autocomplete API

## Required Parameters

### `api_key`

| Type     | Description          | Default | Example |
| :------- | :------------------- | :------ | :------ |
| `String` | Your secret API key. |         |         |

Your API Key **must** be included in either the request header or the `api_key` parameter. For more information about request authentication, see the [Authentication](https://docs.peopledatalabs.com/docs/authentication) page.

<br />

### `field`

| Type            | Description                                                        |
| :-------------- | :----------------------------------------------------------------- |
| `Enum (String)` | The field that the API will generate autocomplete suggestions for. |

Autocomplete suggestions will be generated based on the corresponding field(s) in the [Person Schema](https://docs.peopledatalabs.com/docs/fields).

For example, setting `field=industry` will generate autocomplete suggestions for the [`industry`](https://docs.peopledatalabs.com/docs/fields#industry), [`job_company_industry`](https://docs.peopledatalabs.com/docs/fields#job_company_industry), and [`experience.company.industry`](https://docs.peopledatalabs.com/docs/fields#experiencecompany) person fields.

See the table below for the supported Autocomplete `field` values and their corresponding Person fields:

<HTMLBlock>
  {`
  <table style="width: 100%; border-collapse: collapse;">
  <thead>
  <tr>
    <th style="border: 1px solid #ddd; padding: 8px;">Autocomplete <code>field</code> Value</th>
    <th style="border: 1px solid #ddd; padding: 8px;">Corresponding Person Fields</th>
  </tr>
  </thead>
  <tbody>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>all_location</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>Variable based on the type of location returned  </p>
  <p>(see <code>country</code>, <code>region</code>, <code>location_name</code>)</p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>class</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#job_title_class"><code>job_title_class</code></a><br>• <a href="doc:fields#experiencetitle"><code>experience.title.class</code></a> </p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>company</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#job_company_name"><code>job_company_name</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.name</code></a> </p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>country</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#location_country"><code>location_country</code></a><br>• <a href="doc:fields#countries"><code>countries</code></a><br>• <a href="doc:fields#street_addresses"><code>street_addresses.country</code></a><br>• <a href="doc:fields#job_company_location_country"><code>job_company_location_country</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.location.country</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>industry</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#industry"><code>industry</code></a><br>• <a href="doc:fields#job_company_industry"><code>job_company_industry</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.industry</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>location</code> (<strong>DEPRECATED</strong> - use <code>location_name</code> instead)</p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#location_name"><code>location_name</code></a><br>• <a href="doc:fields#location_names"><code>location_names</code></a><br>• <a href="doc:fields#street_addresses"><code>street_addresses.name</code></a><br>• <a href="doc:fields#job_company_location_name"><code>job_company_location_name</code></a><br>• <a href="doc:fields#experience"><code>experience.location_names</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.location.name</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>location_name</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#location_name"><code>location_name</code></a><br>• <a href="doc:fields#location_names"><code>location_names</code></a><br>• <a href="doc:fields#street_addresses"><code>street_addresses.name</code></a><br>• <a href="doc:fields#job_company_location_name"><code>job_company_location_name</code></a><br>• <a href="doc:fields#experience"><code>experience.location_names</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.location.name</code></a> </p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>major</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#education"><code>education.majors</code></a><br>• <a href="doc:fields#education"><code>education.minors</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>region</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#location_region"><code>location_region</code></a><br>• <a href="doc:fields#regions"><code>regions</code></a><br>• <a href="doc:fields#street_addresses"><code>street_addresses.region</code></a><br>• <a href="doc:fields#job_company_location_region"><code>job_company_location_region</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.location.region</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>role</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#job_title_role"><code>job_title_role</code></a><br>• <a href="doc:fields#experiencetitle"><code>experience.title.role</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>school</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#educationschool"><code>education.school.name</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>sub_role</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#job_title_sub_role"><code>job_title_sub_role</code></a><br>• <a href="doc:fields#experiencetitle"><code>experience.title.sub_role</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>skill</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#skills"><code>skills</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>title</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#job_title"><code>job_title</code></a><br>• <a href="doc:fields#experiencetitle"><code>experience.title.name</code></a></p>
  </td>
  </tr>
  <tr>
    <td style="border: 1px solid #ddd; padding: 8px;"><p><code>website</code></p>
  </td>
    <td style="border: 1px solid #ddd; padding: 8px;"><p>• <a href="doc:fields#job_company_website"><code>job_company_website</code></a><br>• <a href="doc:fields#experiencecompany"><code>experience.company.website</code></a> </p>
  </td>
  </tr>
  </tbody>
  </table>
  `}
</HTMLBlock>

***

## Optional Parameters

### `text`

| Type     | Description                                  | Default |
| :------- | :------------------------------------------- | :------ |
| `String` | The starting text to use for autocompletion. | `""`    |

**Example**

Let's see how the Autocomplete API behaves when we progressively build out `tesla` in the `text` field. Each call below represents a separate Autocomplete API call, where we keep updating the `text` field while keeping all other input parameters the same. For each call, we show the input parameters and the top returned result.

> 📘 Note: Click the Triangles To Expand Each of the API Calls Below
>
> Each call demonstrates the input parameters and the top result that the Autocomplete API returns.

**API Call 1:**

<details>
  <summary>text = ""</summary>

  Input Parameters:

  ```json
  params = {
      "field": "company",
      "text": "",
      "pretty": true,
      "api_key": API_KEY,
  }
  ```

  Top Autocomplete Result:

  ```json
  "data": [
      {
        "count": 501510,
        "name": "ibm",
        "meta": {
          "website": "ibm.com",
          "industry": "information technology and services",
          "location": "new york, new york, united states"
        }
      },
  ```
</details>

**API Call 2:**

<details>
  <summary>text = "t"</summary>

  Input Parameters:

  ```json
  params = {
      "field": "company",
      "text": "t",
      "pretty": true,
      "api_key": API_KEY,
  }
  ```

  Top Autocomplete Result:

  ```json
    "data": [
      {
        "count": 361642,
        "name": "tata consultancy services",
        "meta": {
          "website": "tcs.com",
          "industry": "information technology and services",
          "location": "bombay, maharashtra, india"
        }
      },
  ```
</details>

**API Call 3:**

<details>
  <summary>text = "te"</summary>

  Input Parameters:

  ```json
  params = {
      "field": "company",
      "text": "te",
      "pretty": true,
      "api_key": API_KEY,
  }
  ```

  Top Autocomplete Result:

  ```json
    "data": [
      {
        "count": 102762,
        "name": "tech mahindra",
        "meta": {
          "website": "techmahindra.com",
          "industry": "information technology and services",
          "location": "pune, maharashtra, india"
        }
      },
  ```
</details>

**API Call 4:**

<details>
  <summary>text = "tes"</summary>

  Input Parameters:

  ```json
  params = {
      "field": "company",
      "text": "tes",
      "pretty": true,
      "api_key": API_KEY,
  }
  ```

  Top Autocomplete Result:

  ```json
    "data": [
      {
        "count": 49735,
        "name": "tesco",
        "meta": {
          "website": "tescoplc.com",
          "industry": "retail",
          "location": "welwyn garden city, hertfordshire, united kingdom"
        }
      },
  ```
</details>

**API Call 5:**

<details>
  <summary>text = "tesl"</summary>

  Input Parameters:

  ```json
  params = {
      "field": "company",
      "text": "tesl",
      "pretty": true,
      "api_key": API_KEY,
  }
  ```

  Top Autocomplete Result:

  ```json
    "data": [
      {
        "count": 39992,
        "name": "tesla",
        "meta": {
          "website": "tesla.com",
          "industry": "automotive",
          "location": "palo alto, california, united states"
        }
      },
  ```
</details>

**API Call 6:**

<details>
  <summary>text = "tesla"</summary>

  Input Parameters:

  ```json
  params = {
      "field": "company",
      "text": "tesla",
      "pretty": true,
      "api_key": API_KEY,
  }
  ```

  Top Autocomplete Result:

  ```json
    "data": [
      {
        "count": 39992,
        "name": "tesla",
        "meta": {
          "website": "tesla.com",
          "industry": "automotive",
          "location": "palo alto, california, united states"
        }
      },
  ```
</details>

<br />

### `size`

| Type      | Description                                                                      | Default | Example |
| :-------- | :------------------------------------------------------------------------------- | :------ | :------ |
| `Integer` | The number of results that the API should return. Must be between `1` and `100`. | `10`    | `25`    |

<br />

### `titlecase `

| Type      | Description                                                                                                                           | Default | Example |
| :-------- | :------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------ |
| `Boolean` | All text in API responses returns as lowercase by default. Setting `titlecase` to `true` will titlecase any records returned instead. | `false` | `true`  |

<br />

### `pretty`

| Type      | Description                                                                               | Default | Example |
| :-------- | :---------------------------------------------------------------------------------------- | :------ | :------ |
| `Boolean` | Whether the output should have [human-readable](http://jsonprettyprint.net/) indentation. | `false` | `true`  |

<br />

### `updated_title_roles`

| Type      | Description                                                                                                        | Default | Example |
| :-------- | :----------------------------------------------------------------------------------------------------------------- | :------ | :------ |
| `Boolean` | Temporary parameter. Set to true to return the updated values for role and subrole along with the new class field. | `false` | `true`  |