> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# List categories as a tree

**Published**: 2026-11-30
**Category**: Content

## `GET /categories/tree`

**List categories as a tree**

Returns the site's categories as a tree under `tree`: each node
nests its sub-categories in `children`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") |
| `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `402` | The site subscription does not currently permit this operation |
| `422` | Validation error |


> **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit
> bucket: general.

### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! })

const { tree } = await lynkow.categories.tree()
// Iterate root categories and their children
tree.forEach(root => {
  console.log(root.name)
  root.children.forEach(child => {
    console.log(`  - ${child.name}`)
  })
})
```

### Examples

```curl
curl "https://api.lynkow.com/storefront/{siteId}/categories/tree?locale=en"
```

```javascript
const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/categories/tree?locale=en`)
const { data: { tree, blogUrlMode, locale } } = await res.json()
```

### Response Example

```json
{
  "data": {
    "tree": [
      {
        "id": "01J9PA0NZK7BX4HQ7M2DC9V5T8",
        "name": "Engineering",
        "slug": "engineering",
        "path": "/blog/engineering",
        "locale": "en",
        "contentCount": 12,
        "children": [
          {
            "id": "01J9PE2T4VHQR9K3M7B6X8N1FW",
            "name": "Performance",
            "slug": "performance",
            "path": "/blog/engineering/performance",
            "locale": "en",
            "contentCount": 4,
            "children": []
          }
        ]
      }
    ],
    "blogUrlMode": "with-categories",
    "locale": "en"
  }
}
```

---