无法访问 Youtube 数据 api v3 [英] Cant access Youtube data api v3

查看:43
本文介绍了无法访问 Youtube 数据 api v3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试访问数据 api,以便根据关键字搜索视频,

I am trying to access data api in order to search for videos based on keyword,,

    SearchListResponse list=search.execute();

但我收到此异常:

    403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project.",
"reason": "accessNotConfigured"
}
],
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}

但是我已经在 api 控制台中激活了 yputube 数据 api,并且我已经生成了一个我正在使用的 api 密钥

but i have activated the yputube data api in api console, as well as i have generated an api key which i am using in

    search.setKey("MY_KEY");

注意:我已经在控制台中为我的项目启用了 youtube 数据 api,并且我使用公共 api 密钥来访问它

Note: i have enabled youtube data api in console for my project, and m using public api key to access this

推荐答案

我们必须使用浏览器 api 密钥",因为 execute() 方法是 java 客户端 api 的一部分,而不是 android 客户端 api

We have to use "browser api key" because execute() method is part of java client api and not android client api

这篇关于无法访问 Youtube 数据 api v3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆