Wir aktualisieren die Data API, damit sie der Zählweise von YouTube-Aufrufen für Kurzvideos entspricht.
Weitere Informationen
Implementierung: Aktivitäten
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Die Funktion „Kanalnachrichten“ wird auf YouTube eingestellt. Daher wird die Methode
activities.insert
eingestellt und die Methode
activities.list
gibt keine Kanalmeldungen mehr zurück. Diese Änderungen treten am oder nach dem 18. Mai 2020 in der API in Kraft. Weitere Informationen findest du
in der YouTube-Hilfe.
In den folgenden Beispielen wird gezeigt, wie du mit der YouTube Data API (Version 3) Funktionen ausführen kannst, die sich auf Nutzeraktivitäten beziehen.
Liste der Kanalaktivitäten abrufen
Wenn Sie eine Liste der Ereignisse abrufen möchten, die sich auf einen bestimmten Kanal beziehen, rufen Sie die Methode activities.list
auf und verwenden Sie eine der folgenden beiden Methoden, um den Kanal zu identifizieren:
Liste der Aboaktivitäten abrufen
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-11-23 (UTC).
[null,null,["Zuletzt aktualisiert: 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```"]]