# YouTube 频道帖子详情 API (youtube.community_post)

- Canonical page: [https://everyinfra.com/youtube-api/community_post](https://everyinfra.com/youtube-api/community_post?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "youtube", "action": "community_post", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=youtube&action=community_post

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 频道帖子的链接（youtube.com/post/Ugkx…），也可以只给 /post/ 后面那一段。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| published_text | YouTube 页面上写的发布时间，是相对说法（如 2 years ago），原样给；页面没写是 null。 |
| attachment_type | 帖子带了什么：image 一张图、multi_image 多张图、video 视频、poll 投票；只有文字是 null。 |
| image_urls | 图片链接数组，按平台展示顺序；没有图片时不出现这个字段。 |
| video_id | 所属视频的编号；帖子评论的回复里是 null。频道帖子里是帖子附带的那条视频的编号，没附视频是 null。 |
| video_title | 帖子附带的那条视频的标题，没附视频是 null。 |
| poll_options | 投票的选项，文字数组；不是投票帖是空数组。 |
| poll_total_votes | 投票的总票数，整数（YouTube 页面给的是约数，如 1.8M 记作 1800000）；不是投票帖是 null。 |
| links | 帖子正文里的链接，数组。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "youtube",
  "action": "community_post",
  "params": {
    "url": "https://www.youtube.com/post/Ugkx2lkCYp85jak0n5z7-bq_4ug2Rntk9iWT"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "youtube",
        "action": "community_post",
        "params": {
            "url": "https://www.youtube.com/post/Ugkx2lkCYp85jak0n5z7-bq_4ug2Rntk9iWT",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:24:23Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "youtube",
  "action": "community_post",
  "results": {
    "id": "Ugkx2lkCYp85jak0n5z7-bq_4ug2Rntk9iWT",
    "url": "https://www.youtube.com/post/Ugkx2lkCYp85jak0n5z7-bq_4ug2Rntk9iWT",
    "text": "These last two videos are the best content we’ve ever made and somehow our next 3 uploads are even better. (The team is cooking) I’m feeling more excited and energized about our videos than ever before, new era of Beast coming up 🥰",
    "author_name": "M•••t",
    "author_username": "M•••t",
    "author_id": "•••",
    "author_url": "https://www.youtube.com/•••",
    "author_avatar_url": "https://yt3.googleusercontent.com/•••",
    "like_count": 175000,
    "comment_count": 5000,
    "published_text": "1 month ago",
    "attachment_type": "image",
    "image_urls": [
      "https://yt3.ggpht.com/9davaq2roo2vRpZ80IIGBiCAy6CmeYfm17AkJbLofKYVreyWRk9Y3SF2tcHwTpdGSzRXym9Y_6096A=s994-rw-nd-v1"
    ],
    "platform": "youtube"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=youtube
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
