The Autocomplete endpoint returns ranked query-text suggestions for a partial search term. It does not return products, product previews, or images. Use the Search endpoint to fetch products for a chosen suggestion.When no query is provided, the endpoint returns the store’s top trending queries (subject to the same brand curation rules as live suggestions).
The partial query you want suggestions for. Maximum 255 characters. Sanitized server-side; queries shorter than 2 characters after sanitization are treated as empty and return trending suggestions instead.
Ranked array of suggestion strings. Prefix matches appear first, followed by non-prefix matches that clear the relevance threshold. Each string is the suggestion text the shopper should see: either the cluster’s canonical query or its curated display label when one is configured.
The destination URL the storefront should navigate to. Suggestions are still returned alongside the redirect. With the Layers app embed enabled, the Storefront Pixel follows the redirect when the shopper submits the query or clicks its suggestion, so theme code only renders the suggestion list. Headless storefronts without the embed decide whether to follow the redirect immediately or render the suggestion list.
Semantic Redirects: When the autocomplete query matches a configured semantic redirect term, either exactly or semantically, the response includes a _meta.redirect object with the redirect URL. This lets you redirect users directly from the typeahead experience before they submit a full search.
Suggestion candidates can be scoped to the shopper’s country before matching runs. Layers resolves the country from IP-based geolocation and applies the store’s region mode:
Separate suggestions per region (default): shoppers in each country see suggestions built from that country’s own search activity. If a country doesn’t yet have enough curated search history to stand on its own, shoppers there receive the shared, store-wide suggestion set instead.
One set of suggestions for all shoppers: every request returns the same store-wide suggestion set, regardless of the shopper’s location.
Requests with no resolvable location always receive the store-wide set. Configure the mode in the Layers dashboard under Settings → Autocomplete. See Configure autocomplete curation for steps.
You can layer a natural-language brand prompt on top of the default suggestion pipeline. Layers uses the prompt, together with your store description, to suppress off-brand suggestions and rewrite display labels for customers. Suppressed clusters never appear in matchedQueries, and curated clusters return their rewritten text in place of the canonical query. Matching against raw customer queries is unchanged. See Autocomplete curation for configuration details.
Autocomplete automatically collapses singular and plural variants of the same word into a single suggestion. For example, if your query data contains both “diamond” and “diamonds”, only the higher-scoring canonical form is returned. This also applies to other English stem variations like “berry” and “berries” or “long sleeve” and “long-sleeve”.Stem awareness extends to query matching as well. When a shopper types “diamonds”, autocomplete finds suggestions containing the singular “diamond” and vice versa, so singular and plural queries produce the same suggestion list.When multiple suggestions share the same stem, the suggestion with the highest relevance score is kept. Shorter canonical forms (typically the singular) win ties, which keeps the suggestion list clean and predictable.
Suggestions that don’t closely match the query text are filtered out before results are returned. Prefix matches (where the query is the beginning of a suggestion) always pass through. Non-prefix matches must meet a minimum text-similarity threshold to appear. This prevents semantically distant suggestions from surfacing alongside direct matches.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Layers","colors":{"primary":"#607FFD","light":"#AFC0FF","dark":"#3A57E8"},"logo":{"light":"https://mintcdn.com/protoninc/PNs-gxGUVcdBDEEC/logo.svg?fit=max\u0026auto=format\u0026n=PNs-gxGUVcdBDEEC\u0026q=85\u0026s=989e3194cb32f07e7018b8b7186b9007","dark":"https://mintcdn.com/protoninc/PNs-gxGUVcdBDEEC/logo.svg?fit=max\u0026auto=format\u0026n=PNs-gxGUVcdBDEEC\u0026q=85\u0026s=989e3194cb32f07e7018b8b7186b9007","href":"https://www.uselayers.com/?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site"},"favicon":"https://mintcdn.com/protoninc/qubyNEZK4oJTl9By/favicon.svg?fit=max\u0026auto=format\u0026n=qubyNEZK4oJTl9By\u0026q=85\u0026s=3611d60346e12f15e4684bc60cb69ece","api":{"mdx":{"server":"https://app.uselayers.com/api/storefront/v1"}},"navbar":{"links":[{"href":"https://www.uselayers.com/changelog?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site","label":"Changelog"},{"href":"mailto:support@uselayers.com","label":"Support"},{"href":"https://app.uselayers.com/dashboard?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-dashboard","label":"Dashboard"}],"primary":{"type":"button","label":"Request Demo","href":"https://www.uselayers.com/demo?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/uselayers"},"links":[{"header":"Legal","items":[{"label":"Privacy Statement","href":"https://docs.uselayers.com/legal/privacy-statement"},{"label":"Terms of Use","href":"https://docs.uselayers.com/legal/terms-of-use"}]}]},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"protoninc","hasAudioNarration":false,"actualSubdomain":"protoninc","customDomains":["docs.uselayers.com"],"gitSource":{"type":"github","owner":"protonagency","repo":"layers-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae388771c7a51ca965c930e","collectionId":"b1813d3c-a1b3-44c1-b58f-077ab7c9b91e","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae388771c7a51ca965c930e"},"feedback":{"thumbs":true,"edits":false,"issues":false,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"}},"buildId":"6ae388771c7a51ca965c930e","clientVersion":"0.0.4039","searchFilterCounts":[{"language":"default","tag":"Documentation","count":102},{"language":"default","tag":"Help Center","count":72},{"language":"default","tag":"Merchandising","count":54},{"language":"default","tag":"Developers","count":42},{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"SDK","count":20},{"language":"default","tag":"Sort Orders","count":16},{"language":"default","tag":"Liquid","count":14},{"language":"default","tag":"Search \u0026 Discovery","count":14},{"language":"default","tag":"Configuration","count":14}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false,"deflection":{"enabled":true,"email":"support@uselayers.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/predict","slug":"/api-reference/predict","pageMetadata":{"api":"GET /search/complete?query={query}","title":"Autocomplete: Get Suggestions","sidebarTitle":"Get Suggestions","description":"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.","href":"/api-reference/predict"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,Note,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The Autocomplete endpoint returns ranked `,_jsx(_components.strong,{children:`query-text suggestions`}),` for a partial search term. It does `,_jsx(_components.strong,{children:`not`}),` return products, product previews, or images. Use the `,_jsx(_components.a,{href:`/api-reference/search`,children:`Search`}),` endpoint to fetch products for a chosen suggestion.`]}),`\n`,_jsxs(_components.p,{children:[`When no `,_jsx(_components.code,{children:`query`}),` is provided, the endpoint returns the store’s top trending queries (subject to the same brand curation rules as live suggestions).`]}),`\n`,_jsx(Heading,{level:`2`,id:`authorization`,children:`Authorization`}),`\n`,_jsx(ParamField,{header:`X-Storefront-Access-Token`,type:`string`,required:true,id:`param-x-storefront-access-token`,children:_jsxs(_components.p,{children:[`Token-based authentication header in the form of `,_jsx(_components.code,{children:`\u003cYOUR_LAYERS_TOKEN>`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,default:`application/json`,required:true,id:`param-content-type`}),`\n`,_jsx(ParamField,{header:`Accept`,type:`string`,default:`application/json`,required:true,id:`param-accept`}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameters`,children:`Query parameters`}),`\n`,_jsx(ParamField,{query:`query`,type:`string`,id:`param-query`,children:_jsx(_components.p,{children:`The partial query you want suggestions for. Maximum 255 characters. Sanitized server-side; queries shorter than 2 characters after sanitization are treated as empty and return trending suggestions instead.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`matchedQueries`,type:`string[]`,id:`param-matched-queries`,children:_jsx(_components.p,{children:`Ranked array of suggestion strings. Prefix matches appear first, followed by non-prefix matches that clear the relevance threshold. Each string is the suggestion text the shopper should see: either the cluster’s canonical query or its curated display label when one is configured.`})}),`\n`,_jsx(ResponseField,{name:`originalQuery`,type:`string | null`,id:`param-original-query`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`query`}),` value exactly as sent by the client. `,_jsx(_components.code,{children:`null`}),` when the request omits `,_jsx(_components.code,{children:`query`}),` or when the sanitized query is too short.`]})}),`\n`,_jsx(ResponseField,{name:`normalizedQuery`,type:`string | null`,id:`param-normalized-query`,children:_jsxs(_components.p,{children:[`The lowercased, trimmed form of `,_jsx(_components.code,{children:`originalQuery`}),` used internally for matching. `,_jsx(_components.code,{children:`null`}),` when no query was effectively provided.`]})}),`\n`,_jsxs(ResponseField,{name:`_meta`,type:`object`,id:`param-meta`,children:[_jsxs(_components.p,{children:[`Optional metadata. Present only when a `,_jsx(_components.a,{href:`/platform/semantic-redirects`,children:`semantic redirect`}),` matches the current query.`]}),_jsx(Expandable,{title:`Properties`,children:_jsx(ResponseField,{name:`redirect`,type:`object`,id:`param-redirect`,children:_jsx(Expandable,{title:`Properties`,children:_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url`,children:_jsx(_components.p,{children:`The destination URL the storefront should navigate to. Suggestions are still returned alongside the redirect. With the Layers app embed enabled, the Storefront Pixel follows the redirect when the shopper submits the query or clicks its suggestion, so theme code only renders the suggestion list. Headless storefronts without the embed decide whether to follow the redirect immediately or render the suggestion list.`})})})})})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Semantic Redirects`}),`: When the autocomplete query matches a configured `,_jsx(_components.a,{href:`/platform/semantic-redirects`,children:`semantic redirect`}),` term, either exactly or semantically, the response includes a `,_jsx(_components.code,{children:`_meta.redirect`}),` object with the redirect URL. This lets you redirect users directly from the typeahead experience before they submit a full search.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`suggestion-quality`,children:`Suggestion quality`}),`\n`,_jsx(_components.p,{children:`Layers applies several techniques to keep autocomplete suggestions relevant and concise.`}),`\n`,_jsx(Heading,{level:`3`,id:`regional-suggestions`,children:`Regional suggestions`}),`\n`,_jsx(_components.p,{children:`Suggestion candidates can be scoped to the shopper’s country before matching runs. Layers resolves the country from IP-based geolocation and applies the store’s region mode:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Separate suggestions per region`}),` (default): shoppers in each country see suggestions built from that country’s own search activity. If a country doesn’t yet have enough curated search history to stand on its own, shoppers there receive the shared, store-wide suggestion set instead.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`One set of suggestions for all shoppers`}),`: every request returns the same store-wide suggestion set, regardless of the shopper’s location.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Requests with no resolvable location always receive the store-wide set. Configure the mode in the Layers dashboard under `,_jsx(_components.strong,{children:`Settings → Autocomplete`}),`. See `,_jsx(_components.a,{href:`/help/configuration/configure-autocomplete-curation#regional-suggestions`,children:`Configure autocomplete curation`}),` for steps.`]}),`\n`,_jsx(Heading,{level:`3`,id:`brand-curation`,children:`Brand curation`}),`\n`,_jsxs(_components.p,{children:[`You can layer a natural-language brand prompt on top of the default suggestion pipeline. Layers uses the prompt, together with your store description, to suppress off-brand suggestions and rewrite display labels for customers. Suppressed clusters never appear in `,_jsx(_components.code,{children:`matchedQueries`}),`, and curated clusters return their rewritten text in place of the canonical query. Matching against raw customer queries is unchanged. See `,_jsx(_components.a,{href:`/platform/autocomplete-curation`,children:`Autocomplete curation`}),` for configuration details.`]}),`\n`,_jsx(Heading,{level:`3`,id:`stem-deduplication`,children:`Stem deduplication`}),`\n`,_jsx(_components.p,{children:`Autocomplete automatically collapses singular and plural variants of the same word into a single suggestion. For example, if your query data contains both “diamond” and “diamonds”, only the higher-scoring canonical form is returned. This also applies to other English stem variations like “berry” and “berries” or “long sleeve” and “long-sleeve”.`}),`\n`,_jsx(_components.p,{children:`Stem awareness extends to query matching as well. When a shopper types “diamonds”, autocomplete finds suggestions containing the singular “diamond” and vice versa, so singular and plural queries produce the same suggestion list.`}),`\n`,_jsx(_components.p,{children:`When multiple suggestions share the same stem, the suggestion with the highest relevance score is kept. Shorter canonical forms (typically the singular) win ties, which keeps the suggestion list clean and predictable.`}),`\n`,_jsx(Heading,{level:`3`,id:`relevance-gating`,children:`Relevance gating`}),`\n`,_jsx(_components.p,{children:`Suggestions that don’t closely match the query text are filtered out before results are returned. Prefix matches (where the query is the beginning of a suggestion) always pass through. Non-prefix matches must meet a minimum text-similarity threshold to appear. This prevents semantically distant suggestions from surfacing alongside direct matches.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"api":"GET /search/complete?query={query}","title":"Autocomplete: Get Suggestions","sidebarTitle":"Get Suggestions","description":"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.","href":"/api-reference/predict"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The Autocomplete endpoint returns ranked `,_jsx(_components.strong,{children:`query-text suggestions`}),` for a partial search term. It does `,_jsx(_components.strong,{children:`not`}),` return products, product previews, or images. Use the `,_jsx(_components.a,{href:`/api-reference/search`,children:`Search`}),` endpoint to fetch products for a chosen suggestion.`]}),`\n`,_jsxs(_components.p,{children:[`When no `,_jsx(_components.code,{children:`query`}),` is provided, the endpoint returns the store’s top trending queries (subject to the same brand curation rules as live suggestions).`]}),`\n`,_jsx(Heading,{level:`2`,id:`authorization`,children:`Authorization`}),`\n`,_jsx(ParamField,{header:`X-Storefront-Access-Token`,type:`string`,required:true,id:`param-x-storefront-access-token`,children:_jsxs(_components.p,{children:[`Token-based authentication header in the form of `,_jsx(_components.code,{children:`\u003cYOUR_LAYERS_TOKEN>`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,default:`application/json`,required:true,id:`param-content-type`}),`\n`,_jsx(ParamField,{header:`Accept`,type:`string`,default:`application/json`,required:true,id:`param-accept`}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameters`,children:`Query parameters`}),`\n`,_jsx(ParamField,{query:`query`,type:`string`,id:`param-query`,children:_jsx(_components.p,{children:`The partial query you want suggestions for. Maximum 255 characters. Sanitized server-side; queries shorter than 2 characters after sanitization are treated as empty and return trending suggestions instead.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`matchedQueries`,type:`string[]`,id:`param-matched-queries`,children:_jsx(_components.p,{children:`Ranked array of suggestion strings. Prefix matches appear first, followed by non-prefix matches that clear the relevance threshold. Each string is the suggestion text the shopper should see: either the cluster’s canonical query or its curated display label when one is configured.`})}),`\n`,_jsx(ResponseField,{name:`originalQuery`,type:`string | null`,id:`param-original-query`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`query`}),` value exactly as sent by the client. `,_jsx(_components.code,{children:`null`}),` when the request omits `,_jsx(_components.code,{children:`query`}),` or when the sanitized query is too short.`]})}),`\n`,_jsx(ResponseField,{name:`normalizedQuery`,type:`string | null`,id:`param-normalized-query`,children:_jsxs(_components.p,{children:[`The lowercased, trimmed form of `,_jsx(_components.code,{children:`originalQuery`}),` used internally for matching. `,_jsx(_components.code,{children:`null`}),` when no query was effectively provided.`]})}),`\n`,_jsxs(ResponseField,{name:`_meta`,type:`object`,id:`param-meta`,children:[_jsxs(_components.p,{children:[`Optional metadata. Present only when a `,_jsx(_components.a,{href:`/platform/semantic-redirects`,children:`semantic redirect`}),` matches the current query.`]}),_jsx(Expandable,{title:`Properties`,children:_jsx(ResponseField,{name:`redirect`,type:`object`,id:`param-redirect`,children:_jsx(Expandable,{title:`Properties`,children:_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url`,children:_jsx(_components.p,{children:`The destination URL the storefront should navigate to. Suggestions are still returned alongside the redirect. With the Layers app embed enabled, the Storefront Pixel follows the redirect when the shopper submits the query or clicks its suggestion, so theme code only renders the suggestion list. Headless storefronts without the embed decide whether to follow the redirect immediately or render the suggestion list.`})})})})})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Semantic Redirects`}),`: When the autocomplete query matches a configured `,_jsx(_components.a,{href:`/platform/semantic-redirects`,children:`semantic redirect`}),` term, either exactly or semantically, the response includes a `,_jsx(_components.code,{children:`_meta.redirect`}),` object with the redirect URL. This lets you redirect users directly from the typeahead experience before they submit a full search.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`suggestion-quality`,children:`Suggestion quality`}),`\n`,_jsx(_components.p,{children:`Layers applies several techniques to keep autocomplete suggestions relevant and concise.`}),`\n`,_jsx(Heading,{level:`3`,id:`regional-suggestions`,children:`Regional suggestions`}),`\n`,_jsx(_components.p,{children:`Suggestion candidates can be scoped to the shopper’s country before matching runs. Layers resolves the country from IP-based geolocation and applies the store’s region mode:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Separate suggestions per region`}),` (default): shoppers in each country see suggestions built from that country’s own search activity. If a country doesn’t yet have enough curated search history to stand on its own, shoppers there receive the shared, store-wide suggestion set instead.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`One set of suggestions for all shoppers`}),`: every request returns the same store-wide suggestion set, regardless of the shopper’s location.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Requests with no resolvable location always receive the store-wide set. Configure the mode in the Layers dashboard under `,_jsx(_components.strong,{children:`Settings → Autocomplete`}),`. See `,_jsx(_components.a,{href:`/help/configuration/configure-autocomplete-curation#regional-suggestions`,children:`Configure autocomplete curation`}),` for steps.`]}),`\n`,_jsx(Heading,{level:`3`,id:`brand-curation`,children:`Brand curation`}),`\n`,_jsxs(_components.p,{children:[`You can layer a natural-language brand prompt on top of the default suggestion pipeline. Layers uses the prompt, together with your store description, to suppress off-brand suggestions and rewrite display labels for customers. Suppressed clusters never appear in `,_jsx(_components.code,{children:`matchedQueries`}),`, and curated clusters return their rewritten text in place of the canonical query. Matching against raw customer queries is unchanged. See `,_jsx(_components.a,{href:`/platform/autocomplete-curation`,children:`Autocomplete curation`}),` for configuration details.`]}),`\n`,_jsx(Heading,{level:`3`,id:`stem-deduplication`,children:`Stem deduplication`}),`\n`,_jsx(_components.p,{children:`Autocomplete automatically collapses singular and plural variants of the same word into a single suggestion. For example, if your query data contains both “diamond” and “diamonds”, only the higher-scoring canonical form is returned. This also applies to other English stem variations like “berry” and “berries” or “long sleeve” and “long-sleeve”.`}),`\n`,_jsx(_components.p,{children:`Stem awareness extends to query matching as well. When a shopper types “diamonds”, autocomplete finds suggestions containing the singular “diamond” and vice versa, so singular and plural queries produce the same suggestion list.`}),`\n`,_jsx(_components.p,{children:`When multiple suggestions share the same stem, the suggestion with the highest relevance score is kept. Shorter canonical forms (typically the singular) win ties, which keeps the suggestion list clean and predictable.`}),`\n`,_jsx(Heading,{level:`3`,id:`relevance-gating`,children:`Relevance gating`}),`\n`,_jsx(_components.p,{children:`Suggestions that don’t closely match the query text are filtered out before results are returned. Prefix matches (where the query is the beginning of a suggestion) always pass through. Non-prefix matches must meet a minimum text-similarity threshold to appear. This prevents semantically distant suggestions from surfacing alongside direct matches.`}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Response`,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"matchedQueries\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sup\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"supreme\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"originalQuery\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sup\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"normalizedQuery\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sup\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Response (with semantic redirect)`,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"matchedQueries\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"support\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"originalQuery\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"support\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"normalizedQuery\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"support\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"_meta\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"redirect\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://yourstore.com/pages/contact-us\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Response (no query — trending suggestions)`,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"matchedQueries\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"summer dresses\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"linen shirts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"white sneakers\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"originalQuery\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"normalizedQuery\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"api":"GET /search/complete?query={query}","title":"Autocomplete: Get Suggestions","sidebarTitle":"Get Suggestions","description":"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.","href":"/api-reference/predict"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Authorization","slug":"authorization","depth":2,"children":[]},{"title":"Headers","slug":"headers","depth":2,"children":[]},{"title":"Query parameters","slug":"query-parameters","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Suggestion quality","slug":"suggestion-quality","depth":2,"children":[{"title":"Regional suggestions","slug":"regional-suggestions","depth":3,"children":[]},{"title":"Brand curation","slug":"brand-curation","depth":3,"children":[]},{"title":"Stem deduplication","slug":"stem-deduplication","depth":3,"children":[]},{"title":"Relevance gating","slug":"relevance-gating","depth":3,"children":[]}]}],"codeExamples":{"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"8\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"matchedQueries\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"sup\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"supreme\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"originalQuery\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"sup\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"normalizedQuery\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"sup\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Response (with semantic redirect)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"12\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"matchedQueries\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"support\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"originalQuery\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"support\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"normalizedQuery\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"support\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"_meta\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"redirect\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"url\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://yourstore.com/pages/contact-us\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Response (no query — trending suggestions)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"9\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"matchedQueries\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"summer dresses\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"linen shirts\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"white sneakers\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"originalQuery\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"normalizedQuery\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Autocomplete: Get Suggestions","path":"/search/complete?query={query}","servers":[{"url":"https://app.uselayers.com/api/storefront/v1"}],"method":"get","request":{"security":[],"parameters":{"query":{"query":{"schema":[{"type":"string","description":"The partial query you want suggestions for. Maximum 255 characters. Sanitized server-side; queries shorter than 2 characters after sanitization are treated as empty and return trending suggestions instead."}]}},"header":{"X-Storefront-Access-Token":{"schema":[{"type":"string","description":"Token-based authentication header in the form of `\u003cYOUR_LAYERS_TOKEN>` .","required":true}]},"Content-Type":{"schema":[{"type":"string","required":true}]},"Accept":{"schema":[{"type":"string","required":true}]}},"cookie":{},"path":{}},"body":{}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"matchedQueries":[{"type":"array","items":[{"type":"string"}],"description":"Ranked array of suggestion strings. Prefix matches appear first, followed by non-prefix matches that clear the relevance threshold. Each string is the suggestion text the shopper should see: either the cluster’s canonical query or its curated display label when one is configured."}],"originalQuery":[{"type":"object","properties":{},"description":"The `query` value exactly as sent by the client. `null` when the request omits `query` or when the sanitized query is too short."}],"normalizedQuery":[{"type":"object","properties":{},"description":"The lowercased, trimmed form of `originalQuery` used internally for matching. `null` when no query was effectively provided."}],"_meta":[{"type":"object","properties":{"redirect":[{"type":"object","properties":{"url":[{"type":"string","description":"The destination URL the storefront should navigate to. Suggestions are still returned alongside the redirect. With the Layers app embed enabled, the Storefront Pixel follows the redirect when the shopper submits the query or clicks its suggestion, so theme code only renders the suggestion list. Headless storefronts without the embed decide whether to follow the redirect immediately or render the suggestion list."}]}}]},"description":"Optional metadata. Present only when a semantic redirect matches the current query."}]}}],"examples":{"example":{"value":{"matchedQueries":["\u003cstring>"],"originalQuery":{},"normalizedQuery":{},"_meta":{"redirect":{"url":"\u003cstring>"}}}}}}}},"deprecated":false}},"jsLinks":["/_mintlify/custom/protoninc/d2da920448b9ce07/track.js"],"subdomain":"protoninc","siteName":"Layers","title":"Autocomplete: Get Suggestions - Layers","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T15:51:08.533Z","originalFileLocation":"api-reference/predict.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Layers\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Autocomplete: Get Suggestions - Layers\">\u003cmeta data-mint-head property=\"og:description\" content=\"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Layers\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.uselayers.com/api-reference/predict\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://protoninc.mintlify.app/_mintlify/api/og/v2?division=Autocomplete\u0026amp;title=Autocomplete%3A+Get+Suggestions\u0026amp;description=Autocomplete+API+endpoint+returning+ranked+search-query+suggestions+and+top+trending+queries+as+shoppers+type+into+your+storefront+search+bar.\u0026amp;theme=a10a6113a77cea89cec87611\u0026amp;signature=b2daf403ddd80e2d9435bb0768cb2e9f892d51137ed17b604ab52dfc828da191\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Autocomplete: Get Suggestions - Layers\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://protoninc.mintlify.app/_mintlify/api/og/v2?division=Autocomplete\u0026amp;title=Autocomplete%3A+Get+Suggestions\u0026amp;description=Autocomplete+API+endpoint+returning+ranked+search-query+suggestions+and+top+trending+queries+as+shoppers+type+into+your+storefront+search+bar.\u0026amp;theme=a10a6113a77cea89cec87611\u0026amp;signature=b2daf403ddd80e2d9435bb0768cb2e9f892d51137ed17b604ab52dfc828da191\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Layers\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#607FFD\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.uselayers.com/api-reference/predict\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/predict.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.uselayers.com/#organization\",\"name\":\"Layers\",\"url\":\"https://docs.uselayers.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/protoninc/PNs-gxGUVcdBDEEC/logo.svg?fit=max\u0026auto=format\u0026n=PNs-gxGUVcdBDEEC\u0026q=85\u0026s=989e3194cb32f07e7018b8b7186b9007\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.uselayers.com#website\",\"name\":\"Layers\",\"url\":\"https://docs.uselayers.com\",\"publisher\":{\"@id\":\"https://docs.uselayers.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.uselayers.com/api-reference/predict#webpage\",\"url\":\"https://docs.uselayers.com/api-reference/predict\",\"name\":\"Autocomplete: Get Suggestions\",\"description\":\"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.\",\"dateModified\":\"2026-10-21T15:51:08.533Z\",\"isPartOf\":{\"@id\":\"https://docs.uselayers.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.uselayers.com/api-reference/predict#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.uselayers.com/api-reference/predict#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Product Search\",\"item\":\"https://docs.uselayers.com/api-reference/search-prepare\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Autocomplete: Get Suggestions\",\"item\":\"https://docs.uselayers.com/api-reference/predict\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.uselayers.com/api-reference/predict#apireference\",\"headline\":\"Autocomplete: Get Suggestions\",\"name\":\"Autocomplete: Get Suggestions\",\"description\":\"Autocomplete API endpoint returning ranked search-query suggestions and top trending queries as shoppers type into your storefront search bar.\",\"url\":\"https://docs.uselayers.com/api-reference/predict\",\"mainEntityOfPage\":{\"@id\":\"https://docs.uselayers.com/api-reference/predict#webpage\"},\"dateModified\":\"2026-10-21T15:51:08.533Z\",\"publisher\":{\"@id\":\"https://docs.uselayers.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.uselayers.com#website\"}}]}\u003c/script>","siteName":"Layers","nav":{"global":null,"anchors":[{"anchor":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"anchor":"Help Center","icon":"map","pages":[{"title":"Help Center","href":"/help/onboarding/install"}]},{"anchor":"Developers","icon":"code","pages":[{"title":"Developers","href":"/developers/overview"}]},{"anchor":"API Reference","icon":"rectangle-terminal","tabs":[{"tab":"Storefront API","groups":[{"group":"Browse","pages":[{"api":"POST /browse/{collection_handle}","title":"Browse API: Browse Collection Page","sidebarTitle":"Collection Page","href":"/api-reference/browse"}]},{"group":"Product Search","pages":[{"group":"Text Search","pages":[{"api":"POST /search/{searchQuery}/prepare","title":"Text Search: Prepare Search","sidebarTitle":"Prepare Search","href":"/api-reference/search-prepare"},{"api":"POST /search/{searchQuery}/execute","title":"Text Search: Execute Search","sidebarTitle":"Execute Search","href":"/api-reference/search"},{"api":"POST /search/feedback","title":"Text Search: Submit Feedback","sidebarTitle":"Submit Feedback","href":"/api-reference/search-feedback"}]},{"group":"Image Search","pages":[{"api":"POST /images/upload","title":"Image Search: Upload Image","sidebarTitle":"Upload Image","href":"/api-reference/upload-image"},{"api":"POST /search/image","title":"Image Search: Execute Search","sidebarTitle":"Execute Search","description":"Image Search API endpoint to run visual searches across your product catalog using uploaded image IDs or base64-encoded image payloads.","href":"/api-reference/search-image"}]},{"group":"Autocomplete","pages":[{"api":"GET /search/complete?query={query}","title":"Autocomplete: Get Suggestions","sidebarTitle":"Get Suggestions","href":"/api-reference/predict"}]},{"api":"POST /search/product/{searchProductId}","title":"Search API: Similar Products","sidebarTitle":"Similar Products","description":"Similar Products API endpoint that returns visually and semantically related items to a given product from your catalog for recommendation carousels.","href":"/api-reference/similar-products"}]},{"group":"Content Search","pages":[{"api":"POST /search/content/{searchQuery}/execute","title":"Content Search: Execute Search","sidebarTitle":"Execute Search","href":"/api-reference/search-content"}]},{"group":"Blocks","pages":[{"api":"POST /blocks/{blockId}/products","title":"Blocks API: Get Block Products","sidebarTitle":"Block Products","href":"/api-reference/blocks"}]},{"group":"Facets","pages":[{"api":"POST /{collection_handle}/facets","title":"Facets API: Get Collection Facets","sidebarTitle":"Collection Facets","href":"/api-reference/facets"}]},{"group":"Utilities","pages":[{"api":"GET /sort-orders","title":"Sort Orders API: Get Available Sort Orders","sidebarTitle":"Sort Orders","href":"/api-reference/sort-orders"}]}]},{"tab":"Tracking API","pages":[{"title":"Tracking API","href":"/tracking-api/overview"}]}]},{"anchor":"Integrations","icon":"plug","href":"https://www.uselayers.com/integrations?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site"}]},"basePath":"","title":"Autocomplete: Get Suggestions - Layers","buildId":"dpl_77Hw7ZuAABM8E3WMbYAf2ohQCr3v","deploymentId":"dpl_77Hw7ZuAABM8E3WMbYAf2ohQCr3v","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-CVpqyvFO.js","utils-vpweLD0v.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BIOodqb0.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B1LM3qmu.js","snippetPresets-C5xK0GtN.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CCsxLnQl.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C2-WKG22.js","shallow-SdoLUC-q.js","getApiPlaygroundDisplay-BnI8L2hB.js","CodeSnippet-D5M8NCHI.js","CodeSnippets-CXRO8Uom.js","Page-CN9QbZiA.js","getPastedJson-CrfHEdRt.js","icon-Cr8AyUnW.js","MethodPill-J_Cs0kNw.js","DuplicateIcon-DrMboxGw.js","createIcon-B4CIWVbU.js","DynamicMarkdown-D9cdbgj9.js","SectionHeading-BO4CouT0.js","axios-vUo_bRtp.js"]}