Note: The YouTube Data API (v2) has been officially deprecated as of March 4, 2014. Please refer to our deprecation policy for more information.
Movies and trailers
Videos must meet special metadata requirements to be included in YouTube's Movies and Trailers categories. Feed entries for those videos accordingly contain several extra tags to reflect the enhanced metadata available for movies and trailers. Note, however, that movie and trailer entries are both types of video feed entries and could be returned in any feed that contains video entries, including search result feeds.
In addition, the YouTube API lets you retrieve several movie charts, which are standard feeds that only contain videos that appear in YouTube's Movies category.
The following subsections explain the special metadata fields included in movie and trailer entries as well as the movie charts that the API supports.
Special metadata fields in movie and trailer entries
Video and chart entries might contain several extra tags to reflect the enhanced metadata available for movies and trailers. These enhanced metadata fields are listed below:
-
The
<yt:availability>
tag specifies the date range when the movie or trailer will be available on YouTube. -
The
<yt:firstReleased>
tag specifies the movie's original release date. -
The entry may contain one or more additional
<media:category>
tags in addition to the standard one that indicates that the video is in theMovies
orTrailers
category:- A tag with a
scheme
attribute value ofhttp://gdata.youtube.com/schemas/2007/mediatypes.cat
indicates whether a video is a feature film, a short film, or a trailer. The following values are valid for this scheme:1
– Feature-length film2
– Short film3
– Full episode4
– Show clip5
– Trailer
- A tag with a
scheme
attribute value ofhttp://gdata.youtube.com/schemas/2007/moviegenres.cat
specifies a genre (e.g. "Action & Adventure" or "Comedy") that describes the movie. A movie may be associated with multiple genres. The following values are valid for this scheme:1
– Action & Adventure2
– Animation & Cartoons3
– Classics4
– Comedy5
– Crime6
– Drama7
– Documentary & Biography8
– Family9
– Foreign10
– Horror11
– Mystery & Suspense12
– Romance13
– Science Fiction15
– Sports18
– Indian Cinema19
– Nigerian Cinema
- A tag with a
scheme
attribute value ofhttp://gdata.youtube.com/schemas/2007/releasemediums.cat
specifies the original release medium for the movie. For example, a movie may have been originally released in theaters or on a premium cable channel. The following values are valid for this scheme:1
– Theatrical or festival film releases2
– Premium cable or satellite subscription channels, such as HBO3
– Basic cable and satellite channels, such as Comedy Central or MTV4
– Broadcast TV networks and local TV stations5
– Promotional clips and trailers6
– Original web content7
– Direct-to-video release
- A tag with a
-
The
<media:credit>
tag can identify a contributor (actor, director, producer, or writer) to the movie, and an entry can include multiple<media:credit>
tags. -
The
<media:rating>
tag can specify an MPAA (Motion Picture Association of America) or V-Chip rating for a movie. The tag'sscheme
attribute identifies the type of rating, and the tag's value specifies the movie's rating under that scheme. -
A
<media:thumbnail>
tag with ayt:name
attribute value ofposter
specifies the URL for an image of the movie's poster art. -
A trailer entry may contain a
<link>
tag that specifies a link to the YouTube Data API feed for the movie featured in the trailer. The tag will have arel
attribute value ofhttp://gdata.youtube.com/schemas/2007#video.trailer-for
:
<link rel='http://gdata.youtube.com/schemas/2007#video.trailer-for' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/lJD3ABBCSrc?v=2'/>
Retrieving a movie chart
To retrieve a movie chart, send a GET request to the URL associated with that chart. Note that you must be using version 2 of the YouTube API to retrieve any of these charts. You can specify the API version using either the v
parameter or the GData-Version
HTTP request header.
The following table identifies the URL associated with each chart:
Chart name | Feed ID | URL and Description |
---|---|---|
Featured movies | featured | URL: https://gdata.youtube.com/feeds/api/charts/movies/featured?region=US Description: This feed lists movies that are featured on the YouTube Movies category home page or in the Google Play Store. This feed will be empty if you do not specify a value for the region parameter. In addition, this feed does not support the movie-genre parameter. |
Most popular movies | most_popular | URL: https://gdata.youtube.com/feeds/api/charts/movies/most_popular?region=US Description: This feed lists the most popular videos in YouTube's Movies category. |
Most recent movies | most_recent | URL: https://gdata.youtube.com/feeds/api/charts/movies/most_recent?region=US Description: This feed lists videos that were recently added to YouTube's Movies category. |
Trending movies | trending | URL: https://gdata.youtube.com/feeds/api/charts/movies/trending?region=US Description: This feed lists videos that have recently experienced the greatest increases in popularity. You must specify a value for the region parameter to retrieve this feed. |
API requests to retrieve movie charts can specify any of the following parameters:
- The
hl
parameter specifies the movie's primary language. - The
movie-genre
parameter filters a chart to only include movies that are in a particular genre. The featured movie chart does not support this parameter. - The
paid-content
parameter filters a chart to only include either paid content or free content. If the parameter is not set, a chart can include both paid and free content. - The
region
parameter filters a chart to only include movies that are viewable in a particular territory. The parameter value is an ISO 3166-1 alpha-2 code that identifies the country where videos must be viewable to be included in search results. The featured movie chart returns an empty feed if you do not specify a value for this parameter.
You can use the following URL to retrieve the top selling or top free movies listed on http://www.youtube.com/movies. Set the paid-content
parameter to true
for movie rentals and to false
for free movies. Note that you also need to provide the appropriate parameter values for the hl
(e.g. en
) and region
(e.g. US
) parameters.
http://gdata.youtube.com/feeds/api/charts/movies/trending?v=2 &max-results=10 &paid-content=(true|false) &hl=<LANGUAGE> ®ion=<REGION_CODE>
Shows, seasons, and episodes
As for movies, videos must meet special metadata requirements to be included in YouTube's Shows category. Feed entries for those videos accordingly contain several extra tags to reflect the enhanced metadata available for shows content. However, these entries are still video feed entries and could be returned in any feed that contains video entries, including search result feeds.
Videos for shows can be either full episodes or clips from an episode. Each video is associated with a particular season of a particular show, and the API provides feeds for retrieving shows, seasons of a show, and episodes (and clips) associated with a season of a show. The API also lets you retrieve show-related charts, which are standard feeds that only contain lists of shows.
In addition, videos in YouTube's Shows category are each associated with a particular season of a specific show. The API provides feeds for retrieving shows, seasons of a show, and episodes (and clips) associated with a specific season of a show. While only the episode/clip feed is a video feed, the other feeds are also explained below.
The following subsections explain these topics in more detail: