我从 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."
}
My 是正确的(根据youtube 搜索列表 https://developers.google.com/youtube/v3/docs/search/list)
我在某处读到我应该发送浏览器密钥而不是 Android 密钥,但它不起作用。
这个错误对我来说似乎很清楚:
您的 URL 很好,但您刚刚超出了 Youtube API 的配额。
您的 API 密钥配置了按 IP 或按引用者限制,并且请求与这些限制不匹配。
我相信这仍然是正确的:
YouTube 数据 API 版本 3 在 Google API 控制台中列出了具体的配额数字,您可以在其中注册 API 密钥。您可以使用 30,000 单位/秒/用户和每天 50,000,000 单位。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)