Skip to content

List categories

GET
/categories
curl --request GET \
--url 'https://acme.mykreezalid.com/front_api/v1/categories?locale=fr&parent_id=0&product_count=1&fields=id%2Ctitle%2Cslug'

Returns the listing categories as a tree: top-level categories, each with its sub-categories nested in children. Filters apply to every category; a category whose parent is filtered out is returned at the top level. The list is not paginated. Works without an access token.

locale
string
default: fr

Example

en

Language of the texts. Categories without a translation in this language keep their original texts.

parent_id
integer

Example

0

Only categories with this parent. Top-level categories usually have 0 as parent.

is_featured
boolean

Only the categories the marketplace features (true), or only the others (false).

child_count
integer

Only categories with exactly this number of sub-categories (0 for the categories without any).

product_count
integer

Example

1

Only categories with at least this number of listings.

limit
integer

Maximum number of categories read, sub-categories included, in tree order.

fields
string

Example

id,title,slug

Comma-separated list of the fields to return for each top-level category, for instance id,title,children. Other fields are left out.

The category tree.

Media typeapplication/json
object
categories
Array<object>

A listing category, with its sub-categories nested in children. Texts are translated into the requested locale when the marketplace provides a translation.

object
object

A listing category, as the Front API returns it.

string
id

Unique identifier of the category.

integer
title
string
nullable
slug
string
nullable
url

Path of the category page on the marketplace, relative to its domain. null when the category has no slug.

string
nullable
parent_id

Identifier of the parent category; 0 or null for a top-level category. Not returned for the entries of children.

integer
nullable
product_count

Number of listings in the category.

integer
nullable
child_count

Number of sub-categories.

integer
nullable
image

Image of the category.

string
nullable
image_alt

Alternative text of the image.

string
nullable
description

Short description. Only returned by GET /categories/{id}, for the requested category.

string
nullable
description_long

Long description. Only returned by GET /categories/{id}, for the requested category.

string
nullable
meta

Search-engine title and description of the category page. Only returned by GET /categories/{id}, for the requested category, when one of them is set.

object
title
string
description
string
children
Array<object> recursive

Example

{
"categories": [
{
"object": "Category",
"id": 4242,
"title": "Bikes",
"slug": "bikes",
"url": "/c/bikes",
"parent_id": 0,
"product_count": 37,
"child_count": 3
}
]
}