YouTube 搜索 API 返回的结果与 YouTube 上的手动搜索不同 [英] YouTube search API returns different results to a manual search on YouTube

查看:42
本文介绍了YouTube 搜索 API 返回的结果与 YouTube 上的手动搜索不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 YouTube v3 API 来搜索视频.在某些情况下,从 API 返回的结果与我在 YouTube 网站上手动使用完全相同的查询字符串时得到的结果完全不同.请任何人解释为什么会发生这种情况

I am using the YouTube v3 API to search for videos. In some cases, the results returned from the API are completely different to the results I get when using exactly the same query string manually on the YouTube site. Please can anybody explain why this would happen

例如搜索Zombie Hunting Stiletto Style Spring Assisted Open Pocket Knife"

For example search for "Zombie Hunting Stiletto Style Spring Assisted Open Pocket Knife"

通过 API,前 10 个结果是:

Via the API the first 10 results are :

Iulyke14P7c
vCjOCf20Uv8
gKNBLil4_uk
0eKNL-dQR_Q
PL0sC12k5-U
GGjHrmw-4Kc
ylLsWVcLh-w
QEn_ysLPdUI
Ds7XwIBgI6Q
NXuxKtcsSik

手动在 YouTube 前端,前 10 个结果是:

Manually on YouTube front end, the first 10 results are :

LstcGDEAsWw
Iulyke14P7c
dXPjpUvJkaA
_wYuBvvS63w
SVdwocDkZL0
HwNJgu8UCtM
vCjOCf20Uv8
Ok3jlNBr1bc
mRq4eapV1wk
1T93YAMQ5V0

只有两个是相同的(但位置不同),其余都不同

Only 2 are the same (but at different position) the rest are all different

谢谢

推荐答案

我用你的例子试试.

这取决于您在 API 中选择的选项.有很多选择,例如:

Well it depends with the options you chose in the API. There is so much options like :

location
order
publishedAfter
publishedBefore
type 
...

Yopu 可以在 https://developers.google.com 上找到所有选项/youtube/v3/docs/search/list

Youtube 搜索"有他的选项,您需要在 API 中选择您的选项.
了解YouTube的搜索"并不是那么简单.我的猜测是,他们使用了很多关于您最近看过的视频、您所在的国家/地区等的选项.

"the Youtube search" has his options, and you need to chose your options in the API.
Understand the "search" of YouTube is not so simple. My guess, they use lots of options regarding your last videos that you seen, your country etc etc.

但基本上,resultat 与您想要的相对应.没有什么奇怪的事情,您只需要根据自己的应用需求选择合适的选项即可.

But basically, the resultat is corresponding with what you want. There is no weird things, you just need to take the good options regarding what you want in your app.

这篇关于YouTube 搜索 API 返回的结果与 YouTube 上的手动搜索不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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