How get all videos from a playlist using youtube api?

By | December 18, 2017

Now i am using this link

to retrieve video from YouTube playlist. but the problem is only getting 25 video. but the playlist contains 100 videos. How get all video from playlist?


Youtube let’s you fetch up to 50 entries per request.
The response contains some <link> elements. And if there are still more records to fetch one of it is of the form <link rel='next' ... e.g.


Search for this element and retrieve the document that the href attribute points to until the repsonse has no <link rel='next' element.


YouTube API v3

You need to request the PlaylistItems > list feed:

The JSON returned by the API will contain these properties:

  • nextPageToken
  • prevPageToken

Pass one of these values in the pageToken query string parameter to retrieve the next or previous “page” in the result set:

The JSON also contains pageInfo.resultsPerPage and pageInfo.totalResults properties.

YouTube API v2 answer is here.

Leave a Reply

Your email address will not be published. Required fields are marked *