---
title: search - Storefront API
description: >-
  Returns paginated search results for

  [`Product`](/docs/api/storefront/2025-07/objects/Product),

  [`Page`](/docs/api/storefront/2025-07/objects/Page), and

  [`Article`](/docs/api/storefront/2025-07/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/2025-07/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: 2025-07
source_url:
  html: 'https://shopify.dev/docs/api/storefront/2025-07/queries/search'
  md: 'https://shopify.dev/docs/api/storefront/2025-07/queries/search.md'
api_name: storefront
api_type: graphql
type: query
---

# search

query

Returns paginated search results for [`Product`](https://shopify.dev/docs/api/storefront/2025-07/objects/Product), [`Page`](https://shopify.dev/docs/api/storefront/2025-07/objects/Page), and [`Article`](https://shopify.dev/docs/api/storefront/2025-07/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/2025-07/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/2025-07/connections/SearchResultItemConnection)

* after

  [String](https://shopify.dev/docs/api/storefront/2025-07/scalars/String)

  Returns the elements that come after the specified cursor.

* before

  [String](https://shopify.dev/docs/api/storefront/2025-07/scalars/String)

  Returns the elements that come before the specified cursor.

* first

  [Int](https://shopify.dev/docs/api/storefront/2025-07/scalars/Int)

  Returns up to the first `n` elements from the list.

* last

  [Int](https://shopify.dev/docs/api/storefront/2025-07/scalars/Int)

  Returns up to the last `n` elements from the list.

* prefix

  [Search​Prefix​Query​Type](https://shopify.dev/docs/api/storefront/2025-07/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/2025-07/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/2025-07/scalars/String)

  required

  The search query.

* reverse

  [Boolean](https://shopify.dev/docs/api/storefront/2025-07/scalars/Boolean)

  Default:false

  Reverse the order of the underlying list.

* sort​Key

  [Search​Sort​Keys](https://shopify.dev/docs/api/storefront/2025-07/enums/SearchSortKeys)

  Default:RELEVANCE

  Sort the underlying list by the given key.

* types

  [\[Search​Type!\]](https://shopify.dev/docs/api/storefront/2025-07/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/2025-07/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/2025-07/objects/SearchResultItemEdge)

  non-null

  A list of edges.

* nodes

  [\[Search​Result​Item!\]!](https://shopify.dev/docs/api/storefront/2025-07/unions/SearchResultItem)

  non-null

  A list of the nodes contained in SearchResultItemEdge.

* page​Info

  [Page​Info!](https://shopify.dev/docs/api/storefront/2025-07/objects/PageInfo)

  non-null

  Information to aid in pagination.

* product​Filters

  [\[Filter!\]!](https://shopify.dev/docs/api/storefront/2025-07/objects/Filter)

  non-null

  A list of available filters.

* total​Count

  [Int!](https://shopify.dev/docs/api/storefront/2025-07/scalars/Int)

  non-null

  The total number of results.

***

## Examples

* ### search reference
