Home
GET/category_tree/{category_tree_id}/get_category_subtree
This call retrieves the details of all nodes of the category tree hierarchy (the subtree) below a specified category of a category tree. You identify the tree using the category_tree_id parameter, which was returned by the getDefaultCategoryTreeId call in the categoryTreeId field.
Note: This call can return a very large payload, so you are strongly advised to submit the request with the following HTTP header: Accept-Encoding: application/gzip
With this header (in addition to the required headers described under HTTP Request Headers), the call returns the response with gzip compression.
This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com
root URI with api.sandbox.ebay.com
Parameter | Type | Description |
---|---|---|
category_tree_id | string | The unique identifier of the eBay category tree from which a category subtree is being requested. Occurrence: Required |
category_id | string | The unique identifier of the category at the top of the subtree being requested. Note: If the category_id submitted identifies the root node of the tree, this call returns an error. To retrieve the complete tree, use this value with the getCategoryTree call. If the category_id submitted identifies a leaf node of the tree, the call response will contain information about only that leaf node, which is a valid subtree. Occurrence: Required |
All requests made to eBay REST operations require you to provide the Authorization
HTTP header for authentication authorization.
All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.
This request requires an access token created with the client credentials grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):
https://api.ebay.com/oauth/api_scope
See OAuth access tokens for more information.
This call has no payload.
This call has no field definitions.
This call has no response headers.
Output container/field | Type | Description |
---|---|---|
categorySubtreeNode | CategoryTreeNode | Contains details of all nodes of the category subtree hierarchy below a specified node. This is a recursive structure. Occurrence: Always |
categorySubtreeNode.category | Category | Contains details about the current category tree node. Occurrence: Always |
categorySubtreeNode.category.categoryId | string | The unique identifier of the eBay category within its category tree. Occurrence: Always |
categorySubtreeNode.category.categoryName | string | The name of the category identified by categoryId. Occurrence: Always |
categorySubtreeNode.categoryTreeNodeLevel | integer | The absolute level of the current category tree node in the hierarchy of its category tree. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes | array of CategoryTreeNode | An array of one or more category tree nodes that are the immediate children of the current category tree node, as well as their children, recursively down to the leaf nodes. Occurrence: Conditional |
categorySubtreeNode.childCategoryTreeNodes.category | Category | Contains details about the current category tree node. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.category.categoryId | string | The unique identifier of the eBay category within its category tree. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.category.categoryName | string | The name of the category identified by categoryId. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.categoryTreeNodeLevel | integer | The absolute level of the current category tree node in the hierarchy of its category tree. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes | array of CategoryTreeNode | An array of one or more category tree nodes that are the immediate children of the current category tree node, as well as their children, recursively down to the leaf nodes. Occurrence: Conditional |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.category | Category | Contains details about the current category tree node. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.category.categoryId | string | The unique identifier of the eBay category within its category tree. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.category.categoryName | string | The name of the category identified by categoryId. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.categoryTreeNodeLevel | integer | The absolute level of the current category tree node in the hierarchy of its category tree. Occurrence: Always |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.childCategoryTreeNodes | array of CategoryTreeNode | An array of one or more category tree nodes that are the immediate children of the current category tree node, as well as their children, recursively down to the leaf nodes. Occurrence: Conditional |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.leafCategoryTreeNode | boolean | A value of Occurrence: Conditional |
categorySubtreeNode.childCategoryTreeNodes.childCategoryTreeNodes.parentCategoryTreeNodeHref | string | The href portion of the getCategorySubtree call that retrieves the subtree below the parent of this category tree node. Occurrence: Conditional |
categorySubtreeNode.childCategoryTreeNodes.leafCategoryTreeNode | boolean | A value of Occurrence: Conditional |
categorySubtreeNode.childCategoryTreeNodes.parentCategoryTreeNodeHref | string | The href portion of the getCategorySubtree call that retrieves the subtree below the parent of this category tree node. Occurrence: Conditional |
categorySubtreeNode.leafCategoryTreeNode | boolean | A value of Occurrence: Conditional |
categorySubtreeNode.parentCategoryTreeNodeHref | string | The href portion of the getCategorySubtree call that retrieves the subtree below the parent of this category tree node. Occurrence: Conditional |
categoryTreeId | string | The unique identifier of the eBay category tree to which this subtree belongs. Occurrence: Always |
categoryTreeVersion | string | The version of the category tree identified by categoryTreeId. It's a good idea to cache this value for comparison so you can determine if this category tree has been modified in subsequent calls. Occurrence: Always |
This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.
Status | Meaning |
---|---|
200 | Success |
400 | Bad Request |
404 | Not Found |
500 | Internal Server Error |
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
62000 | API_TAXONOMY | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay developer support for assistance. |
62004 | API_TAXONOMY | REQUEST | The specified category tree ID was not found. |
62005 | API_TAXONOMY | REQUEST | The specified category ID does not belong to the specified category tree. |
62006 | API_TAXONOMY | REQUEST | Missing category ID. |
62008 | API_TAXONOMY | REQUEST | The specified category ID is the root for the category tree. Please use <code>{categoryTreeHref}</code> to retrieve the entire tree. |
This call has no warnings.
New to making API calls? Please see Making a Call.
Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.
This sample retrieves the complete content of a subtree of an eBay category tree, using the category tree node that contains the specified category as the root of the desired subtree.
Use the category_tree_id path parameter to specify the category tree, and use the category_id query parameter to specify the category in the category node at the top of the subtree being requested.
GEThttps://api.ebay.com/commerce/taxonomy/v1/category_tree/0/get_category_subtree?category_id=11450
A successful call returns the complete category subtree specified, from the specified category node to all leaf nodes of the subtree. In this sample, the returned category subtree contains almost 600 categories, so the response shown here has most of the nodes removed for easier viewing.