# Community

> 平台上的社群或群組，如 Reddit 版塊、X 社群。

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

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

| 欄位 | 型別 | 說明 |
|---|---|---|
| `id` | string | ID，可原樣傳給需要它的介面。 |
| `name` | string | 社群名稱。 |
| `url` | string \| null | 社群連結。 |
| `description` | string \| null | 社群簡介。 |
| `avatar_url` | string \| null | 社群圖示。 |
| `nsfw` | boolean \| null | 是否標為成人內容。 |
| `created_at` | string \| null | 社群建立時間。 |
| `metrics` | CommunityMetrics | 抓取時的資料。 |
| `ext` | object | 平台特有欄位，只在 view=full 時返回。 |

### CommunityMetrics

| 欄位 | 型別 | 說明 |
|---|---|---|
| `members` | integer \| null | 成員數。 |

## 返回 Community 的介面

- [X 社群資料](https://okdata.online/zh/apis/x/communities/get/) (`x.communities.get`): $0.0004/次

## 各 view 返回的欄位

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

- compact：`id`, `name`, `url`, `description`, `metrics`
- standard：`avatar_url`, `nsfw`, `created_at`
- full：`ext`
