Felipe Kusuki
Felipe Kusuki

Reputation: 21

Youtube API PlaylistItems does not return nextPageToken

I'm using YouTube API documentation to get playlist items (https://developers.google.com/youtube/v3/docs/playlistItems/list).

But the API does not return the nextPageToken and prevPageToken properties. So I can't call the next playlist page.

The API call:

https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=RDMMfHI8X4OXluQ&key=...

youtube playlist call image

Upvotes: 2

Views: 279

Answers (1)

Roman
Roman

Reputation: 21845

According to my experience the nextPageToken and prevPageToken properties can be absent

  1. if the number of items is less than 50 (which is by default) or
  2. if you specify maxResults, then if the number of items is less then specified

You can compare:

https://www.googleapis.com/youtube/v3/playlistItems?maxResults=50&playlistId=PL3CF77047DEE78C87&part=snippet,id&type=video&fields=*&key={{YOUTUBE_API_KEY}}

and

https://www.googleapis.com/youtube/v3/playlistItems?maxResults=5playlistId=PL3CF77047DEE78C87&part=snippet,id&type=video&fields=*&key={{YOUTUBE_API_KEY}}

Upvotes: 0

Related Questions