Get Appointment

We have received your message and will contact you soon.

Thank you for choosing prositeweb, your web development agency in Montreal. Please call us at +1 (514) 548-2165 if you need immediate support.

Do you have a YouTube channel with several videos and certainly dream of hosting it directly on your website? If so, this article is for you. Google via its YouTube API key gives you the possibility to host your channel on your website. Indeed, by using this feature, you can automatically connect your website to your YouTube channel and see your videos appear automatically on your website each time you add them. In other words, your video library codes take care of updating your website. In this article, we will see how to use YouTube API V3 key and channel ID to sync content. The article is in three parts. In the first part, we will see how to create identifiers. Then we will use the codes that you can copy and paste to do the synchronization. Finally, the last part of this article will give you tips on how to do it easily depending on the type of web solution you are using. If you are on WordPress, you can for example download our extension to save time.

Why host your YouTube channel on your website

There may be several reasons for this:

  • Expand your reach: When your videos are on YouTube, a user has to be there to see them. If you have them on your website, it can be a way to target people outside of YouTube.
  • Increase the visibility of your website. Video content seems to have more reach than articles. To this end, in the event that you have your videos on your website, it can help increase your visibility.
  • Grow your brand. The more popular you are online, the more likely you are to grow your brand.

Some Benefits of YouTube API Key

APIs (or Application Programming Interface) give you the benefits of connecting to data from an external platform as easily as possible. With the YouTube API you can connect data from your YouTube channel to your website. Below are some advantages compared to the manual procedure.

  • No more copying your video link manually. Through the API you are able to get the link and several other data
  • Double your online visibility. Videos on your site have the advantage of increasing your traffic. So, using the API you could create a video library and keep your visitors on your website
  • You have flexibility in data manipulation. With the API, you can for example get the description, summary, banner photo of your video. In addition you can customize the design of your site to your liking.

Prerequisites for connecting YouTube to your website

To be able to connect your channel to your site, you obviously need:

  • from a YouTube channel,
  • of a website and
  • an account at Google Cloud.

I am going in this part you explain how to proceed to have these three elements if you do not have any.

How to create your YouTube channel

Gmail users automatically get a YouTube channel. To create your YouTube channel, you must have a Gmail or G-Suite account.

For all Gmail and G-Suite subscribers

  • Visit the YouTube site and click "connect". When you click on the button, the site will redirect you to the login page?
  • Enter your username and password to log in.
  • You will be redirected to the YouTube page. You can click the camera icon on the top right corner to add your videos.

If you don't have a Gmail or G Suite account

  • Go to YouTube then click "connect". Once done, you will certainly find yourself on a page asking you to create your account.
  • Click on “Create an account.” (you will have the choice between creating an account for you or managing your business).
  • Choose the option that fits your goals.
  • Then, follow the steps suggested by Google to create your account. In most cases, you need your name, first name, a unique email (which you will choose) the password.
  • To add videos, click the camera icon in the top-right corner of your YouTube page.

How to host your YouTube channel on your website using the YouTube api key, your channel ID and PHP [Updated article]

How to Create a Google Cloud Account to Retrieve YouTube API Key

The Google Cloud account is an interface suggesting a set of APIs including the YouTube API. We will see how to have a Google Cloud account To create a Google Cloud account follow these steps:

  • go to the Google Cloud site and click on "Go to the console"
  • Just like creating the YouTube account, you will be redirected to the login page
  • On this page, you must use an existing Gmail or G-Suite account or create one.
  • Once connected, you must follow the steps advised by the platform to configure your account.
  • You must add payment information to be able to activate your account

Please note that Google Cloud offers paid applications based on the number of requests per day. You may never have to pay if you use few apps. I advise you to refer to the general conditions before committing yourself. Google Cloud Console

How to create a website?

I guess in the event that you want to connect YouTube to your site, it's obvious that you have one. Otherwise, the easiest option to use this article is to have a self-hosted site. Indeed, to be able to modify the codes of your site, you must have the necessary authorizations. This freedom is not offered by online website builders or free solutions.

Option 1: Create your website by yourself

The generic steps for creating a self-managed site are as follows:

  • Find a domain name and a host. Several hosts give you the possibility of having a domain name for free. For example, you will find options for less than $3.95 per month online.
  • Choose the solution that interests you for the creation of your website. We will recommend WordPress to you.
  • Create Your Site.

Option 2: Hire a developer

A developer or a web agency can help you in the development of your website. It can be the best option if you want to have a quality solution. Our agency offers you, for example, solutions adapted to your needs at a fairly competitive cost. In case you want to know more about what we offer, visit our services or contact us.

How to Create a YouTube API Key and Retrieve YouTube Channel ID

If you have all the items discussed above; namely a website, a YouTube channel as well as a Google cloud account, you can continue with the following.

Create YouTube API Key

You must have the API key to sync your website with YouTube. To get the API key, you need to follow these steps:

  • First, visit the page
  • Then, in the search field, enter YouTube Data API v3
  • Finally, click on the activate button

API Library When you click on activate, the site will generate a code (API) that you will use in the second part.

Retrieve YouTube Channel ID

In order to retrieve your YouTube channel ID, you must:

  • Log in to your YouTube account where your channel is located
  • Then In the top right corner of the page, click on setting/Configuration
  • In the left menu, click on Advanced Settings/Advanced configuration
  • You will find your identifiers among the list of other information on the page

Your YouTube channel ID can also be found on the URL when following steps:

  • Click on your profile picture (in the top right corner) and a drop-down menu will appear
  • Then click on "Your Channel"
  • You will see your channel ID just after at the URL

Use the code below to display your videos on your site

Lines 2 and 3 of the code allow you to add your API key and then your YouTube ID respectively. Next, line 7 (myQuery) retrieves the YouTube account information using the key and ID. All the following are just codes to browse the data to bring up the video list.

Add some CSS to format your page

Add JavaScript to make your page interactive or keep the video playing on your website

Note that the JavaScript code uses jQuery, you must include it in your code if you want to use it. The result of this program will be more or less similar to the screenshot below.

An alternative in case you use WordPress

We have implemented this tutorial in a WordPress extension, you will find the extension in our extension bank. Visit the website

How it works?

After installing the extension, you must:

  • visit Settings tab ⇾ Vlog Option generator
  • Enter your API credentials and your YouTube channel key
  • The number of data you want to extract
  • the number of data per page.

Once you save the changes, you can use the shortcode below to make the videos appear on your website.


Extension for YouTube


Easily managing your YouTube channel on your website can be relatively easy. Thank you for taking the time to read our article. If you have a connection project with APIs to facilitate your daily activities, Contact us.

Share :


WordPress Plugin - Replace Add to Cart Button with Contact Link
18 January 2023
Consulting and development under Magento for Controls Depot
09 May 2022

Do you have a project in mind? Contact our web agency for a free evaluation.

We are the experts in creating websites, online stores and functionalities for websites based in Montreal. Contact us today to create your website starting at $1,200.