icon YouTube Channel
Created by Orckestra

How to get an API key for YouTube Channel

To use YouTube Channel on your website, you need to get an API key from Google.

Note. This is one-time operation. You can reuse the same API key on multiple pages and multiple websites.

First, go to the Google Developers Console and create a project:

  1. Log in to your Google account.
  2. Open the Google Developers Console.
  3. Select an existing project or create a new one.

Next, make sure your YouTube Data API is enabled:

  1. In the sidebar on the left, expand "APIs & auth" and click "APIs".
  2. On the "API Library" tab, locate and open "YouTube Data API".
  3. Make sure this API is enabled:
    1. Click "Enable API" if necessary".
    2. Then make sure that on the "Enabled APIs tab, it's present and enabled.

Finally, create the API key:

  1. Back in the sidebar on the left, click "Credentials".
  2. Below "Public API access", click "Create New Key".
  3. In the popup window, click "Browser Key", then in another popup window, click "Create"
  4. Back on the "Credentials", copy the API key that has appeared.

It will look something like this: SyAYjNAIzaJGfrY8DkcAB0kVxBgWF8IZvESHrT1.

Now you can use it in the functions when adding videos from YouTube channels or playlists as described below.

(For more information about creating Google API keys, please see "Obtaining authorization credentials").

How to add all videos from a YouTube channel

  1. From the Content or Layout perspective, insert the Composite.Media.YouTubeChannel.ChannelViewer function ( Insert > Function), or add the following code:
    Expand code
  2. Specify the required parameters:
    • YouTubeChannel: The full URL of the YouTube channel ("user"). e.g. "http://www.youtube.com/user/CompositeC1", or just its ID, e.g. "CompositeC1".
    • API Key: The key you've created for browser applications in the Google Developers Console (see above).
  3. If necessary, specify the optional parameter:
    • Page Size: The number of videos to show on a page

How to add videos from a YouTube channel grouped by playlists

  1. From the Content or Layout perspective, insert the Composite.Media.YouTubeChannel.PlayListsViewer function ( Insert > Function), or add the following code:
    Expand code
  2. Specify the required parameter:
    • YouTubeChannel: The full URL of the YouTube channel ("user"). e.g. "http://www.youtube.com/user/CompositeC1", or just its ID, e.g. "CompositeC1".
    • API Key: The key you've created for browser applications in the Google Developers Console (see above).
  3. If necessary, specify the optional parameter:
    • Page Size: The number of videos to show on a page