Stiamo aggiornando l'API Data in modo che corrisponda al modo in cui YouTube conteggia le visualizzazioni di Shorts.
Scopri di più
Implementazione: attività
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
YouTube ritirerà la funzionalità di invio di bollettini ai canali. Di conseguenza, il metodo
activities.insert
verrà ritirato e il metodo
activities.list
non restituirà più i bollettini del canale. Queste modifiche entreranno in vigore nell'API il 18 maggio 2020 o successivamente. Per maggiori dettagli, consulta il
Centro assistenza YouTube.
Gli esempi seguenti mostrano come utilizzare l'API YouTube Data (v3) per eseguire funzioni relative all'attività utente.
Recuperare un elenco di attività del canale
Per recuperare un elenco di eventi correlati a un determinato canale, chiama il metodo activities.list
utilizzando uno dei seguenti due metodi per identificare il canale:
Recuperare un elenco di attività di abbonamento
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-11-23 UTC.
[null,null,["Ultimo aggiornamento 2024-11-23 UTC."],[[["\u003cp\u003eYouTube is removing the channel bulletin feature, which impacts how channel activity is managed.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eactivities.insert\u003c/code\u003e method will be deprecated, and \u003ccode\u003eactivities.list\u003c/code\u003e will no longer return channel bulletins after May 18, 2020.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve a list of channel activities using the \u003ccode\u003eactivities.list\u003c/code\u003e method by either setting the \u003ccode\u003emine\u003c/code\u003e parameter to \u003ccode\u003etrue\u003c/code\u003e for the authenticated user or by specifying a \u003ccode\u003echannelId\u003c/code\u003e for a particular channel.\u003c/p\u003e\n"],["\u003cp\u003eTo view subscription activities for the authenticated user, you must use the \u003ccode\u003eactivities.list\u003c/code\u003e method with the \u003ccode\u003ehome\u003c/code\u003e parameter set to \u003ccode\u003etrue\u003c/code\u003e.\u003c/p\u003e\n"]]],["YouTube is removing the channel bulletin feature. Consequently, the `activities.insert` method will be deprecated, and `activities.list` will no longer return channel bulletins, effective on or after May 18, 2020. The `activities.list` method can still be used to retrieve channel activities by setting `mine=true` for the authenticated user's activities or using the `channelId` parameter. You can also retrieve subscription activities by setting `home=true`.\n"],null,["# Implementation: Activities\n\nYouTube is deprecating the channel bulletin feature. As a result, the [activities.insert](/youtube/v3/docs/activities/insert) method will be deprecated, and the [activities.list](/youtube/v3/docs/activities/list) method will stop returning channel bulletins. These changes will be effective in the API on or after May 18, 2020. For more details, please see the [YouTube Help Center](https://support.google.com/youtube?p=channel-bulletins).\n\nThe following examples show how to use the YouTube Data API (v3) to perform functions related to user activity.\n\nRetrieve a list of channel activities\n-------------------------------------\n\nTo retrieve a list of events related to a particular channel, call the [activities.list](/youtube/v3/docs/activities/list) method using one of the following two methods to identify the channel:\n\n- Set the [mine](/youtube/v3/docs/activities/list#mine) parameter value to `true` to retrieve a list of the currently authenticated user's activities. Your request must be authorized using OAuth 2.0.\n\n ```\n https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.activities.list?\n part=snippet,contentDetails\n &mine=true\n ```\n- Set the [channelId](/youtube/v3/docs/activities/list#channelId) parameter to the YouTube channel ID that uniquely identifies the channel for which you are retrieving an activity list. This example sets the `channelId` parameter to `UCK8sQmJBp8GCxrOtXWBpyEA`, which also identifies Google's official YouTube channel.\n\n ```\n https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.activities.list?\n part=snippet,contentDetails\n &channelId=UCK8sQmJBp8GCxrOtXWBpyEA\n ```\n\nRetrieve a list of subscription activities\n------------------------------------------\n\nSubscription activities refer to events associated with channels that the authenticated user subscribes to. To retrieve a list of subscription activities for the currently authenticated user, call the [activities.list](/youtube/v3/docs/activities/list) method and set the [home](/youtube/v3/docs/activities/list#home) parameter's value to `true`. The request must be authorized using OAuth 2.0. \n\n```\nhttps://developers.google.com/apis-explorer/#p/youtube/v3/youtube.activities.list?\n part=snippet,contentDetails\n &home=true\n```"]]