Execute text-based semantic searches within your product catalog with typo tolerance and query understanding.
<YOUR_LAYERS_TOKEN>.sdk-name/version (e.g., layers-js-sdk/1.0.0). When provided with version >= 1.0.0, the server returns HTTP 425 (Too Early) with a Retry-After header when prepared search data isn’t ready yet, instead of blocking. This enables efficient client-side polling for async search operations.id, title, handle, body_html, vendor, product_type, tags, images, available, created_at, updated_at, published_at, price_range, options, original_options, metafields, named_tags, calculated, category, featured_media, is_gift_card, has_variants_that_require_components, combined_listing_parent_product_id, combined_listing_role, first_or_matched_variant, and variants. See the Product Schema for detailed descriptions."vendor", "options.Size") and wildcard patterns (e.g., "options.*", "metafields.product.*").Wildcard patterns expand to all matching attribute codes. For example, "options.*" expands to all option facets like "options.Size" and "options.Color". Wildcards must match at least one attribute code to be valid.Examples:first_or_matched_variant field. This is useful for scenarios like defaulting to a specific birthstone option when searching in a jewelry store.Behavior:first_or_matched_variant field in the response"relevance" for the default relevance-based ranking, or any custom sort order code configured in your store. Retrieve available sort order codes from the Sort Orders API.true, products with no available variants are excluded from results regardless of the store-level out-of-stock visibility setting. If your store has location-based stock checking configured, the same location rules apply.This is useful when a specific search integration or page requires strict in-stock filtering even though the store default allows out-of-stock products to appear._meta.redirect object with the redirect URL. In this case, the results array will be empty and totalResults will be 0. Semantic redirects only apply to text search queries (not image or similar product searches).includeFacetRanges is true then an object with keys of the facet attribute code and value is an object with min/max.retrieveFacetCount is true then an object with keys and values of the specified attributes. When variant breakouts are enabled, facet counts reflect tile counts rather than product counts. Empty values and literal "null" strings are automatically excluded from facet results.| Header | Description |
|---|---|
x-request-id | A unique identifier (ULID) for the request. This matches the attributionToken in the response body. Use it to correlate requests across your infrastructure or when contacting support. |
x-layers-build | The Layers build version that served the request. |
X-Layers-Results-Cache | Indicates whether the response was served from the results cache. Returns HIT when cached results were used, or MISS when results were computed fresh. Use this to monitor cache effectiveness and debug performance. |
Link | Contains rel="preload" directives for product images in the response (up to 6 items), enabling browsers and CDNs to begin fetching images before your application processes the JSON body. Each entry includes a responsive imagesrcset with multiple sizes. See Early hints for configuration options. Only included when early hints are enabled for your store (enabled by default). |
__typename field to identify the tile type:
"Product" - A standard product tile"Variant" - An individual variant tile from a product with a configured breakout optionid field.id field contains the variant ID (not the product ID). The title field is formatted as "{product title} - {option value}" by default (e.g., “Amethyst Ring - Rose Quartz”), but this can be configured per breakout. If the breakout’s “Include Option Value in Title” setting is disabled, the title will be the original product title. See the Variant Breakouts documentation for more details.