--- title: search - Storefront API description: > Returns paginated search results for [`Product`](/docs/api/storefront/unstable/objects/Product), [`Page`](/docs/api/storefront/unstable/objects/Page), and [`Article`](/docs/api/storefront/unstable/objects/Article) resources based on a query string. Results are sorted by relevance by default. The response includes the total result count and available product filters for building [faceted search interfaces](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/products-collections/filter-products). Use the [`prefix`](/docs/api/storefront/unstable/enums/SearchPrefixQueryType) argument to enable partial word matching on the last search term, allowing queries like "winter snow" to match "snowboard" or "snowshoe". api_version: unstable api_name: storefront source_url: html: 'https://shopify.dev/docs/api/storefront/unstable/queries/search' md: 'https://shopify.dev/docs/api/storefront/unstable/queries/search.md' --- # search query Returns paginated search results for [`Product`](https://shopify.dev/docs/api/storefront/unstable/objects/Product), [`Page`](https://shopify.dev/docs/api/storefront/unstable/objects/Page), and [`Article`](https://shopify.dev/docs/api/storefront/unstable/objects/Article) resources based on a query string. Results are sorted by relevance by default. The response includes the total result count and available product filters for building [faceted search interfaces](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/products-collections/filter-products). Use the [`prefix`](https://shopify.dev/docs/api/storefront/unstable/enums/SearchPrefixQueryType) argument to enable partial word matching on the last search term, allowing queries like "winter snow" to match "snowboard" or "snowshoe". ## SearchResultItemConnection arguments [SearchResultItemConnection!](https://shopify.dev/docs/api/storefront/unstable/connections/SearchResultItemConnection) * after [String](https://shopify.dev/docs/api/storefront/unstable/scalars/String) Returns the elements that come after the specified cursor. * before [String](https://shopify.dev/docs/api/storefront/unstable/scalars/String) Returns the elements that come before the specified cursor. * first [Int](https://shopify.dev/docs/api/storefront/unstable/scalars/Int) Returns up to the first `n` elements from the list. * last [Int](https://shopify.dev/docs/api/storefront/unstable/scalars/Int) Returns up to the last `n` elements from the list. * prefix [Search​Prefix​Query​Type](https://shopify.dev/docs/api/storefront/unstable/enums/SearchPrefixQueryType) Specifies whether to perform a partial word match on the last search term. * product​Filters [\[Product​Filter!\]](https://shopify.dev/docs/api/storefront/unstable/input-objects/ProductFilter) Returns a subset of products matching all product filters. The input must not contain more than `250` values. * query [String!](https://shopify.dev/docs/api/storefront/unstable/scalars/String) required The search query. * reverse [Boolean](https://shopify.dev/docs/api/storefront/unstable/scalars/Boolean) Default:false Reverse the order of the underlying list. * sort​Key [Search​Sort​Keys](https://shopify.dev/docs/api/storefront/unstable/enums/SearchSortKeys) Default:RELEVANCE Sort the underlying list by the given key. * types [\[Search​Type!\]](https://shopify.dev/docs/api/storefront/unstable/enums/SearchType) The types of resources to search for. The input must not contain more than `250` values. * unavailable​Products [Search​Unavailable​Products​Type](https://shopify.dev/docs/api/storefront/unstable/enums/SearchUnavailableProductsType) Specifies how unavailable products or variants are displayed in the search results. *** ## Possible returns * edges [\[Search​Result​Item​Edge!\]!](https://shopify.dev/docs/api/storefront/unstable/objects/SearchResultItemEdge) non-null A list of edges. * nodes [\[Search​Result​Item!\]!](https://shopify.dev/docs/api/storefront/unstable/unions/SearchResultItem) non-null A list of the nodes contained in SearchResultItemEdge. * page​Info [Page​Info!](https://shopify.dev/docs/api/storefront/unstable/objects/PageInfo) non-null Information to aid in pagination. * product​Filters [\[Filter!\]!](https://shopify.dev/docs/api/storefront/unstable/objects/Filter) non-null A list of available filters. * total​Count [Int!](https://shopify.dev/docs/api/storefront/unstable/scalars/Int) non-null The total number of results. *** ## Examples * ### search reference