GET /wp-json/content-api/v1/product-category/
Retrieves a specific product category by ID, slug, or name.
Content API Version: 1.0.3
Authentication
This endpoint requires a Bearer token in the Authorization
header. To authenticate:
- Go to Content API > Settings in your WordPress admin panel.
- Set a secure token in the “Token” field and save it.
- Include the token in your request header as follows:
Authorization: Bearer
Replace
with the token you configured.
Parameters
Name | Type | Description | Required |
---|---|---|---|
taxonomy | string | Taxonomy name (defaults to product_cat ) |
No |
id | integer | The ID of the product category to retrieve | Yes if no slug or name |
slug | string | The slug of the product category to retrieve | Yes if no id or name |
name | string | The name of the product category to retrieve | Yes if no id or slug |
Example Request
GET /wp-json/content-api/v1/product category/?id=1
Example Response
{
"success": true,
"data": {
"term_id": 1,
"name": "Sunglasses",
"slug": "sunglasses",
"taxonomy": "product_cat",
"description": "",
"parent": 0,
"count": 10,
"thumbnail": "https://example.com/wp-content/uploads/sunglasses.jpg",
"yoast": {
"title": "Sunglasses",
"description": "Sunglasses Description",
"premium": {
"social_appearance": {
"title": "Sunglasses Social Title",
"description": "Sunglasses Social Description",
"image": "https://example.com/wp-content/uploads/sunglasses.jpg"
},
"x": {
"title": "Sunglasses X Title",
"description": "Sunglasses X Description",
"image": "https://example.com/wp-content/uploads/sunglasses.jpg"
}
}
}
}
}
Possible Errors
Code | Message | Description | HTTP Status |
---|---|---|---|
no_product_category_found | No product category found under the product_cat taxonomy. | No product category was found matching the provided ID, slug, or name. | 400 |
not_authorized | Not Authorized | The provided Bearer token is invalid or does not match the configured token. | 401 |