The request cannot be completed because you have exceeded your quota

33,428

Solution 1

Youtube does not give you 10,000 Queries a day, they give you 10,000 units a day; a query can be multiple units, depending on what you're doing:

A simple read operation that only retrieves the ID of each returned resource has a cost of approximately 1 unit.

A write operation has a cost of approximately 50 units.

A video upload has a cost of approximately 1600 units.

If your 89 queries contain video uploads or write operations, then that would explain your issue

More Information: https://developers.google.com/youtube/v3/getting-started#quota

Solution 2

Corrupt Google Developer Project - create a new one

I am disappointed in Google that this was the case for me.

I had the same issue, no usage at all but "quota exceeded" response. My solution was to create a new project. I guess it's because something changed internally over time and wasn't applied correctly to (at least my) already existing project...

I had stopped using AWS for several reasons and thought Google Cloud would be a refreshing experience but this shows me Google treats existing projects as badly as new products that it kills off. Strike one against Google.

https://github.com/googleapis/google-api-nodejs-client/issues/2263#issuecomment-741892605

Share:
33,428

Related videos on Youtube

Geo
Author by

Geo

Updated on May 19, 2021

Comments

  • Geo
    Geo over 1 year

    I tried to use the javascript MediaUploader.js to upload youtube video to my own account, for some reason, I got this error in onError function:

    "errors": [
       {
        "domain": "youtube.quota",
        "reason": "quotaExceeded",
        "message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e."
       }
      ],
      "code": 403,
      "message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e."
    

    I only tested a few times today, but got this strange error.

    var signinCallback = function (tokens, file){
    console.log("signinCallback tokens: ",tokens);
    if(tokens.accessToken) { //tokens.access_token
      console.log("signinCallback tokens.accessToken: ",tokens.accessToken);
      var metadata = {
        id: "101",
        snippet: {
          "title": "Test video upload",
          "description":"Description of uploaded video",
          "categoryId": "22",//22
          "tags": ["test tag1", "test tag2"],
        },
        status: {
            "privacyStatus": "private",
            "embeddable": true,
            "license": "youtube"
        }
        };
      console.log("signinCallback Object.keys(metadata).join(','): ",Object.keys(metadata).join(','));
      var options = {
        url: 'https://www.googleapis.com/upload/youtube/v3/videos?part=snippet%2Cstatus&key=<my api key>',
        file: file,
        token: tokens.accessToken,
        metadata: metadata,
        contentType: 'application/octet-stream',//"video/*",
        params: {
          part: Object.keys(metadata).join(',')
        },
        onError: function(data) {
          var message = data;
          // Assuming the error is raised by the YouTube API, data will be
          // a JSON string with error.message set. That may not be the
          // only time onError will be raised, though.
          try {
            console.log("signinCallback onError data: ",data);
            if(data!="Not Found"){
                var errorResponse = JSON.parse(data);
                message = errorResponse.error.message;
                console.log("signinCallback onError message: ",message);
                console.log("signinCallback onError errorResponse: ",errorResponse);
            }else{
            }
          } finally {
            console.log("signinCallback error.... ");
          }
        }.bind(this),
        onProgress: function(data) {
          var currentTime = Date.now();
          var bytesUploaded = data.loaded;
          var totalBytes = data.total;
          // The times are in millis, so we need to divide by 1000 to get seconds.
          var bytesPerSecond = bytesUploaded / ((currentTime - this.uploadStartTime) / 1000);
          var estimatedSecondsRemaining = (totalBytes - bytesUploaded) / bytesPerSecond;
          var percentageComplete = (bytesUploaded * 100) / totalBytes;
          console.log("signinCallback onProgress bytesUploaded, totalBytes: ",bytesUploaded, totalBytes);
          console.log("signinCallback onProgress percentageComplete: ",percentageComplete);
        }.bind(this),
        onComplete: function(data) {
          console.log("signinCallback onComplete data: ",data);
          var uploadResponse = JSON.parse(data);
          this.videoId = uploadResponse.id;
          //this.pollForVideoStatus();
        }.bind(this)
      }
      MediaUpload.videoUploader(options);
    }
    

    };

    I checked the developer console of my quota, my quota limit is so big, there is no way I exceeded my quota, ex, I have total of 89 queries today, and my quota limit is 10,000 queries/day.

    Expected: upload my video to my youtube account successfully. Actual results: quotaExceeded

  • supersan
    supersan over 1 year
    Same thing happened to me. They just reset my quota to 0 for all API request. It took a week to get the last project verified and now I have to do this stupidity all over again :/

Related