How YouTube's API Works
YouTube's API is a REST service that uses Google's Gdata format to enable you to perform operations such as searching for and retrieving information about videos as well as uploading videos to YouTube.
Unlike other services, such as those from Live.com or Amazon.com, you do not need to sign up for a developer account or an API key to read data from YouTube's API. Figure 4-4 shows the results from retrieving the top rated videos of all time on YouTube using Firefox.
Note
For full documentation on what services are available from YouTube, go to http://code.google.com/apis/youtube/developers_guide_protocol.html.

Figure 4-4. The raw XML from YouTube's API
Standard YouTube Feeds
If you look closely at the URL in Figure 4-4's image, you'll notice that the Top Rated video feed is a "Standard Feed." YouTube defines a number of standard feeds, including:
You can further restrict the results from standard feeds by appending a time parameter to the query string. For example, this parameter will only retrieve the most viewed videos this week:
http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed?time=this_week
The time parameter can have the following values: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access