# ProductCategory

> 商城或店鋪裡的一個商品類目。

網頁版：https://okdata.online/zh/docs/objects/product_category/

所有平台同一種結構。平台沒有的欄位為 null，meta.unavailable 會說明原因。用 fields= 只取需要的欄位。

| 欄位 | 型別 | 說明 |
|---|---|---|
| `id` | string | 類目 ID，按類目列商品的介面直接用它。 |
| `name` | string | 類目名稱。 |
| `name_en` | string \| null | 英文名（有的話）。 |
| `parent_id` | string \| null | 上級類目；頂級為 null。 |
| `level` | integer \| null | 層級，頂級為 1。 |
| `has_children` | boolean \| null | 是否還有子類目。 |
| `products` | integer \| null | 類目下的商品數（店鋪給出時）。 |
| `ext` | object | 平台特有欄位，只在 view=full 時返回。 |

## 返回 ProductCategory 的介面

- [1688 類目](https://okdata.online/zh/apis/alibaba_1688/categories/list/) (`alibaba_1688.categories.list`): $0.022/次 · 每頁約 52 條結果
- [1688 店鋪分類](https://okdata.online/zh/apis/alibaba_1688/shops/categories/list/) (`alibaba_1688.shops.categories.list`): $0.022/次 · 每頁約 10 條結果
- [TikTok Shop 類目](https://okdata.online/zh/apis/tiktok/shop/categories/list/) (`tiktok.shop.categories.list`): $0.002/次 · 每頁約 300 條結果

## 各 view 返回的欄位

每一級 view 都包含上一級的欄位。`view=compact` 最精簡；`full` 會在 `ext` 里加上平台特有欄位。

- compact：`id`, `name`, `name_en`, `parent_id`, `level`, `has_children`, `products`
- standard：—
- full：`ext`
