I'm trying to get video data from the YouTube API (v3) using this example:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&maxResults=25&order=relevance&q=site%253Ayoutube.com&topicId=%252Fm%252F02vx4&_h=1&
The problem is that I don't understand how to change the page results. For example this query gives me 25 items (maxResults=25) but total results are --> "totalResults": 548669. So the big question here is how to move on page 2 and receive the other 25 results?
Yes, using the YouTube API does not incur any monetary cost for the entity calling the API. If you go over your quota an 403 Error will be returned by the API.
You can continue using the v2 API for comments and uploading video captions for now, and we'll be adding this functionality into the v3 API soon.
After creating your project, make sure the YouTube Data API is one of the services that your application is registered to use: Go to the API Console and select the project that you just registered. Visit the Enabled APIs page. In the list of APIs, make sure the status is ON for the YouTube Data API v3.
If you look at the results, you will see a "nextPageToken" item right after "pageInfo". This needs to be passed as the pageToken on your next request.
So if you make a call to this api:
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&order=relevance&q=site%3Ayoutube.com&topicId=%2Fm%2F02vx4&key={YOUR_API_KEY}
You would make a call to this one for the next page:
https://www.googleapis.com/youtube/v3/search?pageToken=CBkQAA&part=snippet&maxResults=25&order=relevance&q=site%3Ayoutube.com&topicId=%2Fm%2F02vx4&key={YOUR_API_KEY}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With