How to Create YouTube API Credentials

Stage 1 – Create a Google OAuth 2.0 Web Application Client

Go to https://console.developers.google.com/project and log in using your Google Credentials.

Sign In

Click the ‘Create Project‘ button from the dashboard page.

Create New Project

A form new project screen is displayed. Enter a name for your project in the Project name field and find your Location to save your project. Click on 'Create'. Your project is being created and will take a few moments.

New Project

Your project library page is displayed. Click the ‘Enable APIs and Services’ button.

Enable API and Services

API library page is displayed.

API Library

On the below youtube section, select and click ‘Youtube Data API v3’.

YouTube Data API

The YouTube Data API v3 overview screen is displayed. Click on ‘ENABLE‘. The API is enabled but cannot be used until you create credentials.

Enable Youtube Data API v3

Click on the ‘Create Credentials‘ button.

Create Credentials

Then, you will be directed to API & Services dashboard. Select the OAuth Consent Screen menu on the left side of the page. Select External and click the 'create' button.

User Type

In the first step, you will be requested to complete your App Information, Enter your app name and user support email. Then, fill in the developer contact information. Click the ‘save and continue’ button after it's done.

OAuth Consent Screen

In the scope step, click the 'add or remove scope' button. Select all of the YouTube Data APIs by clicking on each one and click 'update'. Click 'save and continue' after it's done.

Scope

Then, you will be asked to add a user. This user will be used while publishing status is set to 'Testing', only test users are able to access the app and click 'add'. Click the 'save and continue' button after it's done.

Add User

You will arrive at the summary page. Click 'back to dashboard'.

Summary

After set up your OAuth consent screen, select the Dashboard menu. Click on the ‘Enable APIs and Services’ button.

Enable API and Services

API library page is displayed.

API Library

On the below youtube section, select and click ‘Youtube Data API v3’.

YouTube Data API

The YouTube Data API v3 overview screen is displayed. Click on ‘MANAGE‘.

Manage YouTube Data API v3

Click on the ‘Create Credentials‘ button.

Create Credentials

Then, the credential screen is displayed. On this page, you must complete the required data such as the data below:

  1. Click on the ‘Where will you be calling the API from?‘ field and select ‘Web browser (Javascript)’ from the drop-down menu. This will allow this API to work with the Video Export entity in the portal.

  2. Select ‘User data’ in the ‘What data will you be accessing?’ field.

  3. Click on the ‘What credentials do I need?’ button.

Add Credentials

After done, you will be asked to enter a name for your web client in the ‘Name‘ field, Copy and paste the following URL to the ‘Authorized redirect URLs‘ field, and click the ‘Create OAuth Client ID’ button.

OAuth 2.0 Client ID

Copy and paste the following URL to the ‘Authorized redirect URLs' field https://developers.google.com/oauthplayground.

Then, your credentials are created. Click 'download' to download the credentials or you can click 'done' to finish or 'cancel' to cancel the process.

Download Credentials

After you click 'done', you will redirect to the Credentials menu, click on the 'Create Credentials' button. Select the 'API Key' button.

API Key

A pop-up to restrict the API key will appear. Click the 'Restrict Key' button.

Restrict Key

Then, you will redirect to the key restriction page. Select ‘Application type’, enter ‘Name’, and enter your ‘Restriction’, click the ‘Save’ button.

Key Restriction

You will return to the credentials page.

Credentials

If you want to view your client ID and client secret, go to your OAuth 2.0 Client IDs and click on the name of your OAuth 2.0 Client ID. Then, you will find it on the top-right of the page.

Client ID and Client Secret

Stage 2 – Create YouTube Refresh Token

Go to https://developers.google.com/oauthplayground/ and log in using your Google Credentials.

OAuth 2.0 Playground

Click on (the ‘Configuration’ menu). A configuration drop-down is displayed. Select the ‘Use your own OAuth credentials’ check box.

Configuration

The OAuth credential fields are displayed. Enter the OAuth ‘Client ID’ and ‘Client Secret’ you created in Stage I into the ‘OAuth Client ID’ and 'OAuth Client Secret' fields.

OAuth Credentials

Click on ‘Close‘ to save your settings.

Save Settings

In the ‘Select & authorize APIs’ pane, scroll down and click on ‘YouTube Data API v3’. A drop-down menu will appear displaying all the YouTube Data APIs.

Select & Authorize APIs

Select all of the YouTube Data APIs by clicking on each one. A check marker should correspond to each API method. Click on ‘Authorize APIs’.

YouTube Data API v3

If you haven’t signed in yet, select your Google account.

Choose an Account

Click on ‘Allow to give your web application client access to the selected APIs.

Allow Permission

A request/response is displayed in the right pane of the screen.

Request/Response

Click on ‘Exchange authorization code for tokens‘. The request/response pane is updated and displays an authentication JSON object access token.

Exchange Authorization Code for Tokens

Copy your Refresh token displayed between the double quotation marks. This is the API token you are required to enter in your Company Settings screen within the Vidible platform. In addition, you will need the Client ID and Client Secret obtained previously.

API Token

Last updated

Was this helpful?