Park
Park

Reputation: 2484

How can I get a recommendation video list on Youtube

We can see personalized recommendation videos based on my Youtube history on the top of Youtube website when I sign in. Now, I am trying to get the recommendation videos on Youtube using Youtube Data API v3.

As I know there was an API to get the recommendation video list in YouTube API v2 but it was deprecated in v3 as below:

Video recommendations

YouTube Data API (v2) functionality: Retrieve video recommendations

The v3 API does not retrieve a list that only contains videos recommended for the current API user. However, you can use the v3 API to find recommended videos by calling the activities.list method and setting the home parameter value to true.

In the API response, a resource corresponds to a recommended video if the snippet.type property's value is recommendation. In that case, the contentDetails.recommendation.reason and contentDetails.recommendation.seedResourceId properties will contain information about why the video was recommended. Note that there is no guarantee that the response will contain any particular number of recommended videos.

https://developers.google.com/youtube/v3/guides/implementation/deprecated#Video_Recommendations

However, I cannot get the recommendation list although I have tried to call the activities.list method (see https://developers.google.com/youtube/v3/docs/activities/list) and set home parameter snippet.value to true as guided. It returns only 256 videos of Popular on Youtube Channel which snippet.type value is "upload", channelTitle value is "Popular on Youtube", not personalized recommendation videos. Some videos must have snippet.type value as "recommendation".

Is there anyone who succeeded to get a personalized recommendation video list using Youtube Data API v3?

Thank you.

Upvotes: 3

Views: 2504

Answers (1)

MαπμQμαπkγVπ.0
MαπμQμαπkγVπ.0

Reputation: 6737

If you check the method Activities, the resource representation (JSON) contained the recommendation in the structure.

"recommendation": {
      "resourceId": {
        "kind": string,
        "videoId": string,
        "channelId": string,
      },

I think you can use this.

Upvotes: -2

Related Questions