一尘不染

YouTube API权限403禁止错误

json

我正在遵循页面上的教程,但是在运行应用程序并尝试进行搜索时,我一直收到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."
}

阅读 450

收藏
2020-07-27

共1个答案

一尘不染

我已经通过创建浏览器密钥而不是android密钥解决了该问题。浏览器密钥不需要输入,以便显示“允许所有引用”

2020-07-27