title: KeyError for 'snippet' when using YouTube Data API RelatedToVideoID feature
body: <p>This is my first ever question on Stack Overflow so please do tell me if anything remains unclear. :)</p>
  <p>My issue is somewhat related to <a href="https://stackoverflow.com/questions/40181888/keyerror-with-youtube-api-using-python">this thread</a>. I am trying to use the YouTube Data API to sample videos for my thesis. I have done so successfully with the code below; however, when I change the criterion from a query (<code>q</code>) to <code>relatedToVideoId</code>, the unpacking section breaks for some reason.</p>
  <p>It works outside of my loop, but not inside it (same story for the <code>.get()</code> suggestion from the other thread). Does anyone know why this might be and how I can solve it?</p>
  <p>This is the (shortened) code I wrote which you can use to replicate the issue:</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  # Allocate credentials:
  from googleapiclient.discovery import build
  api_key = &quot;YOUR KEY SHOULD GO HERE&quot;
  # Session Build
  youtube = build('youtube', 'v3', developerKey = api_key)
  
  df_sample_v2  = pd.DataFrame(columns = [&quot;Video.ID&quot;, &quot;Title&quot;, &quot;Channel Name&quot;])    
  keywords       = ['Global Warming',
                    'Coronavirus'
                    ]
  iter           = list(range(1, 150))
  rand_selec_ids = ['H6u0VBqNBQ8',
                   'LEZCxxKp0hM'
                   ]
  for i in iter:
          
        # Search Request
        request = youtube.search().list(
            part             = &quot;snippet&quot;,
            #q               = keywords[4],
            relatedToVideoId = rand_selec_ids[1],
            type             = &quot;video&quot;,
            maxResults       = 5000,
            videoCategoryId  = 28,
            order            = &quot;relevance&quot;,
            eventType        = &quot;completed&quot;,
            videoDuration    = &quot;medium&quot;
        ) 
  
        # Save Response
        response = request.execute()
  
        # Unpack Response
        rows = []
  
        for i in list(range(0, response['pageInfo']['resultsPerPage'])):
  
            rows.append([response['items'][i]['id']['videoId'],
                         response['items'][i]['snippet']['title'], # this is the problematic line
                         response['items'][i]['snippet']['channelTitle']]
                       )
  
        temp = pd.DataFrame(rows, columns = [&quot;Video.ID&quot;, &quot;Title&quot;, &quot;Channel Name&quot;])
        df_sample_v2 = df_sample_v2.append(temp)
        print(f'{len(df_sample_v2)} videos retrieved!')
  </code></pre>
  <p>The KeyError I get is at the second line of rows.append() where I try to access the snippet.</p>
  <pre><code>KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-90-c6c01139e372&gt; in &lt;module&gt;
       45 
       46                 rows.append([response['items'][i]['id']['videoId'],
  ---&gt; 47                              response['items'][i]['snippet']['title'],
       48                              response['items'][i]['snippet']['channelTitle']]
       49                            )
  
  KeyError: 'snippet'
  </code></pre>