Aktualizujemy interfejs Data API, aby był zgodny ze sposobem zliczania przez YouTube wyświetleń filmów Short.
Więcej informacji
ChannelSections
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zasób channelSection
zawiera informacje o zbiorze
które są polecane na kanale. Na przykład sekcja może zawierać filmy z kanału
najnowsze filmy, najpopularniejsze filmy lub filmy z jednej lub kilku playlist.
Na kanale może być maksymalnie 10 półek.
Metody
Interfejs API obsługuje następujące metody w przypadku zasobów channelSections
:
- list
- Zwraca listę
channelSection
zasobów, które pasują do kryteriów żądania do interfejsu API.
Wypróbuj
- wstaw
- Dodaje sekcję kanału do kanału uwierzytelnionego użytkownika. Na kanale może być maksymalnie 10 półek.
Wypróbuj teraz
- zaktualizuj
- Aktualizuje sekcję kanału.
Wypróbuj teraz
- usuń
- Usuwa sekcję kanału.
Wypróbuj teraz
Właściwości
Tabela poniżej zawiera właściwości widoczne w tym zasobie:
Właściwości |
kind |
string
Określa typ zasobu interfejsu API. Wartość wyniesie youtube#channelSection . |
etag |
etag
Etag tego zasobu. |
id |
string
Identyfikator, za pomocą którego YouTube jednoznacznie identyfikuje sekcję kanału. |
snippet |
object
Obiekt snippet zawiera podstawowe informacje o sekcji kanału, takie jak jej typ i tytuł. |
snippet.type |
string
Typ sekcji kanału.
Prawidłowe wartości dla tej właściwości to:
allPlaylists
completedEvents
liveEvents
multipleChannels
multiplePlaylists
popularUploads
recentUploads
singlePlaylist
subscriptions
upcomingEvents
|
snippet.channelId |
string
Identyfikator, za pomocą którego YouTube jednoznacznie identyfikuje kanał, na którym opublikowano sekcję kanału. |
snippet.title |
string
Tytuł sekcji. Możesz ustawić tytuł tylko sekcji kanału, która ma wartość snippet.type multiplePlaylists lub multipleChannels . Tak naprawdę musisz podać tytuł, gdy wstawisz lub zaktualizujesz którąś z tych sekcji. Jeśli określisz tytuł dla innych typów sekcji kanału, wartość zostanie zignorowana.
Wartość tej właściwości ma maksymalną długość 100 znaków i może zawierać wszystkie prawidłowe znaki UTF-8 z wyjątkiem < i <. |
snippet.position |
unsigned integer
Pozycja sekcji na stronie kanału. Indeks, z którego korzysta ta usługa, jest liczony od 0. Wartość 0 określa pierwszą sekcję wyświetlaną na kanale, wartość 1 wskazuje drugą sekcję itd.
Jeśli podczas wstawiania sekcji kanału nie określisz wartości tej właściwości, domyślną opcją będzie wyświetlanie nowej sekcji na końcu. |
contentDetails |
object
Obiekt contentDetails zawiera szczegółowe informacje o zawartości sekcji kanału, takie jak lista playlist lub kanałów, które się w niej znajdują. |
contentDetails.playlists[] |
list
Lista z co najmniej jednym identyfikatorem playlisty widoczna w sekcji kanału. Jeśli właściwość snippet.type zasobu channelSection ma wartość singlePlaylist lub multiplePlaylists , musisz podać listę identyfikatorów playlist. Tej właściwości nie należy określać w przypadku innych typów sekcji. W przypadku typu singlePlaylist lista musi zawierać dokładnie 1 identyfikator playlisty. |
contentDetails.channels[] |
list
Lista z co najmniej jednym identyfikatorem kanału widocznym w sekcji kanału. Jeśli właściwość snippet.type zasobu channelSection ma wartość multipleChannels , musisz podać listę identyfikatorów kanałów. Tej właściwości nie należy określać w przypadku innych typów sekcji. Nie możesz dodać własnego kanału do listy. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-21 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-08-21 UTC."],[[["\u003cp\u003eA \u003ccode\u003echannelSection\u003c/code\u003e resource contains information about a set of videos that a channel features, such as latest uploads, popular uploads, or playlists.\u003c/p\u003e\n"],["\u003cp\u003eChannels can manage their featured videos using the API, which allows creating, listing, updating, and deleting \u003ccode\u003echannelSection\u003c/code\u003e resources.\u003c/p\u003e\n"],["\u003cp\u003eA channel can have a maximum of 10 sections, each with a specified type like \u003ccode\u003esinglePlaylist\u003c/code\u003e, \u003ccode\u003emultipleChannels\u003c/code\u003e, or \u003ccode\u003epopularUploads\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003echannelSection\u003c/code\u003e has properties such as \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eetag\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003esnippet\u003c/code\u003e, and \u003ccode\u003econtentDetails\u003c/code\u003e, which specify details about the section and its contents.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econtentDetails\u003c/code\u003e property can contain a list of either playlists or channels featured in the section, depending on the \u003ccode\u003esnippet.type\u003c/code\u003e property.\u003c/p\u003e\n"]]],["Channel sections feature a curated set of videos, like latest or popular uploads, or playlists. API methods allow listing, inserting, updating, and deleting these sections. A channel can have up to 10 sections. Each section contains `snippet` and `contentDetails` objects which describes the type, title, position, and the featured channels/playlists. The type can be single or multiple playlists, or channels, amongst others. Specific titles are required for some types and cannot include \"\u003c\" or \"\u003e\".\n"],null,["# ChannelSections\n\nA **channelSection** resource contains information about a set of\nvideos that a channel has chosen to feature. For example, a section could feature a channel's\nlatest uploads, most popular uploads, or videos from one or more playlists. \n\n\nA channel can create a maximum of 10 shelves.\n\nMethods\n-------\n\nThe API supports the following methods for `channelSections` resources:\n\n[list](/youtube/v3/docs/channelSections/list)\n: Returns a list of `channelSection` resources that match the API request criteria.\n [Try it now](/youtube/v3/docs/channelSections/list#usage).\n\n[insert](/youtube/v3/docs/channelSections/insert)\n: Adds a channel section to the authenticated user's channel. A channel can create a maximum of 10 shelves.\n [Try it now](/youtube/v3/docs/channelSections/insert#usage).\n\n[update](/youtube/v3/docs/channelSections/update)\n: Updates a channel section.\n [Try it now](/youtube/v3/docs/channelSections/update#usage).\n\n[delete](/youtube/v3/docs/channelSections/delete)\n: Deletes a channel section.\n [Try it now](/youtube/v3/docs/channelSections/delete#usage).\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `channelSections` resource: \n\n```carbon\n{\n \"#kind\": \"youtube#channelSection\",\n \"#etag\": etag,\n \"#id\": string,\n \"#snippet\": {\n \"#snippet.type\": string,\n \"#snippet.channelId\": string,\n \"#snippet.title\": string,\n \"#snippet.position\": unsigned integer\n },\n \"#contentDetails\": {\n \"#contentDetails.playlists[]\": [\n string\n ],\n \"#contentDetails.channels[]\": [\n string\n ]\n }\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#channelSection`. |\n| `etag` | `etag` The Etag of this resource. |\n| `id` | `string` The ID that YouTube uses to uniquely identify the channel section. |\n| `snippet` | `object` The `snippet` object contains basic details about the channel section, such as its type and title. |\n| snippet.`type` | `string` The channel section's type. Valid values for this property are: - `allPlaylists` - `completedEvents` - `liveEvents` - `multipleChannels` - `multiplePlaylists` - `popularUploads` - `recentUploads` - `singlePlaylist` - `subscriptions` - `upcomingEvents` |\n| snippet.`channelId` | `string` The ID that YouTube uses to uniquely identify the channel that published the channel section. |\n| 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 **\\\u003c** and **\\\u003e**. |\n| 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. |\n| `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. |\n| 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. |\n| 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. |"]]