YouTube-Web-V2-API

获取频道帖子列表/Get channel community posts

Changed on

[中文]

用途:

  • 获取YouTube频道的帖子(社区帖子)列表
  • 支持分页获取,可通过 continuation_token 获取更多帖子

参数详解:

必选参数:

channel_id (string)

  • 作用: 频道ID
  • 获取方式: 从频道URL中提取,例如 https://www.youtube.com/channel/UCkRfArvrzheW2E7b6SVT7vQ
  • 示例: "UCkRfArvrzheW2E7b6SVT7vQ"

可选参数:

language_code (string, 可选)

  • 作用: 语言代码,影响返回的文本语言
  • 默认值: "zh-CN"

country_code (string, 可选)

  • 作用: 国家代码
  • 默认值: "US"

continuation_token (string, 可选)

  • 作用: 分页token,用于获取下一页帖子
  • 获取方式: 从上一次请求的响应中获取

need_format (bool, 可选)

  • 作用: 是否格式化数据
  • 默认值: true

返回数据:

当 need_format=true 时:

  • channel_id: 频道ID
  • posts: 帖子列表
    • post_id: 帖子ID
    • post_url: 帖子URL
    • author_name: 作者名称
    • author_channel_id: 作者频道ID
    • author_url: 作者频道URL
    • author_thumbnails: 作者头像缩略图
    • content_text: 帖子文本内容
    • published_time: 发布时间(相对时间)
    • vote_count: 点赞数
    • comment_count: 评论数
    • attachment: 附件(图片/多图/视频/投票等,可能为null)
  • continuation_token: 下一页分页token
  • has_more: 是否还有更多帖子
  • total_count: 当前页帖子数量

当 need_format=false 时:

  • 返回原始响应数据

使用流程:

  1. 首次请求:只传 channel_id 参数
  2. 获取响应中的 continuation_token
  3. 下次请求:传入 channel_id 和 continuation_token
  4. 重复步骤 2-3 直到 has_more 为 false

注意事项:

  • 每页通常返回 20 个左右的帖子
  • 帖子附件支持: 图片、多图、视频、投票等类型
  • 部分频道可能没有帖子/社区标签页

价格:

  • $0.001 USD / 请求

[English]

Purpose:

  • Get YouTube channel's community posts list
  • Supports pagination via continuation_token

Parameters:

Required:

channel_id (string)

  • Purpose: Channel ID
  • How to get: Extract from channel URL, e.g., https://www.youtube.com/channel/UCkRfArvrzheW2E7b6SVT7vQ
  • Example: "UCkRfArvrzheW2E7b6SVT7vQ"

Optional:

language_code (string, optional) - Language code, default "zh-CN"

country_code (string, optional) - Country code, default "US"

continuation_token (string, optional) - Pagination token for next page

need_format (bool, optional) - Whether to format data, default true

Returns:

When need_format=true:

  • channel_id: Channel ID
  • posts: Posts list
    • post_id: Post ID
    • post_url: Post URL
    • author_name: Author name
    • author_channel_id: Author channel ID
    • author_url: Author channel URL
    • author_thumbnails: Author avatar thumbnails
    • content_text: Post text content
    • published_time: Published time (relative)
    • vote_count: Like count
    • comment_count: Comment count
    • attachment: Attachment (image/multi_image/video/poll, may be null)
  • continuation_token: Next page pagination token
  • has_more: Whether there are more posts
  • total_count: Current page post count

When need_format=false:

  • Returns raw response data

Usage Flow:

  1. First request: Only pass channel_id parameter
  2. Get continuation_token from response
  3. Next request: Pass channel_id and continuation_token
  4. Repeat steps 2-3 until has_more is false

Notes:

  • Each page typically returns around 20 posts
  • Post attachments support: image, multi_image, video, poll types
  • Some channels may not have posts/community tab

Price:

  • $0.001 USD / request

[示例/Example]

获取频道帖子: channel_id = "UCkRfArvrzheW2E7b6SVT7vQ"

get/api/v1/youtube/web_v2/get_channel_community_posts

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Query parameters

channel_idstring required

频道ID/Channel ID

language_codestring

语言代码(如zh-CN, en-US等)/Language code

country_codestring

国家代码(如US, JP等)/Country code

continuation_tokenstring

分页token,用于获取下一页/Pagination token for next page

need_formatboolean

是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      the response's property default value changed from This request will be cached. You can access the cached result directly using the URL below valid for 24 hours. Accessing the cache will not incur additional charges. to This response is cached and accessible via the URL below for 24 hours at no extra cost. The cache is for request tracing only — it doesn't affect the API's data freshness and won't be returned through the API again. for the status

    • info

      the response's property default value changed from 本次请求将被缓存,你可以使用下面的 URL 直接访问缓存结果,有效期为 24 小时,访问缓存不会产生额外费用。 to 本次响应已缓存,可通过下方 URL 直接查看,有效期 24 小时,访问缓存链接无额外费用。缓存仅用于请求溯源,不影响接口数据的时效性,也不会再次通过接口返回。 for the status