YouTube video post for WordPress – how to get your YouTube API key

This time we’re going to see how to get the API key for YouTube data API and use it in YouTube video import plugin for WordPress.

Starting with plugin version 1.2, the API key is required in order to be able to query YouTube data API v3. Read on to see how to set things up.

To get your API key for YouTube Data API you need to be logged into your Google account and access the Google console. You will be taken to your projects page. If you don’t have any existing projects, create a new project.

Google Console new project step 1

Once you click the Create Project button, a modal window will open asking for your project details.

Google Console new project step 2

After your project is created, simply enter it by clicking its name.

Google Console new project step 3

Once inside your project, you will have to enable YouTube Data API first. From the left menu, go to APIs & auth and then APIs. Once in the APIs page, filter by searching for YouTube and select YouTube Data API v3 from the APIs presented by the console.

Google console enable YouTube API - step 1

From inside the API administration screen, click Enable API button.

Google Console enable YouTube API - step 2

Now that YouTube API is enabled, you can generate the API key that you will use with the plugin. For this, from the left menu, go to APIs & auth and select Credentials. Once on the credentials page, under Public API access click Create new Key button.

Google Console API credentials - step 1

Once you click Create new Key button, the interface will open a modal window having several options; choose the Server key option.

Google Console API credentials - step 2

Next, you will have the option to enter a list of IP addresses that are allowed to query APIs using this server key. If you don’t know your server’s IP address you can leave this empty and just click Create button.

Google console API credentials - step 3

Last, copy the API key generated by the console into plugin Settings page, tab API & License in option YouTube API key.

Google Console API credentials - step 4