Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
473 views
in Technique[技术] by (71.8m points)

page tokens use youtube api v3

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 ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...