页面令牌使用 youtube api v3 [英] page tokens use youtube api v3

查看:35
本文介绍了页面令牌使用 youtube api v3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 youtube api v3 并希望从查询中检索 50 多个结果.我已经读过 是 youtube 数据如果您使用页面令牌,api 分页是否一致?(v3 data 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:

因此您可以使用 pagetoken 对结果进行分页,并且不保证排序.但这究竟意味着什么:如果我查询奥巴马"观看次数最多的视频,我将获得 50 个第一个结果,然后是下一页的标记.

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. 想象一下,与此同时,浏览量发生了变化,使用pagetoken在页面中会列出什么?第一个查询对应的 50 个下一个结果?观看次数更改后最后一个视频项目之后"出现 50 个结果?

  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 ?

另外,在检索下一页时,我是否需要保留关键字字段或pagetoken是否足够?

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

推荐答案

即使不是 100% 的保证,pagetokens 也会给你一致的结果.

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

  1. 第一个查询对应的下一个结果将是 50 个.

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

您仍然需要保留关键字,但还要添加 pagetoken "https://developers.google.com/youtube/v3/docs/search/list#pageToken"

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

这篇关于页面令牌使用 youtube api v3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆