Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
466 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 Answer

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"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...