【发布时间】:2020-02-03 02:45:55
【问题描述】:
我正在开发具有此功能的新应用程序:
- 用户可以从应用中搜索 youtube 视频 ..
我尝试使用 youtube api ..我在 google 控制台中创建了项目,生成了带有 android 应用程序限制的 api_key(编写了应用程序包和 SHA-1 证书指纹)。
我使用了这个链接:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=blabla&type=video&key=[api_key]
我来自:https://developers.google.com/youtube/v3/docs/search/list
但不幸的是,我得到了这个回复,我知道为什么
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "The request did not specify any Android package name or signing-certificate fingerprint. Please ensure that the client is sending them or use the API Console to update your key restrictions.",
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=953519755004"
}
],
"code": 403,
"message": "The request did not specify any Android package name or signing-certificate fingerprint. Please ensure that the client is sending them or use the API Console to update your key restrictions."
}
}
我希望任何人都可以拯救我的一天
【问题讨论】:
-
检查您是否从link 启用了 youtube 数据 API。另外,请检查您是否拥有有效的 API 密钥。
-
我启用了 youtube 数据 api 并且我有有效的 api 密钥,因为我将它用于其他用途以确保它是否有效@AmritBhattacharjee
标签: android youtube-data-api android-youtube-api api-key google-console-developer