NAV

Find products using filters

You can find products according to your filter facets both in the Ecwid REST API and in merchant’s storefront.

Filter facets help you find available values for the search process. For example, learn that a store has a Red value for Color product option and Adidas value for Brand attiribute.

Step 1. Get filter facets

Get available filters in the REST API.

Step 2. Get products according to filters

Once you have the required filter facets, start searching for products:

Find products in Ecwid REST API

Using filters in REST API example

GET https://app.ecwid.com/api/v3/api/v3/4870020/products?attribute_Brand=Adidas&option_Color=Red&priceTo=100&token=1234567890qwqeertt 
HTTP/1.1
Host: app.ecwid.com
Content-Type: application/json;charset=utf-8
Cache-Control: no-cache
Accept-Encoding: gzip

When you received all the needed filter facets from the Ecwid API, use them when searching for products.

As a result, you will have the list of products that follow your search rules and all of their details, like price, SKU, images and many others.

Find products in storefront

Filters in query parameters on search page example

GET https://mdemo.ecwid.com/search?keyword=surfboard&inventory=instock&priceFrom=20

You can use query parameters of a URL in the storefront to filter products on a page. Filters in query parameters are available for search and category pages.

Query parameters for filters

FieldTypeDescription
keywordstringSearch by a specific phrase
priceFromnumberMinimum product price
priceTonumberMaximum product price
categoriesstringSearch within these categories. Supports IDs separated by comma and value "home" that refers to the Store Home Page
includeProductsFromSubcategoriesbooleanDefines whether Ecwd should search in subcategories too. Only makes sense when categories parameter is set
createdFromstringProduct create date/time (lower bound). Supported formats:
  • UNIX timestamp
Example:
  • 1447804800
createdTostringProduct last create date/time (upper bound). Supported formats:
  • UNIX timestamp
updatedFromstringProduct last update date/time (lower bound). Supported formats:
  • UNIX timestamp
updatedTostringProduct last update date/time (upper bound). Supported formats:
  • UNIX timestamp
option_{optionName}stringFilter by product option values. Format: option_{optionName}=param[,param], where optionName is the attribute name and param is the attribute value. You can place several values separated by comma. In that case, values will be connected through logical “OR”, and if the product has at least one of them it will get to the search results. Example:
option_Size=S,M,L&option_Color=Red,Black
attribute_{attributeName}stringFilter by product attribute values. Format: attribute_{attributeName}=param[,param], where attributeName is the attribute name and param is the attribute value. You can place several values separated by comma. In that case, values will be connected through logical “OR”, and if the product has at least one of them it will get to the search results. Example:
attribute_Brand=Apple&attribute_Capacity=32GB,64GB
inventorystringSearch instock or out of stock products. Possible values: "instock","outofstock"
onsalestringSearch on sale products. Possible values: "onsale", "notonsale"

We use cookies and similar technologies to remember your preferences, measure effectiveness of our campaigns, and analyze depersonalized data to improve performance of our site. By choosing «Accept», you consent to the use of cookies.