Product category for organizing and classifying items in an e-commerce store. Supports hierarchical categories with parent-child relationships, visual styling, and item counts.
https://api.mockly.codes/categories?page=1&limit=10&count=10Configure your request and click Send Request to see the response here.
/categoriesGet a collection of categories
/commerce/categories/categories/:idGet a single category by ID
/commerce/categories/:id/categories/metaGet resource metadata and schema
/commerce/categories/metaThe search feature allows you to filter results by searching for text across all or specific fields. Choose between ?q= or ?search= parameter names.
Search across all text fields:
GET https://api.mockly.codes/categories?q=laptopGET https://api.mockly.codes/categories?q=laptop&search_fields=name,descriptionsearch_fields, all text fields are searched// Get 10 categories
fetch('https://api.mockly.codes/categories?count=10')
.then(res => res.json())
.then(data => console.log(data));import requests
response = requests.get(
'https://api.mockly.codes/categories?count=10'
)
data = response.json()curl "https://api.mockly.codes/categories?count=10"fetch('https://api.mockly.codes/categories?nocache=true')idintegerUnique identifier for the category
random_intnamestringDisplay name of the category (e.g., Electronics, Clothing, Books)
categoryslugstringURL-friendly identifier for the category used in web addresses
slugdescriptionstringBrief description of what products belong to this category
sentenceparent_idintegerID of the parent category if this is a subcategory, null for top-level categories
random_intorderintegerDisplay order or sort position for the category in listings
random_inticonstringIcon identifier or name for visual representation of the category
wordcolorstringHex color code or color name for category branding and visual distinction
coloritems_countintegerTotal number of products currently assigned to this category
random_intcreated_atstringTimestamp when the category was created
past_datedate-timecountintegerNumber of items to return (default: 10, max: 100)
seedintegerSeed for reproducible data generation
nocachebooleanBypass cache and generate fresh data on every request