title: How to extract metadata for more than 20000 videos from channel using YouTube Data API v3?
body: <p>I want to use Youtube Data API v3 to extract video metadata (especially title and publish date) for all videos in a channel. Currently, I'm only being able to extract details the last 20000 videos using the <code>playlistItems()</code> endpoint. Is there a way to extract metadata for more than 20000 videos from a single channel?</p>
  <p>Here's the python code I'm using to extract metadata for 20000 videos.</p>
  <pre><code>youtube = build('youtube','v3',developerKey= &quot;YOUTUBE_API_KEY&quot;)
  channelId = &quot;CHANNEL_ID&quot;
  
  # getting all video details
  contentdata = youtube.channels().list(id=channelId,part='contentDetails').execute()
  playlist_id = contentdata['items'][0]['contentDetails']['relatedPlaylists']['uploads']
  videos = [ ]
  next_page_token = None
  
  while 1:
      res = youtube.playlistItems().list(playlistId=playlist_id,part='snippet',maxResults=50,pageToken=next_page_token).execute()
      videos += res['items']
      next_page_token = res.get('nextPageToken')
      if next_page_token is None:
          break
  
  # getting video id for each video
  video_ids = list(map(lambda x:x['snippet']['resourceId']['videoId'], videos))
  </code></pre>
  <p>The solution to this problem can either be forcing the API to extract metadata more than 20000 videos from a channel or specifying a time period during which video was uploaded. That way, the code can be run again and again for multiple time periods to extract metadata for all videos.</p>