---
title: "Get hierarchical category tree structure"
method: GET
path: "/category-trees"
tags: ["CategoryTree"]
---

# Get hierarchical category tree structure

`GET /category-trees`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/category-trees`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/category-trees/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns categories as a nested tree. Pass parentId to scope results to children of that category. Public endpoint.

## Query parameters

- `parentId` integer
- `depth` integer

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Response `200`

Nested category tree.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
