1

Is there any reason why after 19 search requests for videos with the topicId /m/019_rr, the API sends an undefined nextPageToken?

the log of nextPageTokens and the result for the last request

As it can be seen in the screenshot, the nextPageToken for the last request is undefined and the result for that request is also logged showing that it has an empty list of items.

The first request's pageInfo property says:

"pageInfo": {
    "totalResults": 1000000,
    "resultsPerPage": 50
},

So this means there surely must be more than 20 requests to be made.

The requests options I use are:

{
    part: 'snippet',
    maxResults: 50,
    topicId: '/m/019_rr',
    pageToken: nextPageToken || '',
    regionCode: 'US',
    key: config.googleApiKey
}

I am also sure this is not a quota issue.

Any help would be much appreciated.

Vlad
  • 997
  • 1
  • 5
  • 18
  • You may check this [related thread](https://stackoverflow.com/questions/21110625/unexpected-behaviour-while-paging-with-youtube-api-v3-google-apis-client-librar) wherein it stated that the right results can be obtained if ordering is not applied. Check this [reported issue](https://issuetracker.google.com/issues/35173543) for updates. – abielita Aug 24 '17 at 17:50
  • @abielita As can be seen from the initial question, I don't use any ordering, so the order will default to "relevance". But the problem still persists. – Vlad Aug 31 '17 at 08:23

0 Answers0