Skip to content

Instantly share code, notes, and snippets.

@chenr2
Last active August 29, 2015 14:25
Show Gist options
  • Save chenr2/b99efd90bd0e67bb0b67 to your computer and use it in GitHub Desktop.
Save chenr2/b99efd90bd0e67bb0b67 to your computer and use it in GitHub Desktop.
YouTube v3 API: getting videos from a playlist

Getting videos from a YouTube playlist

This is the Jay Chou Playlist I want videos from:

https://www.youtube.com/playlist?list=PL50C17441DA8A565D

YouTube's API explorer has a playlist endpoint:

https://developers.google.com/youtube/v3/docs/playlistItems/list

This is the API call:

https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PL50C17441DA8A565D&key={YOUR_API_KEY}

And here is the response:

{
 "items": [
  {
   "snippet": {
    "title": "Jay Chou - East Wind Breaks (東風破)",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/vi/kGbDymJ75PU/default.jpg",
     },
    },
    "resourceId": {
     "videoId": "kGbDymJ75PU"
    }
   }
  },
  {
   "snippet": {
    "title": "Jay Chou - Chrysanthemum Flower Bed (Ju Hua Tai) Sub'd",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/vi/oVPepkniuXI/default.jpg",
     },
    },
    "resourceId": {
     "videoId": "oVPepkniuXI"
    }
   }
  }
 ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment