getCategoryBySlug( )


Gets a category with the specified slug.

The slug is at the end of the URL of a specific category. For example, if a category's URL is https://example.com/blog/categories/famous-cats, the slug is famous-cats. The slug is a case-sensitive string that is derived from the category's label, unless specified otherwise.

Method Declaration
Copy
Method Parameters
slugstringRequired

Slug of the category to retrieve.

The end of a category's URL. For example, 'https:/example.com/blog/category/{my-category-slug}'. Case sensitive and generally based on the category label if not specified.


optionsGetCategoryBySlugOptions

Options specifying which fields to return.

Returns
Return Type:Promise<GetCategoryBySlugResponse>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?