var rootURI = 'https://www.googleapis.com/youtube/v3/playlistItems?playlistId=PL3B8939169E1256C0&key=AIzaSyCnMsLoh3V5bzCJ5CYF3e_9X7-Ati9ecv0&part=contentDetails&maxResults=10';
var pageToken = '&pageToken=';
$(document).ready(function () {
LoadVids();
});
function LoadVids(pageTokenID) {
var playListURL = rootURI + ((pageTokenID) ? pageToken + pageTokenID : '');
$.getJSON(playListURL, function (data) {
var list_data = "";
$.each(data.items, function (i, item) {
});
});
}
The actual data has a header that contains the page info for next page and the total number of items (for paging)...
{
"kind": "youtube#playlistItemListResponse",
"etag": etag,
"nextPageToken": string,
"prevPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
]
}
The actual item data depends on the value the
part parameter...
Read about it on the help pages of Google:
https://developers.google.com/youtube/v3/docs/playlistItems#resource[
^]