Bossprogrammer1991
Bossprogrammer1991

Reputation: 23

Youtube Data API - how to get all videos in a playlist rather than just 50?

To start, here is a reference for what I'm asking about: https://developers.google.com/youtube/v3/docs/playlistItems/list

In my javascript code I use a playlist request from the data API like this:

var request = gapi.client.youtube.playlistItems.list({
  playlistId: listId,
  part: 'snippet',
  maxResults: 50
});

Does anybody know a way, without going back to the v2 API which is deprecated, to get all videos in a playlist rather than being stuck with the most recent 50? The maxResults parameter ranges from 0-50 and it would be awesome to find a way to get around that. Thank you for your help!

Upvotes: 2

Views: 611

Answers (1)

Jakub Kratina
Jakub Kratina

Reputation: 664

You are not stucked. In response you should have next page token. Read more about pageToken and you will have your answers.

Upvotes: 1

Related Questions