Skip to main content
GET
Spree SDK

Filters

Filter with q[<attribute>_<predicate>]=value, for example q[name_cont]=…. Send a list as q[<attribute>_in][]=a&q[<attribute>_in][]=b. How filters work.
Prefix an associated record’s attribute with the association, as in q[categories_id_eq]. The same predicates apply.
Also filters and sorts on the store’s searchable custom fields, as q[cf_<namespace>_<key>_<predicate>] and sort=cf_<namespace>_<key>. Sort by: available_on, best_selling, created_at, description, discontinue_on, id, manual, name, price, seller_id, slug, status, updated_at. Prefix a field with - to sort descending.

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Headers

x-spree-api-key
string
required

Publishable API key

Query Parameters

Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields.

q[ascend_by_price]
boolean

Set to true to apply ascend_by_price.

q[descend_by_price]
boolean

Set to true to apply descend_by_price.

q[in_categories][]
string[]

Category prefixed IDs; matches products in any of them, including descendants.

q[in_category]
string

A category's prefixed ID; includes products in its descendants.

q[in_collection]
string

A collection's prefixed ID.

q[in_stock]
boolean

Set to true for products available to buy.

q[in_taxon]
string

Applies in_taxon to the given value.

q[not_discontinued]
boolean

Set to true to apply not_discontinued.

q[out_of_stock]
boolean

Set to true for products that are sold out.

q[price_between][]
number[]

Lowest and highest price, in the current currency.

Required array length: 2 elements
q[price_gte]
number

Lowest price, in the current currency.

q[price_lte]
number

Highest price, in the current currency.

q[search_by_name]
string

Applies search_by_name to the given value.

q[with_option_value_ids][]
string[]

Option value IDs (optval_…); matches products with any of them.

page
integer

Page number (default: 1)

limit
integer

Number of items per page (default: 25, max: 100)

sort
string

Sort order. Prefix with - for descending. Values: price, -price, best_selling, name, -name, -available_on, available_on

q
object

Attribute filters, as q[<attribute>_<predicate>]=value. See Filters above for the list.

expand
string

Comma-separated associations to expand (variants, media, categories, option_types, seller, seller.policies)

fields
string

Comma-separated list of fields to include (e.g., name,slug,price). id is always included.

Response

products found

data
object[]
required
meta
object
required