Skip to content
Esc
↑↓navigate↵open⌘Jpreview

v1SearchCompletions

Get search completions/suggestions for product names

QUERYv1SearchCompletions
Arguments
queryString!required

Prefix to match against names and titles. Required

limitInt

Maximum suggestions to return (default 15, max 50)

localeString!required

Locale for translated suggestion text (e.g. en, sv). Required

marketSlugString!required

Market slug used to scope product suggestions. Required

storeGroupSlugString!required

Store group slug used to scope product suggestions. Required

channelSlugString

When set, product suggestions are limited to this sales channel

searchCompletionTypes[SearchCompletionTypes!]

Entity types to suggest. Defaults to product, brand, series, category, and collection

hasActiveVariantsBoolean

When true, only products with an active variants are matched

Returns
Try it
Server
Bodyapplication/json
Request
curl -X POST 'https://graphql.enad.io/{app_id}/graphql' \
  -H 'Content-Type: application/json' \
  -d '{
  "query": "query V1SearchCompletions($query: String!, $limit: Int, $locale: String!, $marketSlug: String!, $storeGroupSlug: String!, $channelSlug: String, $searchCompletionTypes: [SearchCompletionTypes!], $hasActiveVariants: Boolean) {\n  v1SearchCompletions(query: $query, limit: $limit, locale: $locale, marketSlug: $marketSlug, storeGroupSlug: $storeGroupSlug, channelSlug: $channelSlug, searchCompletionTypes: $searchCompletionTypes, hasActiveVariants: $hasActiveVariants) {\n    value\n    highlight\n    matchType\n    rank\n    metadata {\n      id\n      slug\n    }\n  }\n}",
  "variables": {
    "query": "string",
    "limit": 0,
    "locale": "string",
    "marketSlug": "string",
    "storeGroupSlug": "string",
    "channelSlug": "string",
    "searchCompletionTypes": [
      "PRODUCT"
    ],
    "hasActiveVariants": true
  }
}'
Response
{
  "data": {
    "v1SearchCompletions": [
      {
        "value": "string",
        "highlight": "string",
        "matchType": "string",
        "rank": 0,
        "metadata": {
          "id": "string",
          "slug": "string"
        }
      }
    ]
  }
}