YouTube Get Video Comments
## Purpose Retrieve a page of top-level comments for a YouTube video, with top or newest sorting and optional pagination. This tool reads comments; it does not post comments or retrieve reply threads. ## Inputs - **video_id** (required string): The exactly 11-character YouTube video ID, for example `oaSNBz4qMQY`. Use the ID from the video's URL, not the full URL. - **sort_by** (optional string): `top` for top comments (default), or `newest` for the latest comments. - **language_code** (optional string): Language preference, such as `zh-CN`, `en-US`, `ja-JP`, or `ko-KR`. Default: `zh-CN`. - **country_code** (optional string): Region code, such as `US`, `JP`, or `GB`. Default: `US`. - **continuation_token** (optional string): Omit for the first page. To request another page for the same video, supply the comments-page token returned by the previous response. - **need_format** (optional boolean): `true` (default) returns cleaned, simplified data; `false` returns raw data. ## Results The response includes a `data` payload. With `need_format=true`, the documented comment payload contains a `comments` list and a page-level `continuation_token` when available. Comment entries can include: - `comment_id`, `content`, and `published_time`: Comment ID, text, and relative publication time. - `reply_level`: `0` for top-level comments. - `like_count`, `reply_count`, and related display text: Likes and reply counts, which may be represented as strings. - `author`: Channel ID, display name, channel link, avatars, and verification, creator, or artist indicators. - `creator_thumbnail_url`: Video creator's avatar URL. - `reply_continuation_token`: A token associated with that comment's replies; this is not the page-level token for more top-level comments and does not mean replies have been retrieved. A single request returns one page, not necessarily every comment. Raw output has a different structure from the cleaned comment payload. ## Example `{"video_id":"oaSNBz4qMQY","sort_by":"newest","need_format":true}`
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.
Each call retrieves one page of top-level comments. Fetching the next page with the comment list continuation token requires a separate call.
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
sort_by | enum (top | newest) | No | 排序方式 | Sort by | top |
video_id | string | Yes | 视频ID/Video ID | — |
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 | 翻页令牌/Pagination token | — |
Invocation example
Copy the request and explore its response example.
/agent-api/v1/tool/executeX-Api-Keycurl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_youtube_get_video_comments' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"country_code": "TH",
"language_code": "en-US",
"need_format": true,
"sort_by": "newest",
"video_id": "vae95SyraN8"
}
}'{
"code": 200,
"data": {
"comments": [
{
"author": {
"avatar_thumbnails": null,
"avatar_url": "https://yt3.ggpht.com/ytc/AIdro_mgFeg2meIauFDpacjQf0GSNk2aZSTtoaI8b6K54IcEzWA=s88-c-k-c0x00ffffff-no-rj",
"channel_id": "UCetcQ3b5e1gcGMhZoRMFi8A",
"channel_url": "https://www.youtube.com/@newtype3870",
"display_name": "@newtype3870",
"is_artist": false
},
"comment_id": "UgyM_c_sodshB1jUX614AaABAg",
"content": "สิ่งที่ควรจะเป็น",
"creator_thumbnail_url": null,
"like_count": "0",
"like_count_a11y": "0 likes"
}
]
},
"docs": "https://api.tikhub.io/#/YouTube-Web-V2-API/get_video_comments_api_v1_youtube_web_v2_get_video_comments_get",
"message": "Request successful. This request will incur a charge.",
"message_zh": "请求成功,本次请求将被计费。",
"request_id": "d4e75fc3-1441-4009-8cb6-a03efb9e1c21"
}This example shows part of the response. Copied content is valid JSON.

