2

I'm trying to fetch whole Youtube playlist, but definitely something is going wrong. It looks like playlistItems do not return all items. To be more precise, for larger playlist it always returns 26 elements.

EDITED

This issue affect only playlist with "50+ Videos" hover

example

The fun fact that it also affect Youtube Website

When you open following link you will get whole playlist on the right side

https://www.youtube.com/watch?v=OBwl2glmqC0&list=PLhy8TB5U6n17R78U7usaLQfCC8nbnG8Nc

When you do the same on the "Affected" playlist, it always ends on 26th element

https://www.youtube.com/watch?v=p7ZsBPK656s&list=RDQMxZTL9gI53Rg

(Additionaly "Affected" playlist always have a shorter URL)

/EDITED

F.i.

https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=RDZgEY-EkNGN8

Returns

/**
 * API response
 */
{
  "kind": "youtube#playlistItemListResponse",
  "etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/Juh7DGrIhXG9sC1xb0BKgzZ5Mqo\"",
  "pageInfo": {
    "totalResults": 26,
    "resultsPerPage": 50
  },
  "items": [
....so on

The total results shows that this playlist contain 26 elements which is not true because it have more than 50 elements

ex. 51st element

https://www.youtube.com/watch?v=QptgChaqIQY&list=RDZgEY-EkNGN8&index=51

Does someone experienced similar issue or maybe it's some kind of limitation but I haven't found any information about that.

Thanks in advance.

Fr33c3l
  • 165
  • 1
  • 1
  • 11

1 Answers1

0

You may refer with this thread. It stated that you need to get the next page of results for the others. To get the remaining results, do the same exact call but setting pageToken into that nextPageToken you received in the response. Be noted that maxResults only allowed Values 1 to 50.

You may also follow this reported issue for updates.

abielita
  • 13,147
  • 2
  • 17
  • 59
  • Thanks for response. Please check my new, edited section. The problem concerns only some type of playlists. – Fr33c3l Jul 31 '17 at 15:57
  • @Fr33c3l can you share how you get this result? [https://i.stack.imgur.com/7flY6.png](https://i.stack.imgur.com/7flY6.png). I was checking this issue and I think that you can use the [Youtube Iframe API](https://developers.google.com/youtube/iframe_api_reference?hl=es-419#Retrieving_playlist_information). – Mauricio Arias Olave Jan 17 '19 at 17:11