Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3723

Cannot page through all results using nextPageToken on YouTube search API v3

$
0
0

I am using the YouTube search API v3. I am trying to get snippets of all the videos of a channel. To go from page to page, I use the nextPageToken. The channel that I am interested in has 3,628 total results. After I get to 500 videos (the 10th page, as I am requesting 50 videos per page), the nextPageToken is no longer passed back.

Is there a limit on the total number of videos I can page through for a particular channel?

Initially, I start off with the following URL and follow the nextPageToken by appending to the query string &pageToken=[nextPageToken].

https://www.googleapis.com/youtube/v3/search?key=[key]&channelId=UCEBb1b_L6zDS3xTUrIALZOw&part=snippet,id&order=date&maxResults=50&safeSearch=none&videoEmbeddable=true&type=video

The URL for the 10th page is as follows.

https://www.googleapis.com/youtube/v3/search?key=[key]&channelId=UCEBb1b_L6zDS3xTUrIALZOw&part=snippet,id&order=relevance&maxResults=50&safeSearch=none&videoEmbeddable=true&type=video&pageToken=CMIDEAA

Also, I note something weird in that from page to page, the total number of videos changes. Is this a known bug?

The following table list the page along with the corresponding page token and total results. Note that I do not (need to) pass in a pageToken for the first page.

+------+------------+---------------+| Page | Page Token | Total Results |+------+------------+---------------+|    1 | [none]     |          3628 ||    2 | CDIQAA     |          3628 ||    3 | CGQQAA     |          3626 ||    4 | CJYBEAA    |          3626 ||    5 | CMgBEAA    |          3625 ||    6 | CPoBEAA    |          3625 ||    7 | CKwCEAA    |          3625 ||    8 | CN4CEAA    |          3624 ||    9 | CJADEAA    |          3624 ||   10 | CMIDEAA    |          3624 |+------+------------+---------------+

Viewing all articles
Browse latest Browse all 3723

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>