YouTube

YouTube API v2.0 - Education Feeds

Note: The YouTube Data API (v2) has been officially deprecated as of March 4, 2014. Please refer to our deprecation policy for more information.

YouTube EDU provides access to high-quality, educational content, including short lessons, full courses, professional development material, and inspiring speeches, from the world's leading universities, educators, and thought leaders. This documentation explains how to use the YouTube API to retrieve information about the lectures (videos), courses, and subjects accessible through YouTube EDU. (Learn more about YouTube EDU.)

YouTube EDU content is organized using three types of entities:

  • A category identifies a subject or area of study, such as Mathematics or Finance. YouTube EDU categories are organized in a hierarchical taxonomy that is modeled after categorizations that exist in many educational institutions. Each category may have one parent category and one or more child categories.

  • A course is a series of lectures (videos) about a particular topic. A course may be linked to one or more categories. Since a course identifies a set of videos meant to be viewed sequentially, it is a type of YouTube playlist that could contain additional types of metadata specific to YouTube EDU material.

  • A lecture is a single YouTube video that is either part of a course or that is attached directly to one or more YouTube EDU categories.

The diagram below shows the relationships between these entities:

As shown in the diagram:

  • A category (or subcategory) has courses. A course may be linked to multiple categories.
  • A course has lectures.
  • A lecture can also be linked directly to one or more categories.

The following sections explain how to retrieve information about YouTube EDU categories and also define the different types of feeds that the API supports for retrieving course and lecture information:

  1. Categories
  2. Courses
  3. Lectures

Categories

The YouTube EDU category file, an XML document that can be downloaded from http://gdata.youtube.com/schemas/2007/educategories.cat, identifies the subjects that can be used to categorize courses and lectures.

The excerpt below shows the beginning of the file, including the top-level category, which is named Primary & Secondary Education, two second-level categories (History & Social Sciences and Science), and three subcategories of the History & Social Sciences category.

<?xml version='1.0' encoding='UTF-8'?>
<app:categories xmlns:app='http://www.w3.org/2007/app'
                xmlns:atom='http://www.w3.org/2005/Atom'
                xmlns:yt='http://gdata.youtube.com/schemas/2007' fixed='no'
                scheme='http://gdata.youtube.com/schemas/2007/educategories.cat'>
  <atom:category term='1' label='Primary &amp; Secondary Education' xml:lang='en-US'/>
  <atom:category term='2' label='History &amp; Social Sciences' xml:lang='en-US'>
    <yt:parentCategory term='1'/>
  </atom:category>
  <atom:category term='3' label='Economics' xml:lang='en-US'>
    <yt:parentCategory term='2'/>
  </atom:category>
  <atom:category term='52' label='State &amp; Local History' xml:lang='en-US'>
    <yt:parentCategory term='2'/>
  </atom:category>
  <atom:category term='143' label='Geography' xml:lang='en-US'>
    <yt:parentCategory term='2'/>
  </atom:category>
  <atom:category term='4' label='Science' xml:lang='en-US'>
    <yt:parentCategory term='1'/>
  </atom:category>

As shown, an <atom:category> tag identifies each category.

  • The tag's term attribute specifies an integer that uniquely identifies the category.
  • The tag's label attribute specifies a display name for the category.
  • The tag's xml:lang attribute identifies the language (and locale) of the display name.
  • The tag's child <yt:parentCategory> element identifies the category's parent in the YouTube EDU category taxonomy.

Courses

A course is a series of lectures (videos) about a particular topic, such as U.S. Historical Documents. A course is associated with one or more YouTube EDU categories.

To retrieve a list of courses in a particular category, send a GET request to the following URL. Replace the string CATEGORY_ID with the category's unique ID from the YouTube EDU category file.

http://gdata.youtube.com/feeds/api/edu/courses?category=CATEGORY_ID

For example, to retrieve a feed of science courses accessible via YouTube EDU, you would retrieve a feed from http://gdata.youtube.com/feeds/api/edu/courses?category=4&v=2 since 4 is the unique identifier for the Science category.

Note: When you retrieve lectures in a particular category, the API will return lectures in that category or any of its child categories.

The XML below shows a sample course entry. Within the entry, the <yt:playlistId> tag specifies a value that YouTube uses to uniquely identify each course. That value can be used to retrieve the list of videos (lectures) that comprise the course.

<entry>
  <id>tag:youtube.com,2008:edu:course:456EDB14CBF90728</id>
  <updated>2012-07-10T08:30:17.322Z</updated>
  <category scheme='http://schemas.google.com/g/2005#kind'
            term='http://gdata.youtube.com/schemas/2007#course'/>
  <title>U.S. Historical Documents</title>
  <summary>Classic Literature VideoBooks with synchronized text ... .</summary>
  <link rel='self' type='application/atom+xml'
        href='http://gdata.youtube.com/feeds/api/edu/courses/456EDB14CBF90728?v=2'/>
  <media:group>
    <media:thumbnail url='http://i.ytimg.com/vi/5oaTVFfUz94/default.jpg'
                     height='90' width='120' yt:name='default'/>
    <media:thumbnail url='http://i.ytimg.com/vi/5oaTVFfUz94/hqdefault.jpg' 
                     height='360' width='480' yt:name='hqdefault'/>
  </media:group>
  <yt:playlistId>456EDB14CBF90728</yt:playlistId>
</entry>

Since a course entry identifies a YouTube playlist, that entry is nearly identical to the playlist entry for the same playlist. However, a course entry also might contain the following additional metadata tags:

  • A <link> tag specifies the feed URL that retrieves a list of the course's lectures. The tag's rel attribute value will be lectures.

    <link rel="lectures" 
          href="https://stage.gdata.youtube.com/feeds/api/edu/lectures?course=E18841CABEA24090"/>
  • For each YouTube EDU category associated with the course, the course entry contains one <category> tag.

    • The tag's scheme attribute value is http://gdata.youtube.com/schemas/2007/educategories.cat.
    • It's term attribute value is the integer that YouTube uses to uniquely identify the category.

  • Similarly, for each YouTube EDU category associated with the course, the course entry's <media:group> tag contains one <media:category> tag.

    • The tag's label attribute contains the display name for the YouTube EDU category.
    • The tag's scheme attribute value is http://gdata.youtube.com/schemas/2007/educategories.cat.
    • The tag's value is the integer that YouTube uses to uniquely identify the category.

  • One or more <media:credit> tags may identify the course's lecturer(s). If present, the tag's role attribute value is lecturer, its scheme attribute value is urn:youtube, and its value is the lecturer's name. An example tag is shown below:

    <media:credit role='lecturer' scheme='urn:youtube'>Professor Ed Copeland</media:credit>
  • One or more <yt:material> tags may be present. Each such tag identifies additional or related course material and a URL where that material can be accessed. For example, <yt:material> tags can identify lecture notes, sample exams, or supplemental reading. An example tag is shown below:

    <yt:material description="This file contains solutions for quiz 1 questions."
                 name="Quiz 1 (solution)" type="exam"
                 url="http://www.example.edu/courses/1234/exams/q1_sol.pdf"/>
      

Lectures

A lecture is a YouTube video that is either part of a course or is connected to one or more YouTube EDU categories. The API supports two ways to retrieve a lecture feed:

  • To retrieve the lectures for a given course, send a GET request to the following URL. Replace the string COURSE_ID with the <yt:playlistId> that uniquely identifies the course.

    http://gdata.youtube.com/feeds/api/edu/lectures?course=COURSE_ID
  • To retrieve a list of lectures in a particular category, send a GET request to the following URL. Replace the string CATEGORY_ID with the category's unique ID from the YouTube EDU category file.

    http://gdata.youtube.com/feeds/api/edu/lectures?category=CATEGORY_ID

    Note: When you retrieve lectures in a particular category, the API will return lectures in that category or any of its child categories.

Since each lecture entry identifies a YouTube video, a lecture entry is nearly identical to the video entry for the same video. However, a lecture entry might also contain the additional metadata tags listed below. A feed listing all of the lectures for a course also might contain these tags.

  • One or more <category> tags identify the YouTube EDU categories associated with either the lecture or the lecture's course.

    • The tag's scheme attribute value is http://gdata.youtube.com/schemas/2007/educategories.cat.
    • It's term attribute value is the integer that YouTube uses to uniquely identify the category.

  • Similarly, one or more <media:category> tags identify the YouTube EDU categories associated with either the lecture or the lecture's course.

    • The tag's label attribute contains the display name for the YouTube EDU category.
    • The tag's scheme attribute value is http://gdata.youtube.com/schemas/2007/educategories.cat.
    • The tag's value is the integer that YouTube uses to uniquely identify the category.

  • One or more <media:credit> tags may identify the lecturer(s). If present, the tag's role attribute value is lecturer, its scheme attribute value is urn:youtube, and its value is the lecturer's name. An example tag is shown below:

    <media:credit role='lecturer' scheme='urn:youtube'>Professor Ed Copeland</media:credit>
  • One or more <yt:material> tags may be present. Each such tag identifies additional or related course material and a URL where that material can be accessed. For example, <yt:material> tags can identify lecture notes, sample exams, or supplemental reading. An example tag is shown below:

    <yt:material description="This file contains solutions for quiz 1 questions."
                 name="Quiz 1 (solution)" type="exam"
                 url="http://www.example.edu/courses/1234/exams/q1_sol.pdf"/>
      
pagination links

« Previous
Movies, Trailers, and Shows
Next »
Adding a Rating

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.