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:
- Log in to your Google account.
- Open the Google Developers Console.
- Select an existing project or create a new one.
Next, make sure your YouTube Data API is enabled:
- In the sidebar on the left, expand "APIs & auth" and click "APIs".
- On the "API Library" tab, locate and open "YouTube Data API".
- Make sure this API is enabled:
- Click "Enable API" if necessary".
- Then make sure that on the "Enabled APIs tab, it's present and enabled.
Finally, create the API key:
- Back in the sidebar on the left, click "Credentials".
- Below "Public API access", click "Create New Key".
- In the popup window, click "Browser Key", then in another popup window, click "Create"
- 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
- From the Content or Layout perspective, insert the Composite.Media.YouTubeChannel.ChannelViewer function ( Insert > Function), or add the following code:
Expand code - 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).
- 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
- From the Content or Layout perspective, insert the Composite.Media.YouTubeChannel.PlayListsViewer function ( Insert > Function), or add the following code:
Expand code - 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).
- If necessary, specify the optional parameter:
- Page Size: The number of videos to show on a page