YouTube API Adds Watch History Support
The YouTube API supports a number of video feeds that users can draw from for their applications and whatnot. Another video feed has been added today that should be of great use for those who want to better target videos at users.
The YouTube API blog today announced today that a user’s watch history is now supported by the YouTube Data API. This means that API users can retrieve their own YouTube viewing histories. You can not retrieve the watch history of any other user though.
The watch history obviously includes a list of video that a user has watched on the YouTube Web site. It can also include embedded videos watched on other sites if the user has the YouTube login cookie. Unfortunately, it can not pull videos that users watch on mobile devices.
As for the order of the feed’s entries, they are in chronological order starting with the most recently watched video. Watching a video multiple times puts each occurrence as a separate entry in the feed as well.
For examples as to how this new functionality can be used, the YouTube API team offers a few examples. The first is a site that offers recommended videos for people to watch. Taking advantage of this update to the API, you can exclude results from the list that the user has already watched. Another example has a Web site owner including a video that the user has repeatedly watched.
For more information on the watch history feed and how to implement in your Web site or app, check out the Web page for it. It’s important to note that you can only use the watch history feed with API version 2.0.