YouTube API
Video Comments
Fetch comments and replies for any YouTube video with pagination.
POST
$0.01/call/v1/youtube/commentsUsage
const res = await fetch('https://api.yepapi.com/v1/youtube/comments', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ id: 'dQw4w9WgXcQ' }),
});
const { data } = await res.json();
console.log(data.commentsCount, data.data);curl -X POST https://api.yepapi.com/v1/youtube/comments \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "dQw4w9WgXcQ"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
id | string | Yes | YouTube video ID | — |
sort | string | No | Sort: top or new | top |
token | string | No | Continuation token for pagination | — |
Response
{
"ok": true,
"data": {
"commentsCount": "2433931",
"continuation": "Eg0SC...",
"data": [
{
"commentId": "Ugzge340dBgB75hWBm54AaABAg",
"authorText": "@YouTube",
"authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
"authorIsChannelOwner": false,
"authorThumbnail": [
{ "url": "https://yt3.ggpht.com/...=s88-c-k-c0x00ffffff-no-rj", "width": 88, "height": 88 }
],
"textDisplay": "can confirm: he never gave us up",
"likesCount": "223K",
"replyCount": "961",
"publishDate": "2025-05-13",
"publishedAt": "2025-05-13T00:00:00Z",
"publishedTimeText": "11 months ago",
"replyToken": "Eg0SC...",
"isVerified": true,
"isArtist": false,
"isCreator": false
},
{
"commentId": "UgxIOV-sXAchpKX94cB4AaABAg",
"authorText": "@ochkalov",
"authorChannelId": "UCtbyFPryy7J4DR4xh5CRCvA",
"authorIsChannelOwner": false,
"textDisplay": "1987 : normal song \r\n2026 : national anthem of the universe",
"likesCount": "126K",
"replyCount": "933",
"publishDate": "2020-04-13",
"publishedAt": "2020-04-13T00:00:00Z",
"publishedTimeText": "6 years ago (edited)",
"isVerified": false
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.commentsCount | string | Total number of comments on the video |
data.continuation | string | Token to fetch the next page of comments |
data.data | object[] | Array of comment objects |
data.data[].commentId | string | Unique identifier for the comment |
data.data[].authorText | string | Comment author's display name or handle |
data.data[].authorChannelId | string | Channel ID of the comment author |
data.data[].authorIsChannelOwner | boolean | Whether the author is the video's channel owner |
data.data[].authorThumbnail | object[] | Author's profile picture images |
data.data[].textDisplay | string | Comment text content with formatting |
data.data[].likesCount | string | Human-readable like count (e.g. 223K) |
data.data[].replyCount | string | Number of replies to this comment |
data.data[].publishDate | string | Comment date in YYYY-MM-DD format |
data.data[].publishedAt | string | Comment date as ISO 8601 timestamp |
data.data[].publishedTimeText | string | Relative time (e.g. 11 months ago, 6 years ago (edited)) |
data.data[].replyToken | string | Token to fetch replies for this comment |
data.data[].isVerified | boolean | Whether the commenter has a verified badge |
data.data[].isArtist | boolean | Whether the commenter is an Official Artist |
data.data[].isCreator | boolean | Whether the commenter is the video creator |
Use the continuation token to paginate through comments.