The new Google Developers console shows the following limit for YouTube Data API v3:
PER USER LIMIT 2 requests/second/user
Whereas the old Google Developers console shows:
2.0 units/second/user
(i.e. one is requests per second, the other is units per second which are quite different).
From - https://developers.google.com/youtube/v3/determine_quota_cost - the Search request appears to have a cost of 200 units, if the latter case above is correct would this mean we can only make one of these requests every 100 seconds?
This does seem to tie in more closely with what we are experiencing which is regular occurrences of the following 403 forbidden error after paging through only a few results from a YouTube search:
"error": {
"errors": [
{
"domain": "youtube.quota",
"reason": "quotaExceeded",
"message": "Quota Exceeded"
}
],
"code": 403,
"message": "Quota Exceeded"
}
}
The new console is right on this point. It's request/sec.
But you may have been hitting daily quota limits.
Remember that in many cases, you can substitute a less costly call, such as youtube.videos.list, in place of the youtube.search.list method. For example, to search most popular videos instead of the search.list call, you can use the videos.list call using the most popular chart.
you can contact youtube and apply for higher quota or pay for higher quota
Related
I'm doing a project using the YouTube Data API's Videos.rate endpoint.
And I got some problems: some particular minor channels (e.g. my client's channel) are sending error messages:
{
"error": {
"code": 403,
"message": "The owner of the video that you are trying to rate has disabled ratings for that video.",
"errors": [
{
"message": "The owner of the video that you are trying to rate has disabled ratings for that video.",
"domain": "youtube.video",
"reason": "videoRatingDisabled",
"location": "id",
"locationType": "parameter"
}
]
}
My boss wants to help them to solve that problem, but I don't know how to solve this at all. There is no problem with other major channels with 1M+ subscriptions.
I did my best to google this problem, yet couldn't find good results until now.
Before rating the video, check if the vide has enabled the rating.
I can't test right now, but, and idea could be:
Use getRating and check the items[].rating value - if the result is none or unspecified, then, you have to handle your logic for make them know that this video can't be rated - due its owner disabled rating their video.
The message you show in your question says that you cannot rate that video because the owner doesn't allow it. YouTube Data API wont bypass such restriction and there's not much that can be done further.
Ask your boss (or the owner of the video) about allow rating their video(s) and then verify if the video can be rated, if so, try again rate the video.
We previously posted this issue on GitHub regarding concerns over limits for subscribing to calendar changes for rooms: https://github.com/microsoftgraph/microsoft-graph-docs/issues/5709
The answer we got was that "No, there aren't any [limits] that you should be concerned about."
However, we have started to see this response when trying to register a webhook to subscribe to changes to a calendar of a room:
Invalid response - 429:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: 429; Reason: Resource 'MaxTotalRequests' has reached limit of '5000'. Please retry after '9/23/2019 2:20:44 PM']",
"innerError": {
"request-id": "43b79bf3-ddee-4bc3-b436-9caa7bff81ac",
"date": "2019-09-23T14:20:42"
}
}
}
We aren't making any large amount of subscriptions, and we only get this response when we are trying to register subscriptions to calendars of users or resources (i.e. not when making other requests to msgraph which are not related to subscriptions). There was a total of 210 subscription related requests made (either subscribing, extending a subscription, or deleting a subscritpion) between 10min before this error and 10min after. Any guidance?
This isn't really a subscription limit so much as an Exchange Online limit. The message is telling you that you've hit the throttling. Exchange's throttling is based on n requests per 10m window. Your code needs to recognize the HTTP 429 and handle it accordingly.
You find complete details in the Microsoft Graph throttling guidance.
I am connecting to Notebooks stored on SharePoint and getting "UnknownError" using the Graph API when trying to retrieve Pages.
I have no problem querying notebooks, sections or sectiongroups - that's all working, so no authentication problems or anything
Request:
https://graph.microsoft.com/v1.0/sites/{app id}/onenote/pages
Error below:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "65721acc-f0d9-40d6-bf80-aac1507a6c2f",
"date": "2018-01-02T17:34:21"
}
}
}
Graph explorer returns this after about 30 seconds, so I'm guessing it's timing out. There are about 10 notebooks in the site I'm connecting to, which each have several hundred pages
I do only need to return 1 page at a time in almost every case. I have tried adding a $filter= at the end, but get the same problem
I would strongly recommend to get pages for each section rather than getting all the pages that the user has access to.
Please refer to the bottom 2 recommendations in this article: https://blogs.msdn.microsoft.com/onenotedev/2017/07/21/a-few-performance-tips-for-using-the-onenote-api/
I try to insert a video in nodeJS to Youtube, and I got this error :
{ errors: [ { domain: 'youtube.quota',
reason: 'quotaExceeded',
message: 'The request cannot be completed because you have exceeded your quota.'
} ], code: 403, message: 'The request cannot be completed because
you have exceeded your quota.' }
EDIT : this is when I use Auth with an existing Token, I get token from https://developers.google.com/oauthplayground/ and use it in my code. I tried with different accounts, can't upload video but I can insert item in playlist for example.
Here is my code (nodeJS) :
var req = Youtube.videos.insert({
"resource": {
// Video title and description
"snippet": {
"title": "Test",
"description": "Test video upload via YouTube API"
},
"status": {
"privacyStatus": "private"
}
},
"part": "snippet,status,id",
"media": {
"body": fs.createReadStream('./test.mp4')
}
}, function (err, data) {
....
The video is 600 Ko... How can I see or update quotas ? I use OAuth auth, for example I can insert elements in my playlist with no problems, but I can't upload videos. Do I need something ?
Thanks.
Here is a reference of your error from the documentation.
About the quota:
The YouTube Data API uses a quota to ensure that developers use the
service as intended and do not create applications that unfairly
reduce service quality or limit access for others. All API requests,
including invalid requests, incur at least a one-point quota cost. You
can find the quota available to your application in the Developers
Console.
Projects that enable the YouTube Data API have a default quota
allocation of 1 million units per day, an amount sufficient for the
overwhelming majority of our API users. Default quota, which is
subject to change, helps us optimize quota allocations and scale our
infrastructure in a way that is more meaningful to our API users. You
can see your quota usage on the Usage tab for the API in the
Google Developer's Console.
Note: If you reach the quota limit, you can request additional quota on the Quotas tab in the Developer's Console.
I have a public calendar on the site. I need to display upcoming events on the front page.
After spending the whole day on this I am about to give up. Google is disabling older API there is no documentation or anything. I am parsing the RSS feed:
http://www.google.com/calendar/feeds/.../public/basic?futureevents=true
And grabbing feed/entry/update and feed/entry/title from XML. I read somewhere that futureevents will display upcoming events. However I get the list of older events.
Okay, then I tried to use API V3 https://developers.google.com/google-apps/calendar/v3/reference/events/list
Here is the responce I get:
{
"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."
}
}
I jumped through more hoops and installed their ruby code sample as I need this for Rails site.
It sort of worked but it requires user to confirm access to their own calendar. I don't need that. Plus it seems that authentication only valid for a day.
The said calendar is public. It is being displayed in iframe on the site with xml and ical feed. All I need is to parse upcoming events to show them on front page.
What is the way to do it without authorization and other ridiculous stuff?
//This works for me! js:
var request = gapi.client.calendar.events.list({
'calendarId': 'xxx',
'timeMin': (new Date()).toISOString(),
'showDeleted': false,
'singleEvents': true,
'maxResults': 1,
'orderBy': 'startTime'
});
request.execute(function(resp) {}
Use this wizard to create a new API project: https://console.developers.google.com/start/api?id=calendar Then click on "create new key" (choose server key). Then do a request to https://www.googleapis.com/calendar/v3/calendars//events?key={YOUR_API_KEY} replacing the email and api key with your values.