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

# Reference - Autocomplete API

# Endpoint

The endpoint for the Autocomplete API is: `https://api.peopledatalabs.com/v5/autocomplete`.

# Autocomplete API Access and Billing

By default, all active API keys have free access to the Autocomplete API.

When monitoring usage, each call to the Autocomplete API counts against the daily rate limit, regardless of the records available.

# Rate Limiting

Our default limit for self-serve customers is 60 requests per minute and 1,000 requests per day. For enterprise customers, we offer rate limits of up to 1,200 requests per minute. If you are interested in higher rate limits, please [reach out to us](https://www.peopledatalabs.com/talk-to-sales).

# Input Parameters

> 📘 For More Details, See [Input Parameters - Autocomplete API](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api).
>
> You can also click on the individual parameter names in the table below to view more information on them.

<Table align={["left","left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter Name
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>

      <th>
        Default
      </th>

      <th>
        Example
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        [`field`](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#field)
      </td>

      <td>
        Yes
      </td>

      <td>
        The field that the API will perform autocompletion upon.
      </td>

      <td>
        None
      </td>

      <td>
        `title`
      </td>
    </tr>

    <tr>
      <td>
        [`text`](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#text)
      </td>

      <td>
        No
      </td>

      <td>
        The text that the API will use as the seed for autocompletion.
      </td>

      <td>
        `""`
      </td>

      <td>
        `tesl`
      </td>
    </tr>

    <tr>
      <td>
        [`size`](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#size)
      </td>

      <td>
        No
      </td>

      <td>
        The number of results that the API should return, which must be between `1` and `100`.
      </td>

      <td>
        `10`
      </td>

      <td>
        `100`
      </td>
    </tr>

    <tr>
      <td>
        [`titlecase`](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#titlecase)
      </td>

      <td>
        No
      </td>

      <td>
        All text in API responses returns as lowercase by default. Setting titlecase to `true` will titlecase any records returned instead.
      </td>

      <td>
        `false`
      </td>

      <td>
        `true`
      </td>
    </tr>

    <tr>
      <td>
        [`pretty`](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#pretty)
      </td>

      <td>
        No
      </td>

      <td>
        Whether the output should have human-readable indentation.
      </td>

      <td>
        `false`
      </td>

      <td>
        `true`
      </td>
    </tr>

    <tr>
      <td>
        [`api_key`](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#api_key)
      </td>

      <td>
        No\*
      </td>

      <td>
        Your secret API key.

        While we do not require this as part of the request parameters, if you do not provide it here, then you must provide it using an alternative means, such as in the headers using the `x-api-key` field. For more information, see the [Authentication](https://docs.peopledatalabs.com/docs/authentication) page.
      </td>

      <td>
        None
      </td>

      <td />
    </tr>
  </tbody>
</Table>

# Output Response

> 📘 For More Details, See [Output Response - Autocomplete API](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api)
>
> You can also click the field names in the table below to view more information on them.

| Field Name                                                                                      | Type             | Description                                                                                                                                                                                                                                                                                                                                                                                               |
| :---------------------------------------------------------------------------------------------- | :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`fields`](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#fields)        | `Array (String)` | The list of fields in the [Person Schema](https://docs.peopledatalabs.com/docs/fields) that the Autocomplete API has returned suggestions for. It determines these based on the value that you used for the [`field` input parameter](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#field).                                                                                                                       |
| [`data`](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#data)            | `Array (Object)` | The list of suggestions that the Autocomplete API has returned. It sorts results in descending order based on the `data.count` subfield (with the highest counts first.) The [`size` input parameter](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#size) determines the size of the list.                                                                                       |
| [`data.count`](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#datacount) | `Int`            | The number of records in our [Person Dataset (resume slice)](https://docs.peopledatalabs.com/docs/resume-stats) for this Autocomplete API suggestion. The API uses this field for sorting elements in the `data` array.                                                                                                                                                                                   |
| [`data.name`](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#dataname)   | `String`         | The plain text name of the Autocomplete API suggestion. For example, company name, school name, location name, title and so forth. The prefix of this field will match the value of the [`text` input parameter](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#text).                                                                                                            |
| [`data.meta`](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#datameta)   | `Object`         | A set of additional fields that the API returns for each result in the data array. The metadata fields depend on the [`field` input parameter](https://docs.peopledatalabs.com/docs/input-parameters-autocomplete-api#field). See the mapping between `field` values (input parameter) and `meta` (output fields) [here](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#datameta). |
| [`status`](https://docs.peopledatalabs.com/docs/output-response-autocomplete-api#status)        | `Int`            | The [API response code](https://docs.peopledatalabs.com/docs/errors).                                                                                                                                                                                                                                                                                                                                                                      |

## Abridged Response Data Structure

Here is an example response from the Autocomplete API when querying for `field = "company"` and `text = "goog"` (See a full example response in the [next section](#full-example-response-autocomplete-api---school-index).)

```json
{
  "data": [
    {
      "name": "Google",
      "count": 197302,
      "meta": {
        "id": "aKCIYBNF9ey6o5CjHCCO4goHYKlf",
        "website": "google.com",
        "industry": "Internet",
        "location_name": "Mountain View, California, United States",
        "display_name": "Google",
        "display_name_history": [
          "Google"
        ],
        "alternative_names": [
          "\u8c37\u6b4c",
          "Google, Social Marketing Tools",
          "\uad6c\uae00",
          "Google Inc.",
          "Google Pay",
          "Google, Inc.",
          "Google Deepmind",
          "Google Inc",
          "Google Digital Skills for Africa",
          "Google, Inc"
        ]
      }
    },
   ...
  ],
  "fields": [
    "job_company_name",
    "experience.company.name"
  ],
  "status": 200
}
```

## Full Example Response (Autocomplete API - School Index)

<details>
  <summary>Input Query (click to toggle)</summary>

  ```python
  import json

  # See https://github.com/peopledatalabs/peopledatalabs-python
  from peopledatalabs import PDLPY

  # Create a client, specifying an API key
  client = PDLPY(
      api_key="YOUR API KEY",
  )

  params = {
      "field": "school",
      "text": "harv",
      "size": 10,
      "pretty": True
  }

  json_response = client.autocomplete(**params).json()

  print(json_response)
  ```
</details>

Output Response (full):

```json
{
  "data": [
    {
      "name": "harvard university",
      "count": 1927529,
      "meta": {
        "id": "3533/1_nmK6OO9uG-7wiyTDSIrDiA_0",
        "website": "harvard.edu",
        "location_name": "cambridge, massachusetts, united states"
      }
    },
    {
      "name": "harvard business school",
      "count": 220817,
      "meta": {
        "id": "3533/1_qBjTBJNpBK2gzteZ59vd8A_0",
        "website": "hbs.edu",
        "location_name": "boston, massachusetts, united states"
      }
    },
    {
      "name": "harvard - westlake school",
      "count": 124263,
      "meta": {
        "id": "3533/1_NH1qPhIlKjFKZ1nf2Qgt3g_0",
        "website": "hw.com",
        "location_name": "studio city, california, united states"
      }
    },
    {
      "name": "harvard law school",
      "count": 96958,
      "meta": {
        "id": "3533/1_teCnNBZuJ7ec9lfQzEOvyg_0",
        "website": "hls.harvard.edu",
        "location_name": "cambridge, massachusetts, united states"
      }
    },
    {
      "name": "harvard business school online",
      "count": 70877,
      "meta": {
        "id": "3533/1_UB212jNfQFFVng4KfGkYlQ_0",
        "website": "online.hbs.edu",
        "location_name": "boston, massachusetts, united states"
      }
    },
    {
      "name": "harvard medical school",
      "count": 61403,
      "meta": {
        "id": "3533/1_YNnwi4r2jhgVlAvd7O400Q_0",
        "website": "hms.harvard.edu",
        "location_name": "boston, massachusetts, united states"
      }
    },
    {
      "name": "harvard extension school",
      "count": 38259,
      "meta": {
        "id": "3861/1_hJfk3w2iEDrBWBdwlSOyzg_0"
      }
    },
    {
      "name": "harvard graduate school of education",
      "count": 31485,
      "meta": {
        "id": "3533/1_R-t9DblDP5zWHDnIlJjY9g_0",
        "website": "gse.harvard.edu",
        "location_name": "cambridge, massachusetts, united states"
      }
    },
    {
      "name": "harvard kennedy school",
      "count": 30697,
      "meta": {
        "id": "3533/1_nTJjAd36aI1cfDBojvtlHA_0",
        "website": "hks.harvard.edu",
        "location_name": "cambridge, massachusetts, united states"
      }
    },
    {
      "name": "harvard business school executive education",
      "count": 27768,
      "meta": {
        "id": "3533/1_HTv2bAJvLvwEEeG0ai63BQ_0",
        "website": "hbs.me",
        "location_name": "boston, massachusetts, united states"
      }
    }
  ],
  "fields": [
    "education.school.name"
  ],
  "status": 200
}
```

## Errors

If the request encounters an error, it will instead return an Error Response in the format described in [Errors](https://docs.peopledatalabs.com/docs/errors).