title: How to get the total number of comment of a channel using YouTube Data API
body: <p>I am using YouTube Data API and can get subscriber count, view count etc. by using the <code>statistics</code> parameter. I am aware that <code>statistics</code> cannot be used to get total likeCount and commentCount for a channel. But the API allows to get the playlist videos using <code>contentDetails.relatedPlaylists.uploads</code>.</p>
  <p>So, my question is</p>
  <p>How can I use the <code>contentDetails.relatedPlaylists.uploads</code> to fetch individual videos' likes and comments and append them into a JS variable?</p>
  <p><strong>EDIT</strong></p>
  <p>The embedded videos with titles are showing perfectly. But <code>commentCount</code> for the video does not show up.
  Here is the code</p>
  <pre><code>function requestVideoPlaylist(playlistId) {
    const requestOptions = {
      playlistId: playlistId,
      part: 'snippet,contentDetails,statistics',
      maxResults: 10
    };
  
    const request = gapi.client.youtube.playlistItems.list(requestOptions);
  
    request.execute(response =&gt; {
      console.log(response);
      const playListItems = response.result.items;
      if (playListItems) {
        let output = '&lt;br&gt;&lt;h4 class=&quot;center-align&quot;&gt;Latest Videos&lt;/h4&gt;';
  
        // Loop through videos and append output
        playListItems.forEach(item =&gt; {
            const videoId = item.snippet.resourceId.videoId;
            const videoTitle = item.snippet.title;
            const videoComment = item.statistics.commentCount;
  
          output += `
            &lt;div class=&quot;col s3&quot;&gt;
            &lt;iframe width=&quot;100%&quot; height=&quot;auto&quot; src=&quot;https://www.youtube.com/embed/${videoId}&quot; frameborder=&quot;0&quot; allow=&quot;autoplay; encrypted-media&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &quot;${videoTitle}&quot; &quot;${videoComment}&quot;
            &lt;/div&gt;
          `;
        });
  
        // Output videos
        videoContainer.innerHTML = output;
      } else {
        videoContainer.innerHTML = 'No Uploaded Videos';
      }
    });
  }
  </code></pre>
  <p>Help will be greatly appreciated.</p>