Taxonomy API
Learn how the Taxonomy API powers site navigation with full tree retrieval, node-level queries, and bulk ingestion. Optimize category management and SEO routing.
Overview
The Taxonomy API enables clients to create, manage, and retrieve a hierarchical category structure (taxonomy) for a given site. Each site maintains a single taxonomy hierarchy used across the website for navigation, category pages, and SEO routing. The API supports:
- Fetching the entire taxonomy tree.
- Fetching specific nodes, including their children, siblings, or neighbours.
- Uploading the complete taxonomy feed via a bulk ingestion API.
Assumptions & Constraints
Each
<sitekey>has exactly one taxonomy hierarchy.The taxonomy graph is acyclic (no circular parent-child relationships).
Phantom nodes:
Will not have phantom nodes as parents or children
Are treated like normal nodes (no semantic distinction at API level)
- Taxonomy APIs are read-heavy and expected to be cached on the client side
Prerequisites
- Ensure you have a valid sitekey.
- Taxonomy data must be ingested successfully using the Taxonomy Feed API.
Headers
| Header Name | Description | Mandatory |
|---|---|---|
Content-Type | Request payload format (application/json) | Yes |
Accept | Expected response format | No |
Authorization | API authentication token (if applicable) | Depends on setup |
Get Full Taxonomy
- Endpoint:
GET /sites/{sitekey}/taxonomy
Description: Returns the complete taxonomy tree up to the specified depth. This API is typically used to power global navigation menus.
- Query Parameters
| Parameter | Type | Description | Mandatory | Default |
|---|---|---|---|---|
| depth | Integer | Maximum depth of the taxonomy tree to return | No | 2 |
- depth = 0 (Only root node)
- depth = 1 (Root + immediate children)
- Sample Request/ Response
GET /sites/demoSite/taxonomy?depth=3{
"taxonomy": [
{
"name": "categoryroot",
"links": [
{
"rel": "self",
"href": "/taxonomy"
}
],
"categories": [
{
"name": "girl",
"identifier": "Girl:US",
"parentId": "00000",
"catgroup_id": "47511",
"categories": [
{
"name": "tops",
"identifier": "Girl:Tops:US",
"parentId": "47511",
"catgroup_id": "49012",
"categories": [
{
"name": "graphic tees",
"identifier": "Girl:Tops:GraphicTees:US",
"parentId": "49012",
"catgroup_id": "54174"
}
]
}
]
}
]
}
]
}
Get Taxonomy Node Data
- Endpoint:
GET /sites/{sitekey}/taxonomy/{category_id}
Description: Returns taxonomy data for a specific node, based on the requested relationship (node only, children, siblings, or neighbours). This API is commonly used for left navigation menus.
- Supported Variants
- Get Node Info Only:
GET /sites/{sitekey}/taxonomy/{category_id}
Response: Array with a single object containing node information - Get Siblings :
GET /sites/{sitekey}/taxonomy/{category_id}/siblings GET /sites/{sitekey}/taxonomy/{category_id}/siblings/{parentId}
Response: Returns node info + all siblings under the specified parent. If parentId is omitted, siblings are derived from the first matching parent - Get Children:
GET /sites/{sitekey}/taxonomy/{category_id}/children
Response: Returns node info. Node object contains a categories array with all children. - Get Neighbours (Children + Siblings):
GET /sites/{sitekey}/taxonomy/{category_id}/neighbours GET /sites/{sitekey}/taxonomy/{category_id}/neighbours/{parentId}
Response: Current node info, Siblings of the node, Children of the node (embedded)
- Get Node Info Only:
- Sample Response
{
"taxonomy": [
{
"name": "girl",
"identifier": "Girl:US",
"uniqueID": "47511",
"categories": [
{
"name": "tops",
"uniqueID": "49012",
"seoURL": "/us/c/girls-tops-girls-shirts/"
}
]
},
{
"name": "boy",
"identifier": "Boy:US",
"uniqueID": "47512"
}
]
}
Taxonomy Feed API
The Taxonomy Feed API is used to upload the complete taxonomy dataset in bulk. The feed is processed asynchronously and indexed for search and navigation.
- Upload Taxonomy
PUT /{sitekey}/taxonomy
Description: Uploads taxonomy data as multiple JSON lines, where each line represents one taxonomy node.
- Required Field
| Field | Description | Optional(Y/N) |
|---|---|---|
| _id | Unique identifier for the taxonomy node | Required |
| parentId | Parent node identifier | Required |
| name | Category display name | Optional |
| shortDescription | Short category description | Optional |
| seoURL | SEO-friendly URL | Optional |
| seo_token_ntk | SEO token | Optional |
| x_sequence | Ordering sequence | Optional |
| identifier | External identifier | Optional |
| storeID | Store identifier | Optional |
- Sample Request/ Response Body
{
"_id": "54174",
"parentId": "49012",
"name": "graphic tees",
"identifier": "Girl:Tops:GraphicTees:US",
"seoURL": "/us/c/girls-tops-girls-shirts-graphic-tees/",
"storeID": "10051"
}
{
"nodeCount": "794",
"message": "Index creation successful",
"statusCode": "200"
}
- Alias Switch: After successful ingestion, switch the taxonomy alias:
POST /{sitekey}/taxonomy/admin{ "action": "aliasSwitch" }{ "message": "Rename successful", "statusCode": "200" }Error HandlingError Codes{ "error": { "code": 6001, "msg": "invalid category key" } }
| Error Code | Description |
|---|---|
| 6001 | Invalid category key |
| 400 | Bad request / malformed payload |
| 404 | Resource not found |
| 500 | Internal server error |
Updated about 8 hours ago
