Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube Quota Exceeded Exception when it's actually not

We're using the youtube data api v3 and have been for quite some time without any problems. Recently, we've been getting this 403 exception:

The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.

In the google developer's console, it says that we are still under the quota (currently it states "units/day 163,817 of 50,000,000").

Am I missing something about how quotas work?

like image 218
Saiichi Hashimoto Avatar asked Mar 03 '16 19:03

Saiichi Hashimoto


2 Answers

You can create more API keys and randomly use them all. Its good way as Im also using it without any issue and never got quota exceeded issue. You need to create separate project for each API. in PHP you can use it like

$api = array("API key # 1", "API key # 2" ,"API key # 3");
$rand_keys = array_rand($api, 1);
$usage = $api[$rand_keys];

For each request new key will be used. Better way to avoid any downtime.

like image 143
Mark Fulghum Avatar answered Nov 17 '22 00:11

Mark Fulghum


Quota have been reduced yesterday (2016-04-21) from 50 Million units to just 1 Million ...

like image 23
CSharpShooter Avatar answered Nov 17 '22 00:11

CSharpShooter