为什么我 运行 我在 youtube api 的每日配额在一个小时内?

Why do I run my daily quota at youtube api in an hour?

我在我的网站上使用 youtube API v3 提供歌词翻译视频。我有 250.000 个配额,但我 运行 在大约一个小时内就用完了,尽管我没有发送足够多的请求来超过它。

它说我最后一天只发送了 86k 个请求,但 89% 的请求都返回了 403 错误。

但是这里显示我用完了所有250.000的限制额度

我使用 HTTP 源授权,因此只有我的站点可以使用此 api 密钥。我记录了我发送的请求,以检查我是否错误地将它们加倍。

也许我理解错了?

Youtube 对 quotas 有这样的说法:

Google calculates your quota usage by assigning a cost to each request, but the cost is not the same for each request. Two primary factors influence a request's quota cost:

Different types of operations have different quota costs.

  • A simple read operation that only retrieves the ID of each returned resource has a cost of approximately 1 unit.
  • A write operation has a cost of approximately 50 units.
  • A video upload has a cost of approximately 1600 units.

Read and write operations use different amounts of quota depending on the number of resource parts that each request retrieves. Note that insert and update operations write data and also return a resource. So, for example, inserting a playlist has a quota cost of 50 units for the write operation plus the cost of the returned playlist resource.

As discussed in the following section, each API resource is divided into parts. For example, a playlist resource has two parts, snippet and status, while a channel resource has six parts and a video resource has 10. Each part contains a group of related properties, and the groups are designed so that your application only needs to retrieve the types of data that it actually uses.

An API request that returns resource data must specify the resource parts that the request retrieves. Each part then adds approximately 2 units to the request's quota cost. As such, a videos.list request that only retrieves the snippet part for each video might have a cost of 3 units. However, a videos.list request that retrieves all of the parts for each resource might have a cost of around 21 quota units.

要点是你的配额是一个积分池,不同类型的请求需要不同数量的积分。