0
votes

I'm using the Youtube Data api here: https://github.com/youtube/api-samples

Specifically, I am looking at: https://github.com/youtube/api-samples/blob/master/python/search.py

In that file there is:

 search_response = youtube.search().list(
    q=options.q,
    part="id,snippet",
    maxResults=options.max_results
).execute()

However, the maximum result is 50. Is ther ea way I can change the parameter to youtube.search() to get results 51 -100, 101 - 150, etc? I can't seem to find it in the documentation. Thanks!

1

1 Answers

0
votes

You can use the pageToken parameter to get the next pages:

pageToken string

The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.

Next pages id(nextPageToken) is returned from the first response, using that id to get next page.

{
 "kind": "youtube#searchListResponse",
 "etag": etag,
 "nextPageToken": string,
 "prevPageToken": string,
 "regionCode": string,
 "pageInfo": {
   "totalResults": integer,
   "resultsPerPage": integer
 },
 "items": [
   search Resource
 ]

}

More information can be found here