YouTube Get Video Comments

2.07 credits/call
ae_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}`

Social
2.07 credits/call

Pricing

2.07 credits/call
ConditionCharge
Each call2.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.

ParameterTypeRequiredDescriptionDefault
sort_byenum (top | newest)No排序方式 | Sort bytop
video_idstringYes视频ID/Video ID—
need_formatbooleanNo是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the datatrue
country_codestringNo国家代码(如US, JP等)/Country codeUS
language_codestringNo语言代码(如zh-CN, en-US等)/Language codezh-CN
continuation_tokenstringNo翻页令牌/Pagination token—

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --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"
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "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.