YouTube API
Post Comments
Get comments on a YouTube community post.
POST
$0.01/call/v1/youtube/post-commentsUsage
const res = await fetch('https://api.yepapi.com/v1/youtube/post-comments', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ id: 'UgkxMy8D54...' }),
});
const { data } = await res.json();
console.log(data.data, data.continuation);curl -X POST https://api.yepapi.com/v1/youtube/post-comments \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "UgkxMy8D54..."}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
id | string | Yes | YouTube post ID | — |
sort | string | No | Sort order | top |
token | string | No | Pagination token | — |
geo | string | No | Country code for geo-specific results | — |
lang | string | No | Language code | — |
Response
{
"ok": true,
"data": {
"data": [
{
"commentId": "Ugxyz...",
"authorText": "@User123",
"authorChannelId": "UCxyz...",
"authorThumbnail": [
{ "url": "https://yt3.ggpht.com/...", "width": 88, "height": 88 }
],
"textDisplay": "Great idea!",
"likesCount": "42",
"replyCount": "3",
"publishedTimeText": "1 day ago"
}
],
"continuation": "4qmF..."
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.data | object[] | Array of comment objects on the post |
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[].authorThumbnail | object[] | Author's profile picture images |
data.data[].textDisplay | string | Comment text content |
data.data[].likesCount | string | Human-readable like count |
data.data[].replyCount | string | Number of replies to this comment |
data.data[].publishedTimeText | string | Relative publish time (e.g. 1 day ago) |
data.continuation | string | Token to fetch the next page of comments |