未经身份验证的使用的每日限制超过了YouTube数据API

时间:2017-04-10 21:41:35

标签: java android youtube-api

这是获取数据的代码:

YouTube youtube = new YouTube.Builder(new NetHttpTransport(), new JacksonFactory(), new HttpRequestInitializer() {
    public void initialize(HttpRequest request) throws IOException {}
}).setApplicationName("youtube-channel-fetcher").build();
String artist = "";
try{
    artist = youtube.videos().list("snippet").setId(ytID).setKey(Utils.getYouTubeKey()).setFields("items(snippet/channelTitle)").execute().getItems().get(0).getSnippet().getChannelTitle();
} catch (ArrayIndexOutOfBoundsException ignored){}

作为回应,我收到以下错误:

"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"reason" : "dailyLimitExceededUnreg",
"extendedHelp" : "https://code.google.com/apis/console"
} ],
"message" : "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."

1 个答案:

答案 0 :(得分:0)

当我使用这个应用程序时,它对我做了同样的事情,直到我注册。一旦我这样做,错误就消失了。我认为应用程序中的密钥不起作用。

project read me

register your app