title: List all videos of a YouTube channel in Google Apps Script
body: <p>I'm using YouTube Data API to list first 25 video titles and ids of a channel in google spreadsheet, but for some reason I'm only getting the Title of the channel.</p>
  <p>Here are my codes:</p>
  <pre><code>function searchByChannel() {
      var results = YouTube.Channels.list('id,snippet', {
          id: 'UC-9-kyTW8ZkZNDHQJ6FgpwQ',
          maxResults: 25
      });
  
      var title = &quot;&quot;;
      var id = &quot;&quot;;
      var lr = 0;
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet1 = ss.getSheetByName(&quot;Sheet1&quot;);
      for (var i = 0; i &lt; results.items.length; i++) {
          var item = results.items[i];
          title = item.snippet.title;
          id = item.id.videoId;
          lr = sheet1.getLastRow() + 1;
          sheet1.getRange(lr, 1).setValue(title);
          sheet1.getRange(lr, 2).setValue(id);
          lr++;
      }
  }
  </code></pre>
  <p>I'm new to YouTube data api so I don't know what I'm doing wrong here. How can I list 25 video ids and titles in my spreadsheet using google apps script?</p>