Skip to content

Facet counts of a storefront product listing​

GET
/public/products/facets

The filter sidebar of a listing: accepts EXACTLY the filters of GET /products (category / categoryId / categorySlug — an unknown or conflicting category is the same 400, vendor_id, q, indexable, brandId, attr[...], attributeName/attributeValue, minPrice/maxPrice, onSale, stockStatus; page/limit/sort are accepted and ignored) and counts on exactly the set GET /products lists for them — same visibility rules (active listing, hidden group offers, hidden out-of-stock products, X-Channel display mode). total equals the /products total.

Standard facet semantics: a group's counts ignore that group's OWN selection and apply every other one — with brandId=nike the other brands keep their counts so a second brand can be added; with attr[color]=noir the other colours keep theirs. price ignores minPrice/maxPrice, stockStatus/inStock ignore stockStatus, onSale ignores onSale.

Attribute values are grouped by normalised slug (Noir / noir / NOIR = one value noir, labelled with its most frequent spelling); the brand axis, metadata axes and empty values are left out. At most 100 values per attribute (most frequent first, selected values always kept).

Cacheable: Cache-Control: public, max-age=300, Vary: X-Channel.

Auth: Public (no authentication).

Same route as GET /products/facets under the explicit /public namespace: same handler, parameters, cache headers and X-Channel handling. Prefer this path.

Parameters​

Header Parameters

X-Channel

Distribution channel (display config). Absent header defaults to web.

Type
string
Valid values
"web""mobile"
Default
"web"

Query Parameters

category

Category id or slug (its whole subtree). Same resolution and 400s as GET /products.

Type
string
categoryId

Alias of category taking an id only.

Type
string
categorySlug

Alias of category taking a slug only.

Type
string
vendor_id
Type
string
q

Free-text title match

Type
string
madeInTunisia

1 / true keeps only « made in Tunisia » products (product override ?? vendor default ?? false). 0 / false / absent = no filter (it never selects the non-Tunisian products).

Type
string
Valid values
"1""0""true""false"
indexable
Type
boolean
brandId

Brand id or comma-separated ids (OR). At most 20.

Type
string
attr

Attribute filters attr[color]=noir,blanc&attr[size]=M (OR inside, AND across; normalised values).

Type
object
attributeName
Type
string
attributeValue
Type
string
minPrice
Type
number
maxPrice
Type
number
onSale
Type
boolean
stockStatus
Type
string
Valid values
"instock""outofstock""onbackorder"

Responses​

Facet counts

application/json
JSON
{
  
"ok": true,
  
"data": {
  
  
"total": 0,
  
  
"brands": [
  
  
  
{
  
  
  
  
"id": "string",
  
  
  
  
"name": "string",
  
  
  
  
"slug": "string",
  
  
  
  
"count": 0,
  
  
  
  
"selected": true
  
  
  
}
  
  
],
  
  
"attributes": [
  
  
  
{
  
  
  
  
"code": "string",
  
  
  
  
"name": "string",
  
  
  
  
"values": [
  
  
  
  
  
{
  
  
  
  
  
  
"slug": "string",
  
  
  
  
  
  
"value": "string",
  
  
  
  
  
  
"count": 0,
  
  
  
  
  
  
"selected": true
  
  
  
  
  
}
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"price": {
  
  
  
"min": 0,
  
  
  
"max": 0
  
  
},
  
  
"inStock": 0,
  
  
"stockStatus": {
  
  
  
"instock": 0,
  
  
  
"outofstock": 0,
  
  
  
"onbackorder": 0
  
  
},
  
  
"onSale": 0,
  
  
"madeInTunisia": 0,
  
  
"vendors": [
  
  
  
{
  
  
  
  
"id": "string",
  
  
  
  
"name": "string",
  
  
  
  
"count": 0,
  
  
  
  
"inStock": 0
  
  
  
}
  
  
],
  
  
"inStockPrice": {
  
  
  
"min": 0,
  
  
  
"max": 0,
  
  
  
"median": 0
  
  
},
  
  
"inStockOnSale": 0
  
}
}

Playground​

Headers
Variables
Key
Value

Samples​

Powered by VitePress OpenAPI

Tarifs : contactez-nous — contact@marketkit.ai