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
| Parameter | Description | Type | Notes |
|---|---|---|---|
| term | The prefix string to autocomplete | string | Required |
| source | Custom fields to search for completions | string | Only custom fields with data-type text are supported. Specify one or multiple fields from which to fetch suggestions. |
| size | Number of suggestions to return | int | Optional, 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
| Field | Description | Type |
|---|---|---|
| autocomplete | Array of autocomplete suggestion objects | array 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.