# search - storefront - QUERY
Version: 2025-01

## Description
List of the search results.

### Access Scopes



## Arguments
* [after](/docs/api/storefront/2025-01/scalars/String): String - Returns the elements that come after the specified cursor.
* [before](/docs/api/storefront/2025-01/scalars/String): String - Returns the elements that come before the specified cursor.
* [first](/docs/api/storefront/2025-01/scalars/Int): Int - Returns up to the first `n` elements from the list.
* [last](/docs/api/storefront/2025-01/scalars/Int): Int - Returns up to the last `n` elements from the list.
* [prefix](/docs/api/storefront/2025-01/enums/SearchPrefixQueryType): SearchPrefixQueryType - Specifies whether to perform a partial word match on the last search term.
* [productFilters](/docs/api/storefront/2025-01/input-objects/ProductFilter): ProductFilter - Returns a subset of products matching all product filters.

The input must not contain more than `250` values.
* [query](/docs/api/storefront/2025-01/scalars/String): String! - The search query.
* [reverse](/docs/api/storefront/2025-01/scalars/Boolean): Boolean - Reverse the order of the underlying list.
* [sortKey](/docs/api/storefront/2025-01/enums/SearchSortKeys): SearchSortKeys - Sort the underlying list by the given key.
* [types](/docs/api/storefront/2025-01/enums/SearchType): SearchType - The types of resources to search for.

The input must not contain more than `250` values.
* [unavailableProducts](/docs/api/storefront/2025-01/enums/SearchUnavailableProductsType): SearchUnavailableProductsType - Specifies how unavailable products or variants are displayed in the search results.


## Returns
* [edges](/docs/api/storefront/2025-01/objects/SearchResultItemEdge): SearchResultItemEdge! A list of edges.
* [nodes](/docs/api/storefront/2025-01/unions/SearchResultItem): SearchResultItem! A list of the nodes contained in SearchResultItemEdge.
* [pageInfo](/docs/api/storefront/2025-01/objects/PageInfo): PageInfo! Information to aid in pagination.
* [productFilters](/docs/api/storefront/2025-01/objects/Filter): Filter! A list of available filters.
* [totalCount](/docs/api/storefront/2025-01/scalars/Int): Int! The total number of results.


## Examples
### Search products
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"query searchProducts($query: String!, $first: Int) { search(query: $query, first: $first, types: PRODUCT) { edges { node { ... on Product { id title } } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Storefront({\n  domain: 'your-development-store.myshopify.com',\n  storefrontAccessToken,\n});\nconst data = await client.query({\n  data: `query searchProducts($query: String!, $first: Int) {\n    search(query: $query, first: $first, types: PRODUCT) {\n      edges {\n        node {\n          ... on Product {\n            id\n            title\n          }\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: null 
Remix example: "const { storefront } = await unauthenticated.storefront(\n  'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n  `#graphql\n  query searchProducts($query: String!, $first: Int) {\n    search(query: $query, first: $first, types: PRODUCT) {\n      edges {\n        node {\n          ... on Product {\n            id\n            title\n          }\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query searchProducts($query: String!, $first: Int) {\n  search(query: $query, first: $first, types: PRODUCT) {\n    edges {\n      node {\n        ... on Product {\n          id\n          title\n        }\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "search": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Product/1",
            "title": "The Toggle Snowboard"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Product/2",
            "title": "The .dev Snowboard"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Product/3",
            "title": "The Hydrogen Snowboard"
          }
        }
      ]
    }
  }
}

### Search products, pages, and articles
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"query searchAll($query: String!, $first: Int) { search(query: $query, first: $first, types: [PRODUCT, PAGE, ARTICLE]) { edges { node { ... on Product { id title } ... on Page { id title } ... on Article { id title } } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Storefront({\n  domain: 'your-development-store.myshopify.com',\n  storefrontAccessToken,\n});\nconst data = await client.query({\n  data: `query searchAll($query: String!, $first: Int) {\n    search(query: $query, first: $first, types: [PRODUCT, PAGE, ARTICLE]) {\n      edges {\n        node {\n          ... on Product {\n            id\n            title\n          }\n          ... on Page {\n            id\n            title\n          }\n          ... on Article {\n            id\n            title\n          }\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: null 
Remix example: "const { storefront } = await unauthenticated.storefront(\n  'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n  `#graphql\n  query searchAll($query: String!, $first: Int) {\n    search(query: $query, first: $first, types: [PRODUCT, PAGE, ARTICLE]) {\n      edges {\n        node {\n          ... on Product {\n            id\n            title\n          }\n          ... on Page {\n            id\n            title\n          }\n          ... on Article {\n            id\n            title\n          }\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query searchAll($query: String!, $first: Int) {\n  search(query: $query, first: $first, types: [PRODUCT, PAGE, ARTICLE]) {\n    edges {\n      node {\n        ... on Product {\n          id\n          title\n        }\n        ... on Page {\n          id\n          title\n        }\n        ... on Article {\n          id\n          title\n        }\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "search": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Product/1",
            "title": "The Toggle Snowboard"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Page/1",
            "title": "Snowdevil is not your typical snowboard store"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Article/1",
            "title": "10 Tips for Better Snowboarding"
          }
        }
      ]
    }
  }
}

### Filter search results
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"query searchWithFilters($query: String!, $first: Int, $productFilters: [ProductFilter!]) { search(query: $query, first: $first, productFilters: $productFilters) { edges { node { ... on Product { id title vendor } } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Storefront({\n  domain: 'your-development-store.myshopify.com',\n  storefrontAccessToken,\n});\nconst data = await client.query({\n  data: `query searchWithFilters($query: String!, $first: Int, $productFilters: [ProductFilter!]) {\n    search(query: $query, first: $first, productFilters: $productFilters) {\n      edges {\n        node {\n          ... on Product {\n            id\n            title\n            vendor\n          }\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: null 
Remix example: "const { storefront } = await unauthenticated.storefront(\n  'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n  `#graphql\n  query searchWithFilters($query: String!, $first: Int, $productFilters: [ProductFilter!]) {\n    search(query: $query, first: $first, productFilters: $productFilters) {\n      edges {\n        node {\n          ... on Product {\n            id\n            title\n            vendor\n          }\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query searchWithFilters($query: String!, $first: Int, $productFilters: [ProductFilter!]) {\n  search(query: $query, first: $first, productFilters: $productFilters) {\n    edges {\n      node {\n        ... on Product {\n          id\n          title\n          vendor\n        }\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "search": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Product/1",
            "title": "The Toggle Snowboard",
            "vendor": "Snowdevil"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Product/2",
            "title": "The .dev Snowboard",
            "vendor": "Snowdevil"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Product/3",
            "title": "The Hydrogen Snowboard",
            "vendor": "Snowdevil"
          }
        }
      ]
    }
  }
}

### Retrieve facet filters
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"query facets($query: String!, $first: Int) { search(query: $query, first: $first) { productFilters { id label type values { id label count input } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Storefront({\n  domain: 'your-development-store.myshopify.com',\n  storefrontAccessToken,\n});\nconst data = await client.query({\n  data: `query facets($query: String!, $first: Int) {\n    search(query: $query, first: $first) {\n      productFilters {\n        id\n        label\n        type\n        values {\n          id\n          label\n          count\n          input\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: null 
Remix example: "const { storefront } = await unauthenticated.storefront(\n  'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n  `#graphql\n  query facets($query: String!, $first: Int) {\n    search(query: $query, first: $first) {\n      productFilters {\n        id\n        label\n        type\n        values {\n          id\n          label\n          count\n          input\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query facets($query: String!, $first: Int) {\n  search(query: $query, first: $first) {\n    productFilters {\n      id\n      label\n      type\n      values {\n        id\n        label\n        count\n        input\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "search": {
      "productFilters": [
        {
          "id": "filter.v.availability",
          "label": "Availability",
          "type": "LIST",
          "values": [
            {
              "id": "filter.v.availability.1",
              "label": "In stock",
              "count": 56,
              "input": "{\"available\":true}"
            },
            {
              "id": "filter.v.availability.0",
              "label": "Out of stock",
              "count": 6,
              "input": "{\"available\":false}"
            }
          ]
        },
        {
          "id": "filter.v.price",
          "label": "Price",
          "type": "PRICE_RANGE",
          "values": [
            {
              "id": "filter.v.price",
              "label": "Price",
              "count": 0,
              "input": "{\"price\":{\"min\":0,\"max\":2629.95}}"
            }
          ]
        },
        {
          "id": "filter.p.product_type",
          "label": "Product type",
          "type": "LIST",
          "values": [
            {
              "id": "filter.p.product_type.snowboards",
              "label": "Snowboards",
              "count": 56,
              "input": "{\"productType\":\"Snowboards\"}"
            }
          ]
        },
        {
          "id": "filter.p.vendor",
          "label": "Brand",
          "type": "LIST",
          "values": [
            {
              "id": "filter.p.vendor.snowdevil",
              "label": "Snowdevil",
              "count": 56,
              "input": "{\"productVendor\":\"Snowdevil\"}"
            }
          ]
        },
        {
          "id": "filter.v.option.binding mount",
          "label": "Binding mount",
          "type": "LIST",
          "values": [
            {
              "id": "filter.v.option.binding mount.nested",
              "label": "Nested",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"binding mount\",\"value\":\"Nested\"}}"
            },
            {
              "id": "filter.v.option.binding mount.optimistic",
              "label": "Optimistic",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"binding mount\",\"value\":\"Optimistic\"}}"
            }
          ]
        },
        {
          "id": "filter.v.option.color",
          "label": "Color",
          "type": "LIST",
          "values": [
            {
              "id": "filter.v.option.color.fed-green",
              "label": "FED Green",
              "count": 45,
              "input": "{\"variantOption\":{\"name\":\"color\",\"value\":\"FED Green\"}}"
            },
            {
              "id": "filter.v.option.color.reactive-blue",
              "label": "Reactive Blue",
              "count": 5,
              "input": "{\"variantOption\":{\"name\":\"color\",\"value\":\"Reactive Blue\"}}"
            },
            {
              "id": "filter.v.option.color.sea-green-desert",
              "label": "Sea Green / Desert",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"color\",\"value\":\"Sea Green \\/ Desert\"}}"
            },
            {
              "id": "filter.v.option.color.syntax",
              "label": "Syntax",
              "count": 2,
              "input": "{\"variantOption\":{\"name\":\"color\",\"value\":\"Syntax\"}}"
            }
          ]
        },
        {
          "id": "filter.v.option.material",
          "label": "Material",
          "type": "LIST",
          "values": [
            {
              "id": "filter.v.option.material.carbon-fiber",
              "label": "Carbon-fiber",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Carbon-fiber\"}}"
            },
            {
              "id": "filter.v.option.material.fiberglass",
              "label": "Fiberglass",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Fiberglass\"}}"
            },
            {
              "id": "filter.v.option.material.kevlar",
              "label": "Kevlar®",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Kevlar®\"}}"
            },
            {
              "id": "filter.v.option.material.polycarbonate",
              "label": "Polycarbonate",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Polycarbonate\"}}"
            },
            {
              "id": "filter.v.option.material.polyethylene",
              "label": "Polyethylene",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Polyethylene\"}}"
            },
            {
              "id": "filter.v.option.material.ultra-high-molecular-weight-polyethylene",
              "label": "Ultra-high-molecular-weight polyethylene",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Ultra-high-molecular-weight polyethylene\"}}"
            },
            {
              "id": "filter.v.option.material.vectran",
              "label": "Vectran®",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Vectran®\"}}"
            },
            {
              "id": "filter.v.option.material.wood-composite",
              "label": "Wood-composite",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"material\",\"value\":\"Wood-composite\"}}"
            }
          ]
        },
        {
          "id": "filter.v.option.size",
          "label": "Size",
          "type": "LIST",
          "values": [
            {
              "id": "filter.v.option.size.154cm",
              "label": "154cm",
              "count": 56,
              "input": "{\"variantOption\":{\"name\":\"size\",\"value\":\"154cm\"}}"
            },
            {
              "id": "filter.v.option.size.158cm",
              "label": "158cm",
              "count": 55,
              "input": "{\"variantOption\":{\"name\":\"size\",\"value\":\"158cm\"}}"
            },
            {
              "id": "filter.v.option.size.160cm",
              "label": "160cm",
              "count": 56,
              "input": "{\"variantOption\":{\"name\":\"size\",\"value\":\"160cm\"}}"
            },
            {
              "id": "filter.v.option.size.170cm",
              "label": "170cm",
              "count": 1,
              "input": "{\"variantOption\":{\"name\":\"size\",\"value\":\"170cm\"}}"
            }
          ]
        },
        {
          "id": "filter.p.m.metafields-tests.boolean",
          "label": "boolean",
          "type": "BOOLEAN",
          "values": [
            {
              "id": "filter.p.m.metafields-tests.boolean.0",
              "label": "No",
              "count": 1,
              "input": "{\"productMetafield\":{\"namespace\":\"metafields-tests\",\"key\":\"boolean\",\"value\":\"false\"}}"
            }
          ]
        }
      ]
    }
  }
}