Go to https://console.cloud.google.com/apis/library
Scroll down to the “YouTube Data API v3” box and click it:
On the next page, click the “Enable” button:
If you don’t see an “Enable” button, then it means you already have the YouTube API enabled for your Google account. Instead, you will see a “Manage” button. Click that button and then go to “Credentials” to copy your pre-existing API key.
Assuming you didn’t already have the API enabled and you clicked “Enable”, you should see a new screen allowing you to create a project. Click “Create Project”:
Now, you should be able to give the project a name. We suggest “YouTube Widget” so that you can remember why you created it in the future. Click “Create” after naming the project.
You’ll now see that your new project is active and selected for YouTube API enabling:
Next, you must create the credentials for your new key, so click “Create Credentials”:
On the next page, you’ll set the YouTube Data API credentials for “Web server” based calls and “Public data”. Then, click the “What credentials do I need?” button:
Next, you’ll see your API key, but before using it, you should add some restrictions to it, so click the “Restrict Key” link:
One restriction you might want to turn on is to make sure the key is only used to make YouTube Data v3 API calls:
Click Save when finished there.
If you see this screen after saving, click cancel since you’re done setting credentials:
Now, you can begin to use your new API. Just click the copy icon so you can move on to paste the key in Customize > Tokens: