如何计算我的 YouTube API 使用量? [英] How can I calculate my YouTube API usage?

查看:24
本文介绍了如何计算我的 YouTube API 使用量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为客户构建一个非常大的应用程序,该应用程序将聚合来自各种来源的提要.我的客户估计大约 900 名可关注用户将在这个系统中开始,随着时间的推移会增加更多.他想每 15 分钟更新一次提要数据,因此我们需要每秒更新一个用户提要,假设有 900 个提要和 15 分钟的 TTL.由于请求需要几秒钟才能完成,因此我们需要在几个线程之间进行负载平衡以异步处理队列.

I'm building a pretty large app for a client that is going to aggregate feeds from various sources. My client estimates around 900 follow-able users will be in this system to start out, with more being added over time. He wants to update the feed data every 15 minutes, so we would need to update one user feed per second, assuming 900 feeds and a 15 minute TTL. As the requests take a few seconds to complete, we would then need to load balance across a few threads to tackle the queue asynchronously.

我是否应该担心配额错误或遇到任何类型的限制?如果是这样,我们有哪些选择?

Should I be worried about quota errors or hitting any kind of limitations? If so, what are our options?

我已经阅读了他们的帮助页面和文档,但内容非常模糊;我需要具体的数字.对其 API 进行负载测试以找出限制是不可行的.

I've already read their help pages and documentation, but it's very vague; I need concrete numbers. It's not feasible to load test their API to figure out the limitation.

推荐答案

YouTube 数据 API 的第 3 版在您注册 API 密钥的 Google API 控制台中列出了具体的配额编号.您每天可以使用 10,000 个单位.在 2016 年 4 月 20 日之前启用 YouTube Data API 的项目的默认配额为每天 50,000,000.

Version 3 of the YouTube Data API has concrete quota numbers listed in the Google API Console where you register for your API Key. You can use 10,000 units per day. Projects that had enabled the YouTube Data API before April 20, 2016, have a default quota of 50,000,000 per day.

您可以在此处阅读有关什么是单位的信息:https://developers.google.com/youtube/v3/getting-started#配额

You can read about what a unit is here: https://developers.google.com/youtube/v3/getting-started#quota

  • 仅检索每个返回资源的 ID 的简单读取操作的成本约为 1 个单位.
  • 一次写入操作的成本约为 50 个单位.
  • 一次视频上传的成本约为 1600 个单元.

如果您达到限制,Google 将停止返回结果,直到您的配额被重置.您每天可以申请超过 1,000,000 个请求,但您必须为这些额外请求付费.

If you hit the limits, Google will stop returning results until your quota is reset. You can apply for more than 1,000,000 requests per day, but you will have to pay for those extra requests.

这篇关于如何计算我的 YouTube API 使用量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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