问题描述
我正在尝试使用Youtube API从特定频道中提取所有视频。我在Google Developers Console中设置了该项目并获得了API浏览器密钥。我启用了YouTube Data API v3,为了安全起见,我启用了YouTube Analytics API。
I am trying to use the Youtube API to pull in all the videos from a particular channel. I set up the project in Google Developers Console and got an API browser key. I enabled YouTube Data API v3 and for safe measure, I enabled YouTube Analytics API.
我不知道我收到此错误。任何人都可以帮助我。
I do not know what I am getting this error. Can anyone help me.
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
我正在使用的代码。它还没有做任何事情,只是尝试获取数据。
Code i'm using. It doesn't do anything yet, just try to fetch the data.
jQuery.getJSON('https://www.googleapis.com/youtube/v3/channels?part=UncleBens&id=UncleBens&key=AIzaSyDXD80S1mFHH2HSZFxLemkae-_Cl_nY5Xk', function(data){
console.log(data);
for(var i=0; i<data.data.items.length; i++) {
console.log(data.data.items[i].title); // title
console.log(data.data.items[i].description); // description
}
});
推荐答案
尝试将Referers设置为允许任何引用者 为您的项目(只是将字段留空)在中如果不是那样的话。
Try setting the "Referers" to "Any referer allowed" for your project (just leave the field empty) in the Google Developers Console if it is not already like that.
要执行此操作,请转到和开放式API& Auth / Credentials并单击编辑允许的引用以清空输入字段。
To do this, go to your Google Developers Console and open API & Auth / Credentials and click "Edit allowed referers" empty the input field.
这篇关于获取错误403:未配置访问权限。请使用Google Developers Console激活项目的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!