Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
96
rated 0 times [  102] [ 6]  / answers: 1 / hits: 17695  / 9 Years ago, mon, june 15, 2015, 12:00:00

I am able to get search results, playlists of an user using Youtube Javascript API.



How can i get the watched history of an user using Youtube Javascript API???



Is there any Javascript API to get the Youtube watched history of an user??


More From » youtube-api

 Answers
62

Here's the general procedure:



1) Get the watch History playlist of a given user's channel (as a channel ID is the key to getting user info). Note that this will ONLY work when a user is authenticated via oAuth2.



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


With that response, there should be a watchHistory playlist ... take it and call the playlistItems endpoint:



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


Unfortunately, many users are reporting there's a bug in the watch history playlist through the API right now:



https://code.google.com/p/gdata-issues/issues/detail?id=4642



So your mileage may vary.


[#66200] Friday, June 12, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryanulyssesb

Total Points: 91
Total Questions: 105
Total Answers: 102

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
;