younifyd
Menu

site_search_searchProducts

Search products by term, price, rating, category, brand and attributes, with sort, available filters and suggestions.

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the site_search_searchProducts action (under Search).
  3. Fill in the fields below, then reference the result from later steps as {{siteSearchSearchproducts.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query SiteSearchSearchProducts($filters: SearchProductsFiltersInput!, $sort: SearchProductsSortInput) {
  site {
    search {
      searchProducts(filters: $filters, sort: $sort) {
        suggestions {
          sourceField
          results {
            text
          }
        }
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

filtersobjectrequired

Available search filters for use when querying products

searchTermstring
priceobject2 fields
ratingobject2 fields
categoryEntityIdnumber
categoryEntityIdsarray<number>
searchSubCategoriesboolean
brandEntityIdsarray<number>
productAttributesarray<object>2 fields
isFreeShippingboolean
isFeaturedboolean
hideOutOfStockboolean
topLevelOnlyboolean
categoryIdsFilterobject2 fields
sortstring

The results are sorted by relevance if the sort argument is not provided.

One ofA_TO_ZBEST_REVIEWEDBEST_SELLINGFEATUREDHIGHEST_PRICELOWEST_PRICENEWESTRELEVANCEZ_TO_A

json
{
  "filters": {
    "searchTerm": "string",
    "price": {
      "minPrice": 0,
      "maxPrice": 0
    },
    "rating": {
      "minRating": 0,
      "maxRating": 0
    },
    "categoryEntityId": 0,
    "categoryEntityIds": [
      0
    ],
    "searchSubCategories": false,
    "brandEntityIds": [
      0
    ],
    "productAttributes": [
      {
        "attribute": "string",
        "values": "string"
      }
    ],
    "isFreeShipping": false,
    "isFeatured": false,
    "hideOutOfStock": false,
    "topLevelOnly": false
  },
  "sort": "A_TO_Z"
}

Response

Read the result with {{siteSearchSearchproducts.response.data.data.searchProducts}}. If the API returns errors, the step fails and they are at {{siteSearchSearchproducts.response.data.errors}}.

suggestionsarray<object>
sourceFieldobject
resultsobject

Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.