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

# Person Autocomplete examples

> Autocomplete examples: most common values, narrow with filters (and/or, in/not_in, numeric), and the Autocomplete → Search workflow.

This page collects examples for [Person Autocomplete](/person-docs/autocomplete/introduction).
Each example is a full working request you can copy, paste, and adapt.

For the core walkthrough (quick start, response shape), see
[Person Autocomplete](/person-docs/autocomplete/introduction). For operators, request
parameters, autocomplete-enabled fields, and errors, see
[Autocomplete reference](/person-docs/autocomplete/reference).

<Note>
  Replace `YOUR_API_KEY` in each example with your actual API key. All
  requests require the `x-api-version: 2025-11-01` header.
</Note>

***

## Get the most common values for a field

Pass an empty `query` to retrieve the top values for the field by frequency.
Useful for seeding filter dropdowns or showing popular options.

<CodeGroup>
  ```bash Request theme={"theme":"vitesse-black"}
  curl --request POST \
    --url https://api.crustdata.com/person/search/autocomplete \
    --header 'authorization: Bearer YOUR_API_KEY' \
    --header 'content-type: application/json' \
    --header 'x-api-version: 2025-11-01' \
    --data '{
      "field": "experience.employment_details.current.title",
      "query": "",
      "limit": 5
    }'
  ```

  ```json Response theme={"theme":"vitesse-black"}
  {
      "suggestions": [
          { "value": "Owner" },
          { "value": "Manager" },
          { "value": "Project Manager" },
          { "value": "Intern" },
          { "value": "Software Engineer" }
      ]
  }
  ```
</CodeGroup>

<Note>
  **Current platform behavior:** empty-query autocomplete can occasionally
  return blank string values when a field has many empty indexed records.
  Filter those out in your UI if you do not want a blank option.
</Note>

***

## Get every value of a closed-enum field

Some fields (for example, `open_to_cards` and `employment_type`) have a
**fixed, known value space**. An empty `query` returns the full set in
declaration order — useful for populating a static dropdown or chip group
without an extra round-trip.

<Tabs>
  <Tab title="open_to_cards">
    `open_to_cards` is a closed enum of exactly three codes. The alias
    `professional_network.open_to_cards` returns the same suggestions and is
    the spelling used by the `/person/search` filter.

    <CodeGroup>
      ```bash Request theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "open_to_cards",
          "query": "",
          "limit": 10
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "CAREER_INTEREST" },
              { "value": "HIRING_MANAGER" },
              { "value": "VOLUNTEERING" }
          ]
      }
      ```
    </CodeGroup>

    Feed any returned `value` back into a `professional_network.open_to_cards`
    filter on `/person/search` to find people who have surfaced that
    open-to signal on their profile.
  </Tab>

  <Tab title="employment_type">
    `employment_type` returns canonical employment labels by frequency. Use any
    returned `value` as an exact-match filter on the corresponding employment
    field — flat (`experience.employment_details.employment_type`),
    current-only (`experience.employment_details.current.employment_type`), or
    past-only (`experience.employment_details.past.employment_type`).

    <CodeGroup>
      ```bash Request theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "employment_type",
          "query": "",
          "limit": 10
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "Full-time" },
              { "value": "Part-time" },
              { "value": "Internship" }
          ]
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

***

## Narrow suggestions with filters

Scope the autocomplete to a subset of the dataset with the optional
`filters` field. The suggestions are then computed against the filtered
population.

`filters` accepts either a single `AutocompleteFilterCondition` or a nested
`AutocompleteFilterConditionGroup` combined with `and`/`or` logic.

<Tabs>
  <Tab title="Single condition">
    Use a single `AutocompleteFilterCondition` to filter on one field — for
    example, top "VP" titles among current Google employees.

    <CodeGroup>
      ```bash Request theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "experience.employment_details.current.title",
          "query": "VP",
          "limit": 5,
          "filters": {
            "field": "experience.employment_details.current.company_name",
            "type": "=",
            "value": "Google"
          }
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "VP" },
              { "value": "VP of Engineering" },
              { "value": "VP Engineering" },
              { "value": "VP Sales" },
              { "value": "vp" }
          ]
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Condition group (AND/OR)">
    Use an `AutocompleteFilterConditionGroup` to combine multiple conditions
    with `op: "and"` or `op: "or"` — for example, top titles matching
    `"engineer"` at Google in the United States.

    <CodeGroup>
      ```bash Request theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "experience.employment_details.current.title",
          "query": "engineer",
          "limit": 5,
          "filters": {
            "op": "and",
            "conditions": [
              {
                "field": "experience.employment_details.current.company_name",
                "type": "=",
                "value": "Google"
              },
              {
                "field": "basic_profile.location.country",
                "type": "=",
                "value": "United States"
              }
            ]
          }
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "Software Engineer" },
              { "value": "Senior Software Engineer" },
              { "value": "Staff Software Engineer" },
              { "value": "Senior Staff Software Engineer" },
              { "value": "Software Engineer III" }
          ]
      }
      ```
    </CodeGroup>

    Groups can be nested — pass another `AutocompleteFilterConditionGroup`
    inside `conditions` to express arbitrarily complex boolean expressions.
  </Tab>

  <Tab title="Multi-value (in / not_in)">
    Use `in` or `not_in` to match any value in a list. Pass a JSON **array** for
    `value` — a comma-separated string will return a 400.

    Top engineer titles across the United States, United Kingdom, and Canada:

    <CodeGroup>
      ```bash Request (in) theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "experience.employment_details.current.title",
          "query": "Engineer",
          "limit": 5,
          "filters": {
            "field": "basic_profile.location.country",
            "type": "in",
            "value": ["United States", "United Kingdom", "Canada"]
          }
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "Software Engineer" },
              { "value": "Senior Software Engineer" },
              { "value": "Engineer" },
              { "value": "Project Engineer" },
              { "value": "Mechanical Engineer" }
          ]
      }
      ```
    </CodeGroup>

    Top seniority levels **excluding** the United States and United Kingdom:

    <CodeGroup>
      ```bash Request (not_in) theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "experience.employment_details.current.seniority_level",
          "query": "",
          "limit": 5,
          "filters": {
            "field": "basic_profile.location.country",
            "type": "not_in",
            "value": ["United States", "United Kingdom"]
          }
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "Entry Level" },
              { "value": "Entry Level Manager" },
              { "value": "Senior" },
              { "value": "Director" },
              { "value": "Owner / Partner" }
          ]
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Numeric comparison">
    Pass numeric values as JSON numbers. Filter `value` accepts string, number,
    integer, or boolean scalars; for `in` and `not_in`, use arrays of strings,
    numbers, or integers that match the underlying field's type.

    <CodeGroup>
      ```bash Request theme={"theme":"vitesse-black"}
      curl --request POST \
        --url https://api.crustdata.com/person/search/autocomplete \
        --header 'authorization: Bearer YOUR_API_KEY' \
        --header 'content-type: application/json' \
        --header 'x-api-version: 2025-11-01' \
        --data '{
          "field": "experience.employment_details.current.title",
          "query": "",
          "limit": 3,
          "filters": {
            "field": "experience.employment_details.current.company_headcount_latest",
            "type": ">",
            "value": 10000
          }
        }'
      ```

      ```json Response theme={"theme":"vitesse-black"}
      {
          "suggestions": [
              { "value": "Owner" },
              { "value": "Manager" },
              { "value": "Project Manager" }
          ]
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

***

## Full workflow: Autocomplete → Search → Enrich

This is the canonical end-to-end Person API workflow. Autocomplete discovers
the exact title value the Search API expects, Search finds matching people,
and Enrich fills in the details.

### Step 1: Discover valid title values

<CodeGroup>
  ```bash Request theme={"theme":"vitesse-black"}
  curl --request POST \
    --url https://api.crustdata.com/person/search/autocomplete \
    --header 'authorization: Bearer YOUR_API_KEY' \
    --header 'content-type: application/json' \
    --header 'x-api-version: 2025-11-01' \
    --data '{"field": "experience.employment_details.current.title", "query": "VP Sales", "limit": 3}'
  ```

  ```json Response theme={"theme":"vitesse-black"}
  {
      "suggestions": [
          { "value": "VP Sales" },
          { "value": "VP of Sales" },
          { "value": "VP, Sales" }
      ]
  }
  ```
</CodeGroup>

**Extract:** Take `suggestions[0].value` → `"VP Sales"`. Use this exact
string in your Search filter.

**If empty:** Try a broader query (for example, `"VP"` instead of
`"VP Sales"`).

### Step 2: Search for matching people

<CodeGroup>
  ```bash Request theme={"theme":"vitesse-black"}
  curl --request POST \
    --url https://api.crustdata.com/person/search \
    --header 'authorization: Bearer YOUR_API_KEY' \
    --header 'content-type: application/json' \
    --header 'x-api-version: 2025-11-01' \
    --data '{
      "filters": {
        "op": "and",
        "conditions": [
          {"field": "experience.employment_details.current.title", "type": "in", "value": ["VP Sales", "VP of Sales"]},
          {"field": "experience.employment_details.current.company_headcount_range", "type": "in", "value": ["51-200", "201-500"]}
        ]
      },
      "limit": 3,
      "fields": ["basic_profile.name", "experience.employment_details.current.title", "experience.employment_details.current.company_name", "social_handles.professional_network_identifier.profile_url"]
    }'
  ```

  ```json Response theme={"theme":"vitesse-black"}
  {
      "profiles": [
          {
              "basic_profile": { "name": "Jane Smith" },
              "experience": {
                  "employment_details": {
                      "current": [{ "title": "VP of Sales", "name": "Acme Corp" }]
                  }
              },
              "social_handles": {
                  "professional_network_identifier": {
                      "profile_url": "https://www.linkedin.com/in/janesmith"
                  }
              }
          }
      ],
      "next_cursor": "H4sIACIdzWkC...",
      "total_count": 15420
  }
  ```
</CodeGroup>

**Extract:** Take
`social_handles.professional_network_identifier.profile_url` →
`"https://www.linkedin.com/in/janesmith"`. Pass the profile URL to Enrich.

**If empty:** Broaden filters or verify values with an earlier autocomplete
call.

### Step 3: Enrich the top match

<CodeGroup>
  ```bash Request theme={"theme":"vitesse-black"}
  curl --request POST \
    --url https://api.crustdata.com/person/enrich \
    --header 'authorization: Bearer YOUR_API_KEY' \
    --header 'content-type: application/json' \
    --header 'x-api-version: 2025-11-01' \
    --data '{"professional_network_profile_urls": ["https://www.linkedin.com/in/janesmith"]}'
  ```
</CodeGroup>

**Result:** Full person profile with employment history, education, skills,
contact info, and more. See [Person Enrich](/person-docs/enrichment/introduction) for the
full response shape.

See [Person Search](/person-docs/search/introduction) for the full filter grammar.

***

## Next steps

* [Autocomplete reference](/person-docs/autocomplete/reference) — operators, request parameters, autocomplete-enabled fields, implementation tips, errors.
* [Person Search](/person-docs/search/introduction) — use discovered values in filters.
* [Person Enrich](/person-docs/enrichment/introduction) — get full profiles after you find people.
