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

# Autocomplete

> Returns typeahead suggestions as the user types. Autocomplete can be configured to display document titles, but this is an account-wide setting — contact Cludo support to enable it.

## Autocomplete strategies

Autocomplete can be configured to display document titles instead of plain suggestions. This is an account-wide setting — contact Cludo support to enable it.

When title-based autocomplete is enabled, suggestions are backed by real indexed documents. You can narrow results using the `filters` query parameter with any indexed field:


## OpenAPI

````yaml GET /api/v4/{customerId}/{engineId}/autocomplete
openapi: 3.1.0
info:
  title: Cludo Search API
  version: 4.0.0
  description: >-
    Full-text search, autocomplete, and related search suggestions for Cludo
    search engines.
servers:
  - url: https://api.cludo.com
    description: EU region (Customer IDs below 10,000,000)
  - url: https://api-us1.cludo.com
    description: US region (Customer IDs 10,000,000 and above)
security:
  - SiteKey: []
paths:
  /api/v4/{customerId}/{engineId}/autocomplete:
    get:
      summary: Get Autocomplete Suggestions
      description: >-
        Returns typeahead suggestions as the user types. Autocomplete can be
        configured to display document titles, but this is an account-wide
        setting — contact Cludo support to enable it.
      operationId: getAutoComplete
      parameters:
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/engineId'
        - name: query
          in: query
          required: true
          description: The partial text the user has typed so far.
          schema:
            type: string
        - name: results
          in: query
          required: false
          description: Maximum number of suggestions to return.
          schema:
            type: integer
            default: 5
        - name: responseType
          in: query
          required: false
          description: >-
            `JsonObject` — structured JSON (recommended). `JsonHtml` — HTML
            fragments.
          schema:
            type: string
            enum:
              - JsonObject
              - JsonHtml
        - name: filters
          in: query
          required: false
          description: >-
            JSON-encoded filter object restricting autocomplete results by field
            value. Only applies when title-based autocomplete is enabled — has
            no effect in plain suggestions mode. Any indexed field can be used.
            Example: `{"Category":["Guides"]}`.
          schema:
            type: string
          example: '{"Category":["Guides"]}'
      responses:
        '200':
          description: Autocomplete suggestions returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoCompleteResponse'
              example:
                results:
                  - fields:
                      Title: Search API reference
                      Url: https://docs.example.com/search-api
                    id: https://docs.example.com/search-api
                suggestions:
                  - search api
                  - search analytics
                totalResults: 6
                totalSuggestions: 2
                queryId: b7e4d2c1-8f3a-4e1b-9c6d-2a8f4e7b1c5d
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - SiteKey: []
        - BasicAuth: []
components:
  parameters:
    customerId:
      name: customerId
      in: path
      required: true
      description: >-
        Your Cludo account ID. Find it in
        [MyCludo](https://my.cludo.com/install/api).
      schema:
        type: integer
    engineId:
      name: engineId
      in: path
      required: true
      description: The search engine to query. Must match the engine ID in your SiteKey.
      schema:
        type: integer
  schemas:
    AutoCompleteResponse:
      type: object
      properties:
        results:
          type: array
          description: >-
            Top document hits that match the partial `query`, each with `fields`
            (e.g. Title, Url) and `id`.
          items:
            type: object
            properties:
              fields:
                type: object
                additionalProperties:
                  type: string
                description: >-
                  Displayed columns for the hit row (strings only in this
                  schema).
              id:
                type: string
                description: Document id in the index (often URL or CMS id).
        suggestions:
          type: array
          description: >-
            Plain-text completions to show in the dropdown (may differ from
            `results` titles).
          items:
            type: string
        topHits:
          type: object
          description: >-
            Optional grouped counts per field value (e.g. top categories
            matching the prefix).
          additionalProperties:
            type: array
            items:
              type: object
              properties:
                value:
                  type: string
                  description: Facet value.
                count:
                  type: integer
                  description: Number of hits under this value.
        totalResults:
          type: integer
          description: >-
            Count of document hits returned or considered for this autocomplete
            call.
        totalSuggestions:
          type: integer
          description: Count of string suggestions in `suggestions`.
        facets:
          type: object
          description: >-
            Lightweight facet map for the autocomplete context (shape similar to
            search `Facets` when present).
        queryId:
          type: string
          description: Correlation id for analytics (optional depending on engine).
    ErrorResponse:
      type: object
      description: Error response returned when a request fails.
      properties:
        message:
          type: string
          description: A message describing what went wrong.
    UnauthorizedError:
      type: object
      description: Returned when authentication fails.
      properties:
        message:
          type: string
          description: Authentication failure reason.
    ServerError:
      type: object
      description: Returned when an unexpected server error occurs.
      properties:
        status:
          type: string
          description: HTTP status name.
        code:
          type: integer
          description: HTTP status code.
        messages:
          type: array
          items:
            type: string
          description: Error details, usually including a support reference id.
  responses:
    BadRequest:
      description: >-
        The request is invalid. This typically occurs due to missing required
        fields, incorrect parameter values, or malformed request body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: >-
              The request could not be processed. Check the request body and
              required parameters.
    Unauthorized:
      description: >-
        Authentication failed. The Authorization header is missing or contains
        invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
          example:
            message: unauthorized
    InternalServerError:
      description: >-
        An unexpected server error occurred. If this persists, contact
        support@cludo.com.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
          example:
            status: InternalServerError
            code: 500
            messages:
              - >-
                Error occur. Please contact support with error ID:
                a1b2c3d4-e5f6-7890-abcd-ef1234567890
  securitySchemes:
    SiteKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        SiteKey authentication. Pass the full value including the `SiteKey`
        prefix: `SiteKey <base64(customerId:engineId:searchKey)>`. Example:
        `SiteKey dGVzdDoxMjM0NTY3Ojk4NzY1`. See the [Authentication
        guide](/authentication) for details.
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication. Use your Customer ID as the username and API Key
        as the password. Example header: `Authorization: Basic
        MTIzNDU2NzpteS1hcGkta2V5`. See the [Authentication
        guide](/authentication) for details.

````