0

I call YT.Search API and then iterate over the results. Page by Page. At some point, there are still more pages to iterate, but the "items" array is empty.

I had to add a condition to break the iteration loop.

if (searchResults.items.length == 0 || !('nextPageToken' in searchResults)) {

Is that a known issue?enter image description here

I saw this post but I recall it wasn't like that a few weeks ago.

I used to call the YT search and get ~2000 results per keyword.

Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • Indeed this is a known issue of the API. I came across it myself too. In any case, you may well [file an inquiry](http://issuetracker.google.com/) to be answered (officially) by Google staff. Also note that `Search.list` does not return more than 500 items when using its request parameter [`channelId`](https://developers.google.com/youtube/v3/docs/search/list#channelId) and, at the same time, do set its request parameter [`type`](https://developers.google.com/youtube/v3/docs/search/list#type) to `video`. – stvar Jan 06 '21 at 17:57
  • Has this changed recently? I don't think it returned up to ~500 results a month ago. – Elad Benda Jan 06 '21 at 21:59
  • 1
    According to [official documentation](https://web.archive.org/web/20160317030114/https://developers.google.com/youtube/v3/docs/search/list#parameters) it seems to be limited to 500 since 17/03/2016. – Benjamin Loison Sep 24 '21 at 19:05

0 Answers0