DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsProductsSearch & Filters
Introduction
Getting Started
Authentication
Products
List ProductsGet Product by SlugProduct Variations & SizesSearch & FiltersCore & Options (Split Endpoints)Variation-as-Product PagesFreestyle BundlesProduct FilesProducts in Multiple Categories
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Search & Filters

Search products by keyword, category, brand, and price range.

Updated March 29, 2026

On this page
  • Text Search
  • Category Filter
  • Brand Filter
  • Custom Field Filters
  • Combining Filters
  • Building a Search Page
  • Sorting
  • Next Steps

Text Search

Search products by name using the search parameter:

typescript
import dash from "@/lib/dash"

const { products } = await dash.products.list({
  search: "blue dream",
})

Category Filter

Filter products by category slug:

typescript
const { products } = await dash.products.list({
  category: "edibles",
})

Brand Filter

typescript
const { products } = await dash.products.list({
  brand: "premium-farms",
})

Custom Field Filters

Filter by any custom field defined on your products:

typescript
const { products } = await dash.products.list({
  customFields: {
    featured: "true",
    potency: "high",
  },
})

On the REST API, custom fields are passed as query parameters prefixed with cf_:

shell
GET /storefront/products?cf_featured=true&cf_potency=high
X-API-Key: pk_live_your_key

Combining Filters

All filters can be combined:

typescript
const { products, pagination } = await dash.products.list({
  category: "flower",
  search: "dream",
  customFields: { featured: "true" },
  limit: 12,
  offset: 0,
})

Building a Search Page

typescript
"use client"
import { useState } from "react"
import dash from "@/lib/dash"

export function ProductSearch() {
  const [query, setQuery] = useState("")
  const [results, setResults] = useState([])

  async function handleSearch(e) {
    e.preventDefault()
    const { products } = await dash.products.list({ search: query })
    setResults(products)
  }

  return (
    <form onSubmit={handleSearch}>
      <input value={query} onChange={e => setQuery(e.target.value)}
             placeholder="Search products..." />
      <button type="submit">Search</button>
      {results.map(p => <ProductCard key={p.id} product={p} />)}
    </form>
  )
}

For a complete search implementation, see the Add Search recipe.

Sorting

Sort results using the sort query parameter on the REST API:

shell
GET /storefront/products?sort=price_asc    # Cheapest first
GET /storefront/products?sort=price_desc   # Most expensive first
GET /storefront/products?sort=rating       # Highest rated first
GET /storefront/products?sort=newest       # Most recently added

Next Steps

  • List Products — Full parameter reference
  • List Categories — Get categories for filter UI
  • Recipe: Add Search — Full search implementation
PreviousProduct Variations & SizesNextCore & Options (Split Endpoints)

On this page

  • Text Search
  • Category Filter
  • Brand Filter
  • Custom Field Filters
  • Combining Filters
  • Building a Search Page
  • Sorting
  • Next Steps