如何从 YouTube API 中提取统计数据(每天或一段时间) [英] How does one pull statistics (either daily or over time) from the YouTube API

查看:31
本文介绍了如何从 YouTube API 中提取统计数据(每天或一段时间)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览 YouTube 的文档API 和他们在用户可以提取的事物列表中谈论统计信息,但我不知道如何执行以下操作.

I'm looking through the documentation for the YouTube API and they talk about statistics in their list of things that a user can pull, but I'm at a loss as to how to do the following.

我需要的具体数据是给定视频的每日观看次数.我很高兴将这个一个一个,或者作为一个完整的频道,或者在很长一段时间内(每个人都说它是在什么日期观看的)或者一天一天地,我每天都会运行一份报告查看当天的观看次数.但是,我在那里看到的唯一与此相关的参数是时间",当我给它一个今天"的参数时,它会返回给定视频的相同全局历史观看次数.无论如何,时间似乎只适用于实时视频(至少在它如何放置在文档中)所以,我完全被难住了.也许还有另一个文档,我只是没有找到它详细说明了这个确切的事情是如何做的?

The specific data I need is views per day for a given video. I am happy to pull this one-by-one, or as an entire channel, and either in large chunks of time (with each one saying what date it was viewed on) or day by day, where I'd run a report daily to see what the view count is for that day. However, the only param I see in there relating to this is "time" and when I give it a param of "today" it returns the same global all-time view count for a given video. In any event, time appears to apply only to live video (at least in how it's placed in the doc) so, I'm totally stumped. Maybe there's another doc that I just haven't found that details how one does this exact thing?

非常感谢所有帮助.

推荐答案

正如多项式所说,由于视频数据不受任何时间段的限制,如果您想要逐日统计,您应该真正每天拉取数据.

As polynomial said, since the video data isn't constrained by any time periods you should really pull the data every every day if you want day by day statistics.

但是,可以检索显示历史数据的 Youtube 视频统计数据(例如:http://sente.cc/misc/yt_video_stats.png) 此数据无法通过 API 获得,但可以轻松抓取.

However, it is possible to retrieve Youtube's video statistics which show historical data (ex: http://sente.cc/misc/yt_video_stats.png) This data isn't available through the API but it can be scraped without too much difficulty.

我在创建这个工具时没有遇到任何问题:http://sente.cc/scripts/yt_stats?tcquYYKurJ8

I didn't have any trouble creating this tool: http://sente.cc/scripts/yt_stats?tcquYYKurJ8

这篇关于如何从 YouTube API 中提取统计数据(每天或一段时间)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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