How do I add public youtube videos to a playlist in Youtube using URL?
<p>The Youtube Data API doesn't have any option for this procedure. May be because it has got something to do with authentication. But what I'm referring is to add public videos to a playlist. How do I accomplish this using python?</p>

<p>You can use the <a href="https://developers.google.com/youtube/v3/docs/playlistItems/insert" rel="nofollow"><code>PlaylistItems: insert</code></a> to insert a video inside a playlist.</p>

<p>Here is the request that I used.</p>

<pre><code>POST https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&amp;key={YOUR_API_KEY}

{
"snippet": {
"playlistId": "PLgTC0orxjF5MrSEDzjT7J1lkR4zYwPEpf",
"resourceId": {
"videoId": "qnHyhCYOgTI",
"kind": "youtube#video"
}
}
}
</code></pre>

<p>Make sure that you pass <code>youtube#video</code> on the <code>kind</code> attribute of the <code>resourceId</code>.
Because if you did not specify it, you will get an error <code>400 Bad request Resource type not supported</code>.</p>

<p>For the Python code that you want, you can check this related <a href="http://stackoverflow.com/questions/21228815/adding-youtube-video-to-playlist-using-python">SO question</a>.</p>

<blockquote>
  <p>NOTE: This request requires authorization with at least one of the
  following scopes: </p>
  
  <p><a href="https://www.googleapis.com/auth/youtubepartner" rel="nofollow">https://www.googleapis.com/auth/youtubepartner</a> </p>
  
  <p><a href="https://www.googleapis.com/auth/youtube" rel="nofollow">https://www.googleapis.com/auth/youtube</a></p>
  
  <p><a href="https://www.googleapis.com/auth/youtube.force-ssl" rel="nofollow">https://www.googleapis.com/auth/youtube.force-ssl</a></p>
</blockquote>

python youtube-api youtube-data-api