Youtube API权限403禁止错误

时间:2015-02-18 18:21:58

标签: android json youtube youtube-api

我正在关注this页面上的教程,但在运行应用程序并尝试搜索时,我一直收到403 Forbidden错误。

我在https://console.developers.google.com/页面启用了Youtube Data API v3,并创建了一个Android API密钥。

有什么建议吗?谢谢。

Could not search: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"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.",
"reason" : "ipRefererBlocked",
"extendedHelp" : "https://console.developers.google.com"
} ],
"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."
}

4 个答案:

答案 0 :(得分:36)

我通过创建浏览器密钥而不是Android密钥解决了这个问题。浏览器密钥不需要输入,因此它会说“所有提到的允许”

答案 1 :(得分:2)

将此用于iOS应用程序并收到相同的错误,因此我删除了包标识符并且有效

答案 2 :(得分:1)

我通过创建服务器密钥而不是iOS密钥来解决问题

答案 3 :(得分:1)

我遇到了同样的问题,经过大量的浪费时间,我的托管服务发现API请求是由与我的网站相关联的IP地址生成的。

相关问题