> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapebadger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopping Category Tree

> One level of the Naver Shopping ranking category tree — DIV1 roots, or the DIV2 children of a parent id.

Walk the **Naver Shopping ranking category tree** one level at a time. With no `parent_id` it returns the DIV1 root categories; pass a `parent_id` to return that node's DIV2 children. Each node carries its full ancestor id/name chain.

**Credits:** 5

## Authorization

**X-API-Key** `string` *required*

Your ScrapeBadger API key.

## Query Parameters

**parent\_id** `string`

A DIV1 category id to list its DIV2 children. Omit for the roots.

## Response

**parent\_id** `string`

Echo of the requested parent, or `null` for roots.

**level** `string`

The depth returned, e.g. `DIV1` or `DIV2`.

**result\_count** `integer`

**categories** `Category[]`

Categories at this level.

**Category**

**type** `string`

**category\_id** `string`

**category\_name** `string`

**cat\_id\_1..N** `string`

Ancestor category ids, root to leaf.

**cat\_nm\_1..N** `string`

Ancestor category names, root to leaf.

**image\_url** `string`

## Example

```bash cURL theme={null}
curl "https://scrapebadger.com/v1/naver/shopping/category-tree?parent_id=50000000" \
  -H "X-API-Key: YOUR_API_KEY"
```

```javascript Node.js theme={null}
const res = await fetch(
  "https://scrapebadger.com/v1/naver/shopping/category-tree?" +
    new URLSearchParams({"parent_id": "50000000"}),
  { headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const data = await res.json();
```

```python Python theme={null}
import requests

res = requests.get(
    "https://scrapebadger.com/v1/naver/shopping/category-tree",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"parent_id": "50000000"},
)
data = res.json()
```

```json Response theme={null}
{
  "parent_id": "50000000",
  "level": "DIV2",
  "result_count": 12,
  "categories": [
    {
      "type": "DIV2",
      "category_id": "50000167",
      "category_name": "원피스",
      "cat_id_1": "50000000",
      "cat_nm_1": "패션의류",
      "image_url": "https://shopping-phinf.example.net/cat/50000167.jpg"
    }
  ]
}
```

## Errors

| Status | Meaning |
| - | - |
| `422` | Naver served a challenge instead of content — **not billed**. Retry; it succeeds. |
| `502` | Unexpected upstream failure — **not billed**. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.