getCategoryBySlug( )


Gets a category by the specified slug.

The getCategoryBySlug() function returns a Promise that resolves to a category whose slug matches the specified slug.

The slug is the end of a category's URL that refers to a specific category. For example, if a category's URL is https://example.com/blog/category/{my-category-slug}, the slug is my-post-slug. The slug is case-sensitive string that is generally derived from the category's label, unless specified otherwise.

Permissions
Read Blog
Manage Blog
Read Draft Blog Posts
Learn more about app permissions.
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>
Was this helpful?
Yes
No