Youtube – How to get YouTube playlist id from video ID

youtubeyoutube-playlist

Suppose you have YouTube's video ID: ZQPQAXIQkvw and you want to get playlist ID that contains this video: PL81F0A95A935CD9A3.

How do I do it easily and reliably and hopefully automatically as in using cURL?

Current unreliable manual way:

  1. Go to the video page: https://youtube.com/watch?v=ZQPQAXIQkvw
  2. Copy the name of video: "All For Community – French Subtitles"
  3. Click on video's uploading user (in this case it's "Community Foundations of Canada"): https://www.youtube.com/channel/UCCZbPV-dOqinRhiTy2PtxPg
  4. Go to playlists page, switch it to verboser form: https://www.youtube.com/user/cfcteam/playlists?sort=lad&view=1&flow=list
  5. Scroll down, "Load more", scroll down, "Load more" until the whole page is visible (in this case not needed);
  6. Use in-browser search for the movie name (or its parts) "All For Community – French Subtitles" and hope it finds something;
  7. Playlist is found: "Playlist Sample #1" https://www.youtube.com/watch?v=ZQPQAXIQkvw&list=PL81F0A95A935CD9A3

Is there some simpler and more reliable method?

Maybe there's a publicly available API for this?

Best Answer

The thing is: There is never just one playlist in which a video is in. The video you linked is at least in two other playlists, too: The "videos uploaded by <uploader>"-Playlist and "videos liked by <a user>" playlist.

Even if there was a way of automatically listing all playlists a video is in (which isn't possible via the API AFAICT), it still would be quite complicated to find out the the exact playlist you're looking for.