YepAPI
YouTube API

Post Comments

Get comments on a YouTube community post.

POST/v1/youtube/post-comments
$0.01/call

Usage

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

ParameterTypeRequiredDescriptionDefault
idstringYesYouTube post ID
sortstringNoSort ordertop
tokenstringNoPagination token
geostringNoCountry code for geo-specific results
langstringNoLanguage 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

FieldTypeDescription
okbooleanWhether the request succeeded
data.dataobject[]Array of comment objects on the post
data.data[].commentIdstringUnique identifier for the comment
data.data[].authorTextstringComment author's display name or handle
data.data[].authorChannelIdstringChannel ID of the comment author
data.data[].authorThumbnailobject[]Author's profile picture images
data.data[].textDisplaystringComment text content
data.data[].likesCountstringHuman-readable like count
data.data[].replyCountstringNumber of replies to this comment
data.data[].publishedTimeTextstringRelative publish time (e.g. 1 day ago)
data.continuationstringToken to fetch the next page of comments

On this page