youtube api 上的“403 - usageLimits”

Ste*_*mon 5 youtube api android

我从我的 android 应用程序到 YouTube API 的调用中得到了这个 JSON 响应:

"error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "ipRefererBlocked",
    "message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
    "extendedHelp": "https://console.developers.google.com"
   }
  ],
  "code": 403,
  "message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
}
Run Code Online (Sandbox Code Playgroud)

我的网址是正确的(根据 youTube搜索列表

我在某处读到我应该发送浏览器密钥而不是 android 密钥,但它不起作用。

shk*_*der 3

这个错误对我来说似乎很清楚:

您的 URL 很好,但您刚刚超出了 Youtube API 的配额。

您的 API 密钥配置了按 IP 或按引用者限制,并且请求与这些限制不匹配。

我相信这仍然是正确的:

YouTube 数据 API 版本 3 在 Google API 控制台中列出了具体的配额数字,您可以在其中注册 API 密钥。您可以使用 30,000 单位/秒/用户和每天 50,000,000 单位。