Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube API v3 shows "Access Not Configured"

I created a Google application in the developers console, turned on "YouTube Data API v3", generated the server API key, and authorized my home and work IPs.

My website lists all videos from a Youtube channel, using the V3 API. It uses the official PHP library, passing it the server API key.

It all worked well yesterday from home, and today morning from work. Then, it suddently stoped working at 11am (GMT+1), with no action from my part, with this error:

[Google_Service_Exception] Error calling GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=xxxxxxxxxx&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: (403) Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your APIkey and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.

Note: i used less than 10 requests, out of the 50 millions allowed by day, i have a static public IP address, this part of the code was untouched.

What can i look for in order to fix that, please? I really don't know where to head for from now... Thank you.

like image 375
Ninj Avatar asked Dec 15 '14 12:12

Ninj


People also ask

How do I enable YouTube API v3?

In Google API dashboard, click Library on the left menu. Click YouTube Data API v3, then click the Enable button to enable the API service. In Google API dashboard, click "Credentials" on the left menu, then click the button Create credentials, select API key from the drop down list.

What is the limit of YouTube API?

Quota usage Projects that enable the YouTube Data API have a default quota allocation of 10,000 units per day, an amount sufficient for the overwhelming majority of our API users.

Can you still use YouTube API v2?

You can continue using the v2 API for comments and uploading video captions for now, and we'll be adding this functionality into the v3 API soon.


1 Answers

Oooook...

Do all you have to with the API activations before you generate any keys!

Unactivating or reactivating API (like "Youtube Data") silently destroys your key validity. At least for the server one.

So the solution is, when you get the same error as me:

  • destroy your server key (delete it completely, do not only regenerate)
  • deactivate then reactivate all APIs you need
  • create a new server key
  • thank Google for the so clear error messages (optional)
like image 52
Ninj Avatar answered Oct 22 '22 06:10

Ninj