A channelSection
resource contains information about a set of videos that a channel has chosen to feature. For example, a section could feature a channel's latest uploads, most popular uploads, or videos from one or more playlists.
Note that a channel's sections are only visible if the channel displays content in a browse view (rather than a feed view). To enable a channel to display content in a browse view, set the brandingSettings.channel.showBrowseView
property to true
for the specified channel.
A channel can create a maximum of 10 shelves without setting targeting data and can create a maximum of 100 shelves with targeting data.
Methods
The API supports the following methods for channelSections
resources:
- list
- Returns a list of
channelSection
resources that match the API request criteria. Try it now. - insert
- Adds a channel section to the authenticated user's channel. A channel can create a maximum of 10 shelves without setting targeting data and can create a maximum of 100 shelves with targeting data. Try it now.
- update
- Updates a channel section. Try it now.
- delete
- Deletes a channel section. Try it now.
Resource representation
The following JSON structure shows the format of a channelSections
resource:
{ "kind": "youtube#channelSection", "etag": etag, "id": string, "snippet": { "type": string, "style": string, "channelId": string, "title": string, "position": unsigned integer, "defaultLanguage": string, "localized": { "title": string } }, "contentDetails": { "playlists": [ string ], "channels": [ string ] }, "localizations": { (key): { "title": string } }, "targeting": { "languages": [ string ], "regions": [ string ], "countries": [ string ] } }
Properties
The following table defines the properties that appear in this resource:
Properties | |
---|---|
kind |
string Identifies the API resource's type. The value will be youtube#channelSection . |
etag |
etag The Etag of this resource. |
id |
string The ID that YouTube uses to uniquely identify the channel section. |
snippet |
object The snippet object contains basic details about the channel section, such as its type, display style, and title. |
snippet.type |
string The channel section's type. Valid values for this property are:
|
snippet.style |
string The format in which the channel section displays. Valid values for this property are:
|
snippet.channelId |
string The ID that YouTube uses to uniquely identify the channel that published the channel section. |
snippet.title |
string The section's title. You can only set the title of a channel section that has a snippet.type value of either multiplePlaylists or multipleChannels , and, in fact, you must specify a title when inserting or updating either of those types of sections. If you specify a title for other types of channel sections, the value will be ignored.This property's value has a maximum length of 100 characters and may contain all valid UTF-8 characters except < and >. |
snippet.position |
unsigned integer The section's position on the channel page. This property uses a 0-based index. A value of 0 identifies the first section that appears on the channel, a value of 1 identifies the second section, and so forth.If you do not specify a value for this property when inserting a channel section, the default behavior is to display the new section last. |
snippet.defaultLanguage |
string The language of the text in the channelSection resource's snippet.title property. |
snippet.localized |
object The snippet.localized object contains either a localized title for the channel section or the title in the default language for the channel section's metadata.
localizations object to add, update, or delete localized titles. |
snippet.localized.title |
string The localized channel section title. |
contentDetails |
object The contentDetails object contains details about the channel section's content, such as a list of playlists or channels featured in the section. |
contentDetails.playlists[] |
list A list of one or more playlist IDs that are featured in a channel section. You must specify a list of playlist IDs if the channelSection resource's snippet.type property is either singlePlaylist or multiplePlaylists , and this property should not be specified for other types of sections. If the type is singlePlaylist , this list must specify exactly one playlist ID. |
contentDetails.channels[] |
list A list of one or more channel IDs that are featured in a channel section. You must specify a list of channel IDs if the channelSection resource's snippet.type property is multipleChannels , and this property should not be specified for other types of sections. You cannot include your own channel in the list. |
localizations |
object The localizations object encapsulates translations of the channel section's metadata. |
localizations.(key) |
object The language of the localized text associated with the key value. The value is a string that contains a BCP-47 language code. |
localizations.(key).title |
string The localized channel section title. |
targeting |
object The targeting object contains targeting settings for the channel section. Note that a user must meet all of the targeting settings for a channel section to be visible. The following examples help to explain the behavior:
|
targeting.languages[] |
list A list of application languages for which the channel section is visible. Use the i18nLanguages.list method to retrieve a list of application languages that YouTube supports. |
targeting.regions[] |
list A list of content regions where the channel section is visible. Use the i18nRegions.list method to retrieve a list of content regions that YouTube supports. |
targeting.countries[] |
list A list of ISO 3166-1 alpha-2 country codes where the channel section is visible. |