Youtube data api return dailyLimitExceededUnreg reach

拟墨画扇 提交于 2020-01-24 17:25:32

问题


We are using the YouTube Data API to get the YouTube channel information, it was working before two days now it is giving me below error:

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

Is there any new update on YouTube Data API? Can anyone help me to resolve this issue?


回答1:


In order to access any Google API you need to identify your application. This rule has not been enforced on all Google APIs. If you say your request has worked in the past I suspect that they have begun to enforce this now with the YouTube API.

The problem is that you have either not authenticate your application using Oauth2 or you are not sending an API key along with this request.

  1. You need a Google Account to access the Google Developers Console, request an API key, and register your application.
  2. Create a project in the Google Developers Console and obtain authorization credentials so your application can submit API requests.
  3. After creating your project, make sure the YouTube Data API is one of the services that your application is registered to use:
    a. Go to the Developers Console and select the project that you just registered. b. Open the API Library in the Google Developers Console. If prompted, select a project or create a new one. In the list of APIs, make sure the status is ON for the YouTube Data API v3.
  4. If your application will use any API methods that require user authorization, read the authentication guide to learn how to implement OAuth 2.0 authorization.

see Getting started




回答2:


I was getting the same error. The mistake I was making is not setting the API Key value while requesting. Please set the API Key attribute.

If you are using youtube data v3 api use following code snippet.

playlistItemsListByPlaylistIdRequest.setKey(YOUR_API_KEY_VALUE);

If you are using the Html request, then use following format :

https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=8&playlistId={PLAYLIST_ID}&key={YOUR_API_KEY}



来源:https://stackoverflow.com/questions/43096450/youtube-data-api-return-dailylimitexceededunreg-reach

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!