Search code examples
youtubeyoutube-api

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?


Solution

  • 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.