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

# Typeahead Service API

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

The Lucidworks Typeahead Service API returns a list of suggestions created in Lucidworks Platform Core Settings. Using the unique `TYPEAHEAD_ID` for your Typeahead configuration, you can retrieve a list of suggestions based on the characters included in the request.

<Note>
  For detailed API specifications in Swagger/OpenAPI format, see [Platform APIs](/api-reference/get-typeahead-suggestions).
</Note>

<LwTemplate />

## Prerequisites

To use this API, you need:

* Typeahead suggestions entered or written into Lucidworks Platform Core Settings. A total of 5,000 suggestions are allowed in the following distribution:

  * Your organization can enter a maximum of 4,000 custom terms (included and excluded) in the Core Settings Typeahead user interface.

  * Every hour, a maximum of 1,000 of the terms entered most often in customer searches are added to the Included typeahead suggestions list.

* The unique `TYPEAHEAD_ID` for your typeahead implementation. Contact your Lucidworks Platform representative for this information.

## Unique values for the typeahead use case

Some query parameters unique to the `typeahead` use case can be used in the URL of the `GET` request of the Core Settings Typeahead Service API, including `prefix` and `limit`. Refer to the [API spec](/api-reference/get-typeahead-suggestions) for more information.

### Example GET request with `prefix` query parameter

```bash wrap Request theme={"dark"}
curl --request GET \
  --url  https://{TYPEAHEAD_ID}.typeahead.lucidworks.com/typeahead/suggestions?prefix=El \
  --header 'Accept: application/json' \
  --header 'Authorization: Embed EMBED_TOKEN' \
  --header 'Content-type: application/json' \
  --data ''
```

#### Response

The API call returns suggestions that begins with the letters `El`.

```json wrap theme={"dark"}
[
  "Elastic",
  "Electric",
  "Electrical",
  "Electronics",
  "Elegant",
  "Element",
  "Elevator",
  "Elite",
  "Elixir",
  "Ellipse"
]
```

## Result sorting

Typeahead results are sorted alphabetically. Sort options are not currently available with the API.

<Note>
  If the request does not include a query parameter after the `?` in the URL of the request, the complete list of suggestions is returned.
</Note>
