Im retrieving videos of a playlist using youtube v3 API and getting 50 items without any problem with this link:-
But the video count is 100 and im only getting 50. How can i get the next 50 items? I tried start-index but it doesnot work for v3 API. Any help is appreciated.
This is a small example made in python using the Python Youtube Client Lib This also borrows boilerplate setup from the youtube API examples
videos will be a list of all your videos concatenated to the first list. It will keep fetching until it has all the videos because of pagination by 50. A similar approach can be taken in other languages.
In the list there will be all the individual video meta data and order
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.
here is my recursive function, maybe can help somebody:
First at all I created a button for the first call:
Then in script section:
Regards
This javascript retrieves 115 clips (from PLTI6yRvQqlYq9KoU-NHu43uDmKON7Fsjv) and 91 clips (from PL32C69B40337EF920)
TEST THIS html file at:
http://pvhung20.url.ph/api3/retrieve-all-videos-stackoverflow.html
Ther are three tokes
and also you can set max page size using
if you are in page 1 you won't get
prevPageToken
but you get
nextPageToken
pass this token to next request's
this way you can navigate to next page Try it YourSelf
Edited
Ok, for other scenarios
If you are in any other page not is firs or last then there will be all these values
@Manoj : you can find your answer below if you are in last page
Another solution, using recursion:
And then call it as follows: