v1

latestOpenAPI 3.1.02026-07-241765501.1 MB
Autocomplete results

Retrieve by prefix

Retrieve AI optimized autocomplete results for products and search suggestions (and/or optionally other sections). Prefix length is limited to 200 characters.

get/v1/autocomplete/{prefix}

Path parameters

prefixstring path required
Example:red shoes

Query parameters

keystring required

The key of the index to use.

Example:key_K2pX7vBnU0bgA5xp
num_section_results_per_pageobject

The number of section results per page to return.

{
  "Products": 10,
  "Search Suggestions": 5
}
offset_per_sectionobject

The offset of section results to return.

{
  "Products": 0,
  "Search Suggestions": 0
}
page_per_sectionobject

The page of section results to return.

{
  "Products": 1,
  "Search Suggestions": 1
}
filtersobject
filter_match_typesobject

An object specifying whether results must match all, any or none of a given filter when multiple options of the same facet (e.g: color: yellow & blue) are selected.

{
  "color": "any",
  "size": "all"
}
object
OR
string json
num_resultsinteger
Example:10
nowstring date-time

A date time representing the current moment in time when applying filtering by product age. Used to emulate "past/future" requests. Requires authentication.

Example:2024-01-15T10:30:00Z
valuesobject required

A set of aggregations that should be applied to each variation group. The object keys specify the name of the field under which each aggregated value will be returned in the response

dtype'array' | 'object' required

The expected data type of the variations_map objects in the response

fieldsstring[]

A list of specific item fields to return in the response. Allows the request to control which fields are returned.

show_hidden_fieldsboolean

A flag to return all hidden fields in the response.

hidden_fieldsstring[]

A list of specific hidden fields to return in the response. Unlike show_hidden_fields this parameter allows the request to control which hidden fields are returned. Used to return item fields for a particular store or user segment.

variations_return_type'default' | 'all' | 'matched'
show_protected_facetsboolean

A flag to return all protected facets in the response. Requires authentication.

{
  "fields": [
    "image_url"
  ],
  "hidden_fields": [
    "inventory_count"
  ]
}
qsstring json

A JSON-encoded query string. Any query parameters listed for this endpoint can be serialized into a JSON string and parsed thru the qs param.

origin_referrerstring

The url or app location where the request originated.

Example:https://example.com/search
cstring

The ID of the client and version that the request is coming from, such as cio-js-2.90.

Example:cio-js-client-2.35.2
usstring[]

A customer defined context (such as vip-club-member) used to evaluate redirect or refined tag rules. Pass multiple segments by passing multiple us arguments.

[
  "vip-member"
]
uistring

A customer generated anonymized identifier for a user on a customer website. It should only be sent for logged in customers and helps Constructor to tie multiple client and session IDs together to form a behavioral data profile across devices.

Example:customer-user-id-456
sinteger

An integer representing the users session number (starting with 1), incremented after a 30 minute period of inactivity.

Example:1
istring

A globally unique identifier for the user browser (or mobile application instance) making the request.

Example:user-device-id-123
lang'ar' | 'ca' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'es' | 'et' | 'eu' | 'fi' | 'fr' | 'ga' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'it' | 'lt' | 'lv' | 'ne' | 'nl' | 'no' | 'pl' | 'pt' | 'ro' | 'ru' | 'sk' | 'sr' | 'sv' | 'ta' | 'tr' | 'yi'

A specification of the user query language. When provided, this parameter enables language-specific processing such as stemming to improve relevance and recall.

Example:en

Response

OK

requestobject required

The request arguments how they were interpreted by the API. This field is of arbitrary type, ie it doesn't have a guaranteed schema, and data from it shouldn't be used programmatically, it is for debugging purposes only.

result_idstring
sectionsobject required
total_num_results_per_sectionobject
All 176 operations