Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

page token youtube api v3

I want to do pagination with youtube api v3 (/videos?).

My request uri - https://www.googleapis.com/youtube/v3/videos?key={APP_KEY}&part=snippet&maxResults=50&chart=mostPopular&videoCategoryId=10

But in response I didn't see nextPageToken field.

If I send maxResult field which set in 49 (not 50 like first request). In response I can find nextPageToken field and count of items in search - 200. BUT, when I send new request for second part of search - in response I have only 15 items (must be 49) and haven't nextPageToken field, only previousPageToken.

Thank.

like image 557
Mykyta Bondarenko Avatar asked Aug 13 '14 08:08

Mykyta Bondarenko


1 Answers

Not an answer, but too much to put into a comment:

Using

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.list?part=snippet&chart=mostPopular&maxResults=20

to collect the nextPageToken, then doing a second and finally third time, the same is happening to me.

I then removed the maxResults param, thinking this might not be doing what I thought, and patiently worked through until I hit the same place as before (was using maxResults = 20)..and no more nextPageToken, even though the "totalResults": 200

Can only think:

  1. throttled to only give you 40 results (in which case it should indicate so)
  2. bug
like image 85
jmadsen Avatar answered Oct 28 '22 17:10

jmadsen