Obtaining Credentials¶
In order to use this library you will need an API key or OAuth credentials. This guide walks through how to obtain these credentials.
Prerequisites¶
To access the Google API Console, you will need a Google Account.
Go to console.developers.google.com and create a new project. Call it whatever you want, optionally set an organisation and click Create.
Find the “APIs” panel and click Go to APIs overview.
Find and click the ENABLE APIS AND SERVICES button. Search for “youtube data api v3” and press enter. One result should be called YouTube Data API v3, click on it and then click the ENABLE button. You will be taken back to the “APIs and services” page.
Obtaining An API Key¶
Navigate to the Credentials page.
Find and click the CREATE CREDENTIALS button and select API key.
You have now created an API key. See the examples for using an API Key.
Obtaining OAuth Credentials¶
OAuth Consent Screen¶
First, you will need to set up an OAuth consent screen:
Navigate to OAuth consent screen.
Select External and click CREATE.
Call the app name anything and select your email. You will also need to provide an email address under “Developer contact information”.
Click SAVE AND CONTINUE.
For scopes, click ADD OR REMOVE SCOPES.
Find and search for “https://www.googleapis.com/auth/youtube”.
Check the box for “YouTube Data API v3” and then click UPDATE.
Click SAVE AND CONTINUE.
For test users, click ADD USERS and add your gmail address.
Click SAVE AND CONTINUE and then BACK TO DASHBOARD
You have now set up an OAuth consent screen. You can now go ahead and create OAuth2 credentials.
Creating Credentials¶
Navigate to the Credentials page.
Find and click the CREATE CREDENTIALS button and select OAuth client ID.
Set “Desktop app” as the application type and click CREATE.
You have now created OAuth2 credentials. See the examples for using an OAuth credentials.