Skip to main content

Autocomplete API

Use the Autocomplete API to retrieve word completion suggestions from custom text fields in your AddSearch index.

Endpoint

GET /v1/autocomplete/document-field/{index_public_key}

Replace {index_public_key} with your index's public API key.

Query Parameters

ParameterDescriptionTypeNotes
termThe prefix string to autocompletestringRequired
sourceCustom fields to search for completionsstringOnly custom fields with data-type text are supported. Specify one or multiple fields from which to fetch suggestions.
sizeNumber of suggestions to returnintOptional, defaults to 10

Example Request

GET https://api.addsearch.com/v1/autocomplete/document-field/{index_public_key}?term=go&source=custom_fields.fashion_brand

Example Response

{
"autocomplete": [
{ "value": "Golden Lighting" },
{ "value": "Golfino" },
{ "value": "Gottex" },
{ "value": "42 Gold" },
{ "value": "ÁLVARO GONZÁLEZ" }
]
}

Response Fields

FieldDescriptionType
autocompleteArray of autocomplete suggestion objectsarray of objects with value strings

Additional Information

  • This endpoint does not require authentication.
  • The default rate limit is 5 requests per second per IP address.
  • To request a higher rate limit, contact AddSearch support at Contact Support.

For assistance or questions about using the Autocomplete API, reach out to our support team via the link above.