Google 照片 API 限制

Google Photos API limits

我正在尝试使用 Google Photos API 增量上传一个非常大的本地照片库。

一切正常,但在上传大约 1.2GB 后,请求开始被拒绝并显示以下消息:

Insufficient tokens for quota 'photoslibrary.googleapis.com/total_upload_bytes' and limit 'UploadBytesPerDay' of service 'photoslibrary.googleapis.com' for consumer 'project_number:XXXXXXXXXXXX'

我在 Google 云控制台的 IAM & admin 部分检查了我的照片库 API 配额,我只使用了每日 10,000 个请求中的 80 个。

我在 Google Photos/Drive 中有足够的可用存储空间 space 并且尝试上传的文件很小 (~5MB)。

我在 API 文档的 limits and quotes 部分没有看到任何内容。有谁知道什么可能会阻止我的请求?

我看到了完全相同的东西,但在 Google 上找不到任何内容甚至讨论任何类型的上传字节配额。

FWIW,我为此提交了一个错误:

https://issuetracker.google.com/issues/115932469

Google API 文档有时真的很混乱,甚至有些地方已经过时了。但他们确实提到了 quota limits in here:

The quota limit for requests to the Library API is 10,000 requests per project per day. Requests to access media bytes (like loading a photo or video) are not counted against the limit.

Exceeding quota limits

If the quota of requests to the Library API is exceeded, the API returns an error code 429 and a message that the project has exceeded the quota. For more information, see the Terms of Service.

Cryptonome,该配额与此线程无关(显然)。错误消息是关于上传字节,而不是 "requests per day"。

Google 终于通过 bugtracker #115932469 解决了这个问题。照片 API 现在可以正常工作了。