Retrieve all videos from youtube playlist using youtube v3 API

YouTube Data API v3 results are paginated. So you need to get the next page of results for the others.

Basically in the response you have nextPageToken.

To get the remaining results, do the same exact call but setting pageToken into that token you received.


There are three tokes

  1. pageToken
  2. nextPageToken
  3. prevPageToken

and also you can set max page size using

maxResults=50 {allowed Values 1 to 50 }

if you are on page 1 you won't get prevPageToken

but you get nextPageToken

pass this token to next request's

pageToken = {nextPageToken get from last request}

this way you can navigate to next page Try it Your Self

Edited

Ok, for other scenarios

If you are on First Page then

  1. pageToken = 'Some values'
  2. nextPageToken = 'Some values'
  3. prevPageToken = null

If you are on neither the first nor last page then

  1. pageToken = 'Some values'
  2. nextPageToken = 'Some values'
  3. prevPageToken = 'Some values'

@Manoj: you can find your answer below

if you are on the last page

  1. pageToken = 'Some values'
  2. nextPageToken = null
  3. prevPageToken = 'Some value'

Even the field may not be present.