Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get LIKED youtube videos via API

I know how to get the count of 'liked' videos using the YouTube API, but I want to get a list of those videos.

After reading the docs, I think it can be done by getting the 'liked' playlist, but I do not know exactly how.

Can I get the 'liked' video list through the Javascript API?

like image 464
Tiago Gouvêa Avatar asked Jan 20 '13 14:01

Tiago Gouvêa


People also ask

How do you get to Liked videos on YouTube?

Click liked videos:On the homepage of your YouTube account, you will find an option "Liked videos" to the left side of the page. You need to scroll down and select the "Liked videos" located in the middle. Doing so will open a page with a list of your youtube liked videos.

Is YouTube API key free?

YouTube Data API costs are based on quota usage, and all requests will incur at least a 1-point quota cost. For each project, you're allowed 10,000 free quota units per day.

Is YouTube API free or paid?

All API requests, including invalid requests, incur at least a one-point quota cost. You can find the quota available to your application in the API Console.


2 Answers

If you're using v3 of the API, then you can get your liked video list. First, do a call to your channels feed, like this:

https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true&key={YOUR_API_KEY}

Then, in the response, you'll have a list of related playlists -- one will be keyed "likes." Take that playlist ID and request its items feed:

https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId={PLAYLIST_ID}&key={YOUR_API_KEY}

If you don't use v3 of the API, you probably won't have a lot of success in getting the liked videos.

like image 74
jlmcdonald Avatar answered Sep 18 '22 19:09

jlmcdonald


As of 2020, the /videos endpoint lets you filter directly for liked videos, e.g.:

GET https://www.googleapis.com/youtube/v3/videos?myRating=like&part=snippet
Authorization: Bearer <oauth token>
like image 38
Jacob O'Bryant Avatar answered Sep 22 '22 19:09

Jacob O'Bryant