How to set up credentials for YouTube Data API

To start using the YouTube Data API, you need to create an API key and OAuth credentials to enable the YouTube Data API service. Follow the steps below to set up your working environment.

Setting up project and enabling the API

You need a Google account to access the Google API Console to generate an API key and OAuth credentials. Follow the steps below to set up a project and enable the YouTube Data API for the project:

  1. Select a project in the API Console.

  2. If no project exists, create a new one by clicking the “NEW PROJECT” button and filling the required fields.

Step 1: Create or select a project
1 of 2

You’ll be redirected to the project dashboard once the project has been created. The next step is to enable the YouTube Data API. You can do so by following the steps below:

  1. Go to the Library panel and search for “YouTube Data API v3.”

  2. Select the “YouTube Data API v3” card from the search results.

  3. Click the “Enable” button to ensure that the API is enabled for your project.

Step 1: Library panel
1 of 3

Now that you have enabled the API for your project, you’ll now create an API key.

Creating an API key for the project

You’ll require an API key to make API requests for the endpoints that don’t require user authorization. For example, to retrieve information about a public YouTube video, you don’t need authorization.

Follow the steps below to create an API key:

  1. Go to the Credentials panel and click the “CREATE CREDENTIALS” button.

  2. Click the “API key” option from the drop-down menu to generate a new API key for your project. A pop-up will appear containing the value of the API key.

Step 1: Click the “CREATE CREDENTIALS” button
1 of 3
Step 1: Click the “CONFIGURE CONSENT SCREEN” button
1 of 6

Create an OAuth 2.0 client ID

To create an OAuth 2.0 client ID, follow the steps below:

  1. Go to the Credentials panel and click the “CREATE CREDENTIALS” button.

  2. Click the “OAuth client ID” option from the drop-down menu.

  3. Select “Web application” as the “Application type” of your OAuth 2.0 client and keep the default name for the client.

  4. Additionally, you can add redirect URIs based on your project.

  5. Finally, click the “CREATE” button.

Step 1: Click the “CREATE CREDENTIALS” button
1 of 4

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved