YouTube Get Post Comments
## Purpose Retrieve comments on a YouTube community post, with pagination. This is for post comments, not video comments or replies to an individual comment. ## Inputs Provide at least one of the following: - `post_id` (string): The community post ID for an initial request. Extract it from a URL such as `https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy`. - `continuation_token` (string): Use the `comments_continuation_token` from post details to start, or the `continuation_token` from a previous comments response to retrieve the next page. Optional settings: - `language_code` (string): Language code; default `"zh-CN"`. - `country_code` (string): Country code; default `"US"`. - `need_format` (boolean): Clean and format the returned data; default `true`. The field layout below is documented for formatted results, not for unformatted results. ## Results With `need_format=true`, the result data includes: - `comments`: The comments on the requested page. Comment fields include `comment_id`, `content`, `published_time`, `like_count`, `like_count_a11y` (accessible like-count text), `reply_count`, and `reply_count_text`. - Each comment's `author`: Author information including `channel_id`, `display_name`, `channel_url`, `avatar_url`, `is_verified`, and `is_creator`. - Each comment's `reply_continuation_token`, where available: A token for retrieving that comment's replies with a separate reply-retrieval tool. - `continuation_token`: A token for requesting the next page of post comments when available. Pass the returned page token as `continuation_token` to continue reading comments. A reply token is not the next-page token for this list.
Pricing
| Condition | Charge |
|---|---|
| Each call | 2.07 credits/call |
2.07 credits/call Charges are per query. A successful query is billed even if it returns no results.
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
post_id | string | No | 帖子ID(首次请求时必填)/Post ID (required for first request) | — |
need_format | boolean | No | 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data | true |
country_code | string | No | 国家代码(如US, JP等)/Country code | US |
language_code | string | No | 语言代码(如zh-CN, en-US等)/Language code | zh-CN |
continuation_token | string | No | 分页token(分页时必填,也可用 get_post_detail 返回的 comments_continuation_token)/Pagination token | — |
Invocation example
Parameter templateGenerated from the parameter configuration. Replace the sample values before use.
/agent-api/v1/tool/executeX-Api-Keycurl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_youtube_get_post_comments' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {}
}'No response example available yet.

