Youtube GData API:检索公共统计数据
YouTube 现在有一个显示视频统计信息按钮,可以显示视频的统计信息,例如一段时间内的观看次数和人口统计数据。
我查看了 YouTube api,但似乎没有找到检索此数据的方法。 我能想到的最接近的是 http://code.google.com/apis/ youtube/2.0/developers_guide_protocol_insight.html 但这是针对特定用户的。我希望获得公开的数据。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,正如 mad_scientist 所说,视频的公共见解不是通过 API
https://developers 提供的。 google.com/youtube/2.0/developers_guide_protocol_insight
“YouTube Insight 是一个分析和报告引擎,提供视频和频道的观看统计数据、受欢迎程度指标和人口统计信息。
如果如果您想获得喜欢和不喜欢的信息,并使用 c#,可以使用以下代码:
https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/UBbiyE3Cw5M
:)
Yes like mad_scientist said, the public insights for a video are not provided via the API
https://developers.google.com/youtube/2.0/developers_guide_protocol_insight
"YouTube Insight, an analytics and reporting engine, provides viewing statistics, popularity metrics and demographic information for videos and channels.
If you want to get likes and dislikes, and works with c#, you can use this code:
https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/UBbiyE3Cw5M
:)
不幸的是,视频的公共见解不是通过 API 提供的(我很确定他们不会添加 id,但他们可能有很小的机会在新的分析 API 中实现这一点)。如果您想查询自己视频的统计数据,可以使用 Insights APIInsights API。 从 xml/CDATA-Response 中筛选/解析见解
对于所有其他视频,您可以使用此链接http://www.youtube.com/insight_ajax?action_get_statistics_and_data=1&v=YOURVIDEOID
您应该使用能够解析损坏的 html 的解析器,例如用于 python 的 lxml 或 BeautifulSoup。
Unfortunately, the public insights for a video are not provided via the API (and I´m pretty sure they won´t add id, but maybe there is a small chance they´ll implement this in the new analytics API). If you want to query the statics for your own video, you could use the insights APIInsights API. For all other videos, you could screen-scrape/parse the insights out of the xml/CDATA-Response with this link
http://www.youtube.com/insight_ajax?action_get_statistics_and_data=1&v=YOURVIDEOID
You should use a parser which is capable of parsing broken html, like lxml or BeautifulSoup for python.
现在该服务可用,但现在他需要一个令牌来下载包含所有数据的文件insight ajax.xml。因为如果调用该服务
http://www.youtube.com/insight_ajax?action_get_statistics_and_data=1&v=MYVIDEOID
响应是
POST 调用具有以下格式:
Now this service is available, but now he need a token for download the file insight ajax.xml with all data. because if a call the service
http://www.youtube.com/insight_ajax?action_get_statistics_and_data=1&v=MYVIDEOID
the response is
the POST call has this fotmat :