Vincent Decaux
Vincent Decaux

Reputation: 10714

Youtube API quota exceeded with 1 video

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.

Upvotes: 8

Views: 7708

Answers (1)

MαπμQμαπkγVπ.0
MαπμQμαπkγVπ.0

Reputation: 6729

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.

Upvotes: -1

Related Questions