YouTube 数据 API:无法完成请求,因为您已超出配额.我是否使用 YouTube 数据 API 制作应用程序? [英] YouTube Data API: The request cannot be completed because you have exceeded your quota. Сan I make an app using the YouTube Data API or not?

查看:55
本文介绍了YouTube 数据 API:无法完成请求,因为您已超出配额.我是否使用 YouTube 数据 API 制作应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:

<块引用>

无法完成请求,因为您已超出

鉴于我在 localhost 上工作了大约 3 个小时,我无法理解我如何能够每天发出 10,000 个请求,这可能吗?

解决方案

确实 Google 的开发者控制台显示了类似 Queries per day 的文本,但这非常具有误导性(并且很可能被报告为 WebGoogle 的 UI 错误).

您必须承认,YouTube 数据 API 的配额系统不是计算您在一天内进行的端点调用次数,但计算的是与您的每个端点调用相对应的配额单位的累计数量.

例如,如果您为每日使用分配了 10000 个单位的配额,则只需调用 100 次 Search.list API 端点.

许多 API 用户发现分配的默认配额数量 - 10000 个单位 - 非常具有限制性 - 即使在其应用的开发阶段也是如此.为了解决这个问题,我建议做两件事:

  • 开发您的应用,以便缓存从其调用的端点接收的 API 响应;这样,在应用的开发阶段(之后,即使在生产期间,但以不同的逻辑运行),对端点的重复调用不会产生实际的 API 请求,但会从应用的本地缓存中获得服务.

  • 使用 Google 的官方表格申请配额延期;请注意,根据本论坛用户的经验,Google 通常不会很快给出答复.

I got this error:

The request cannot be completed because you have exceeded your quota.

and I can not understand YouTube limits the number of requests? That is, I cannot create my project by taking API from my channel? If this is so, what is the point of YouTube Data API, if at the development stage I was already limited, what will happen when users come in, then my project will fall within 5 minutes?

and I cannot understand how I was able to make 10,000 requests per day, given that I worked on the localhost for about 3 hours, is this possible?

解决方案

Indeed the Google's Developers Console shows text like Queries per day, but that's very much misleading (and may well be reported as an Web UI bug to Google).

You have to acknowledge that YouTube Data API's quota system is not accounting for the number of endpoints calls you made during a day long, but it accounts for the cumulated number of quota units corresponding to each of your endpoint calls.

For example, if you have 10000 units of quota allocated for daily usage, you may very easily exceed this upper bound after only 100 calls to the Search.list API endpoint.

Many API users find the default amount of quota allocated -- 10000 units -- to be quite constraining -- that even during the development stage of their apps. For tackling this issue, I recommend two things:

  • Develop your app such that to cache API responses it received from the endpoints it calls; this way, during the development stage of your app (afterwards, even during production, but albeit functioning with a different logic), repeated calls to endpoints would not result in actual API requests, but would get served from the app's local cache.

  • Apply for a quota extension, using Google's official form; be aware that, as per the experience of users of this forum, Google's answer, usually, does not arrive shortly.

这篇关于YouTube 数据 API:无法完成请求,因为您已超出配额.我是否使用 YouTube 数据 API 制作应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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