Retrieving a List of YouTube Videos by Channel

This post will go over how to get a list of YouTube videos organized by channel. We can quickly retrieve the list of videos from a certain YouTube channel and show them on a website with their titles and thumbnails by utilizing the jQuery library in combination with the YouTube Data API.

For you to follow along with and use on your own website, this article includes a comprehensive example and code samples. This article will provide you with a thorough grasp of how to show a list of YouTube videos on your website, whether you’re a novice or an experienced web developer.

Here is an illustration of how to use JavaScript, CSS, and HTML to fetch a list of YouTube videos by channel title and links:


<!DOCTYPE html>
  <title>YouTube Video List</title>
    .video-container {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;

    .video-card {
      width: 300px;
      margin: 10px;
      text-align: center;
      border: 1px solid lightgray;
      padding: 10px;
      box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);

    .video-thumbnail {
      width: 100%;
      height: 0;
      padding-bottom: 75%;
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;

    .video-title {
      margin-top: 10px;
      font-size: 1.2em;
  <h1>YouTube Video List</h1>
  <div class="video-container">
  <script src=""></script>
    // Your JavaScript code goes here


$(document).ready(function() {
  // Your YouTube Channel ID
  var channelId = 'UCaWd5_7JhbQBe4dknZhsHJg';

  // Your YouTube API Key
  var apiKey = 'YOUR_API_KEY';

  // Get the list of videos from the channel
    '', {
      part: 'snippet',
      channelId: channelId,
      maxResults: 20,
      type: 'video',
      key: apiKey
    function(data) {
      var videos = data.items;
      $.each(videos, function(index, video) {
        var videoId =;
        var videoTitle = video.snippet.title;
        var videoThumbnail = video.snippet.thumbnails.medium.url;
        var videoLink = '' + videoId;
          '<div class="video-card">' +
            '<div class="video-thumbnail" style="background-image: url(' + videoThumbnail + ');"></div>' +
            '<div class="video-title">' + videoTitle + '</div>' +
            '<a href="' + videoLink + '" target="_blank">Watch Video</a>' +

Note: In the code above, you need to replace YOUR_API_KEY with your API Key. Find the step below to get the API key

Latest posts by W3TWEAKS (see all)


Leave a Reply

Your email address will not be published. Required fields are marked *