0

Using the Google APIs Client Library for Python and the search endpoint API V3 did the follwing query:

search_response = youtube.search().list(
                        q="Mallorca",
                        part="id,snippet",
                        maxResults=50,
                        order="date",
                        publishedBefore="2014-1-1T2:00:00Z",
                        publishedAfter="2014-1-1T1:00:00Z",
                    ).execute() 

The response shows a search_response.pageInfo.totalResults of 186. That means that paging is needed to retrieve all results. However in this response I get only one result (one video) under search_response.items instead of the expected 50 of the first page.

If I use the nextPageToken (=CDIQAA) to query for the next results page:

search_response = youtube.search().list(
                        q="Mallorca",
                        part="id,snippet",
                        maxResults=50,
                        order="date",
                        publishedBefore="2014-1-1T2:00:00Z",
                        publishedAfter="2014-1-1T1:00:00Z",
                        pageToken= "CDIQAA"
                    ).execute() 

I obtain again only one result, the same video (same videoId) retrieved at the first query. Same thing happens when I navigate through the next pages of the search_response until no more pages are available (nextPageTokennot included in the response).

Have read this previous question:

page tokens use youtube api v3

and this:

Is youtube data api paging consistent if you use pagetokens? (v3 data api)

but they don't explain why I get only one result, the same video for all pages delivered by the response.

Is this an issue of the youtube API or I am doing something wrong? Thanks for your help.

Community
  • 1
  • 1
Oscar Moya
  • 47
  • 1
  • 11
  • Looks like this is an open issue for the youtube API: [issue 5173](https://code.google.com/p/gdata-issues/issues/detail?id=5173) – Oscar Moya Jan 14 '14 at 11:22
  • Yes, you are right, follow the issue. For now you can avoid ordering to get right results, but issue should get fixed soon. – Ibrahim Ulukaya Jan 14 '14 at 19:10
  • Thank you very much @IbrahimUlukaya, I will close this question and follow the issue as you suggest. – Oscar Moya Jan 16 '14 at 21:52

1 Answers1

1

This is an open issue for the youtube API:

issue 5173

Expected to be fixed soon...

The right results can be obtained if ordering is not applied.

Oscar Moya
  • 47
  • 1
  • 11