Note: The YouTube Data API (v2) has been officially deprecated as of March 4, 2014. Please refer to our deprecation policy for more information. Please use the YouTube Data API (v3) for new integrations and migrate applications still using the v2 API to the v3 API as well.
The annotated screenshot below shows a YouTube video watch page, which primarily displays information about a single video. The list following the screenshot explains how to use the YouTube API to retrieve the information. Note that you would need to synthesize content from several API responses to reproduce this page using the API.
To display this page, you would first retrieve the feed for the video entry. The XML in a video entry feed is identical to the content that appears for that video in a feed or search result set. As shown above, this page also includes information from the video's comments feed and related videos feed. In addition, the pulldown menu below the video title shows information from the video owner's uploaded videos feed.
The screenshot displays the following information:
This item shows the title of the video. In a video entry, the
<media:title>tag contains the video's title.
The Subscribe button next to the video owner's name (or channel icon) allows a user to subscribe to the video owner's activity feed.
The pulldown menu next to the button shows information from the video owner's uploaded videos feed. The pulldown shows the number of videos that the video owner has uploaded. This value is specified in the
When a user clicks on the pulldown, the pane shown below appears, displaying other videos uploaded by the video owner. Each video corresponds to an entry in the uploaded videos feed. For each video, the pane shows a thumbnail image (
<media:thumbnail>), the video duration (
<yt:duration>), the video title (
<media:title>, the video owner (
<name>), and the video's view count (
This section displays a list of comments for the video. In the video entry, the
<gd:feedLink>tag that has a
relattribute value of
http://gdata.youtube.com/schemas/2007#commentsspecifies the number of comments on the video as well as the URL for the video's comments feed. You would need to retrieve that feed to actually display the comments.
This section displays a list of videos that YouTube considers similar to the video featured on the page. The related videos feed allows you to retrieve this list using the API.