访问未配置。请使用谷歌开发者控制台来激活API为您的项目YouTube的搜索列表 [英] Access Not Configured. Please use Google Developers Console to activate the API for your project for youtube search list
本文介绍了访问未配置。请使用谷歌开发者控制台来激活API为您的项目YouTube的搜索列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我实现了从
但未来这个错误
访问未配置。请使用谷歌开发者控制台来激活API为您的项目
Access Not Configured. Please use Google Developers Console to activate the API for your project
code: -
youtube = new YouTube.Builder(transport,jsonFactory, new HttpRequestInitializer()
{
@Override
public void initialize(HttpRequest request) throws IOException {
}
}).setApplicationName("youtube-cmdline-search-sample").build();
String queryTerm = getInputQuery();
// Define the API request for retrieving search results.
YouTube.Search.List search = youtube.search().list("id,snippet");
// Set your developer key from the Google Developers Console for
String apiKey = ""; //i have server key and browser key
search.setKey(apiKey);
search.setQ(queryTerm);
search.setType("video");
search.setFields("items(id/kind,id/videoId,snippet/title,snippet/thumbnails/default/url)");
search.setMaxResults(NUMBER_OF_VIDEOS_RETURNED);
推荐答案
解决方案: -
我从这里老开发人员控制台网站创建的项目。
I created project from here old developer console site.
我以前从老开发人员控制台的网站浏览器的关键。
I used browser key from Old developer console site.
这篇关于访问未配置。请使用谷歌开发者控制台来激活API为您的项目YouTube的搜索列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文