Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

page tokens use youtube api v3

Tags:

youtube-api

I'm using youtube api v3 and want to retrieve more than 50 results from a query. I already read Is youtube data api paging consistent if you use pagetokens? (v3 data api) that was very similar to my question, but it didn't give all I wanted to know.

Anyway, here is what I want to know:

so you can use pagetoken to page through the results and the ordering is not guaranteed. But what does that exactly mean: if i make a query for the most viewed videos for "obama", I'll get the 50 first results and then a token to the next page.

  1. Imagine the view count changes in the meanwhile, what will be listed in the page using pagetoken? The 50 next results corresponding to the first query? 50 results that comes "after" the last video item after the view count changes ?

  2. Also, when retrieving the next page, do i need to keep the keyword field or is the pagetoken enough ?

like image 919
Tilly Avatar asked Feb 12 '13 16:02

Tilly


1 Answers

Even though it's not a 100% guarantee, pagetokens will give you consistent results.

  1. It will be 50 next results corresponding to first query.

  2. You still need to keep the keywords but also add the pagetoken "https://developers.google.com/youtube/v3/docs/search/list#pageToken"

like image 103
Ibrahim Ulukaya Avatar answered Nov 18 '22 05:11

Ibrahim Ulukaya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!