Fetch Paginated YouTube Video Comments (Top or Newest)
GET/v1/youtube/comments
Retrieves top or newest comments for a YouTube video, including author handle, channel ID, like count, reply count, pinned/hearted badges, and nextCursor pagination token. Cost: 1 Credit per comment returned (minimum 10 Credits per non-empty call).
Query Parameters
video_idstringrequired11-character YouTube video ID (
dQw4w9WgXcQ) or full YouTube URL.sort_bystringSort order:
top(most relevant/liked) ornewest.limitintegerNumber of comments to return per page (1–100).
cursorstringContinuation token from
data.nextCursor(meta.next_cursor).
Example Request (cURL / Python / JavaScript)
curl "https://api.youtubeapi.io/v1/youtube/comments?video_id=dQw4w9WgXcQ" \
-H "x-api-key: yt_live_your_api_key"Live Response Preview
{
"code": 0,
"provider": "https://youtubeapi.io",
"status": "ok",
"msg": "success",
"data": {
"videoId": "dQw4w9WgXcQ",
"totalCommentsCount": 2410000,
"sortBy": "top",
"nextCursor": null,
"continuation": null,
"hasMore": false,
"items": [
{
"commentId": "UgzX_dQw4w9WgXcQ_1",
"videoId": "dQw4w9WgXcQ",
"parentId": null,
"author": "@YouTube",
"authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
"authorAvatar": null,
"authorIsOwner": false,
"authorIsVerified": true,
"text": "Can confirm: he never gave us up.",
"likeCount": 942000,
"replyCount": 512,
"isHearted": true,
"isPinned": true,
"publishedTimeText": "3 years ago",
"publishedAt": "2023-01-15T12:00:00.000Z"
}
]
},
"meta": {
"request_id": "2b3c4d5e-2222-3333-4444-555566667777",
"endpoint": "/v1/youtube/comments",
"cached": true,
"source": "pg",
"items_count": 2,
"credits_charged": 10,
"has_more": false,
"next_cursor": null,
"latency_ms": 7
}
}Response Fields
Successful comments response
| Field | Type | Sample / Notes |
|---|---|---|
code | integer | |
provider | string | |
status | string | |
msg | string | |
data | object | |
videoId | string | |
totalCommentsCount | integer | |
sortBy | string | |
nextCursor | stringnull | |
continuation | stringnull | |
hasMore | boolean | |
items | array of CommentData | |
commentId | string | Unique YouTube comment ID. |
videoId | string | 11-character YouTube video ID. |
parentId | stringnull | Parent comment ID if reply. |
author | string | Author handle or display name. |
authorChannelId | stringnull | Author's YouTube channel ID. |
authorAvatar | stringnull | Author profile image URL. |
authorIsOwner | boolean | True if comment is by the video creator. |
authorIsVerified | boolean | |
text | string | Comment text content. |
likeCount | integer | Number of likes on the comment. |
replyCount | integer | Number of replies to the comment. |
isHearted | boolean | True if hearted by the creator. |
isPinned | boolean | True if pinned to top of comments. |
publishedTimeText | stringnull | Relative publish time (e.g. 2 days ago). |
publishedAt | stringnull | ISO 8601 timestamp when available. |
meta | ResponseMeta | |
request_id | string | Unique UUID for tracing and support. |
endpoint | string | Canonical endpoint path. |
cached | boolean | True if served from L1 Redis or L2 PostgreSQL 16 asset sink. |
source | string | Data source tier (redis, pg, upstream_primary, upstream_fallback, oembed). |
items_count | integer | Number of records returned in data. |
credits_charged | integer | Credits deducted for this request ($1 = 10,000 Credits). |
has_more | boolean | Whether additional pages are available via next_cursor. |
next_cursor | stringnull | Continuation cursor for the next page. |
latency_ms | integer | End-to-end gateway latency in milliseconds. |
Status Codes
- 200
- Successful comments response