Thursday, March 28, 2013

YouTube API with .NET
How to get started with YouTube API?

One of the most successful and popular service offering from Google is YouTube. YouTube provides a great platform to watch and upload videos. It also provide live stream of events currently happing across the world. As a developer, we love to integrate YouTube videos, statistics and feed to our website or applications. In this series of YouTube articles we will learn how we can read different type of feeds or statistics provided by YouTube and how we can integrate them in our applications.

YouTube provides YouTubeServices which offer different kind of feeds to the developer community. A Feed is nothing but a data format used for providing information and it gets updated frequently. YouTubeServices provides many type of feeds such as Video feeds, user playlist feeds, Video comments feed, user subscription feeds, user contacts feeds etc. All the feeds can be classified mainly into two types of feeds.

       
  1.   Public Feed
  2.   Private Feed

A Public feed is one that is available in the public domain. For example, a list of most popular videos or top rated videos is a public feed. Any video that is available on YouTube and its metadata like number of views, comments on a specific video are example of public feeds. Any application can request for a public feed from YouTubeServices and use the received feed to show it to application users.

A Private feed is one that is related to a specific user and only that specific user can access it. For example a YouTube user can tag some of videos as his or her favorite and mark it as Private. So the private marked favorites are not accessible in public domain. Any user can authorized a request to read his or her private feeds.

YouTube feeds are updated periodically which range from every 30 to 40 minutes to daily or hourly. Some of the feeds are updated on weekly and monthly basis.

How to read YouTubeServices Feeds?

To read YouTubeServices feeds using .NET a developer need to follow below steps:

  1.   Google UserID/Password: To read a YouTubeServices feed a developer need to have a Google user id and password.
       
  2.   Developer Key: A developer has to initiate a request to YouTubeServices. All requests that go to YouTubeServices should be authenticated. To authenticate a request a developer need a developer key which identify the requestor to YouTubeServices. To get a developer key you can navigate to Google API Console. You need to create a new project and click on API Access. You will find the client id and developer key on the screen.
       
  3.   Google Data API: A developer need to download and install Google Data API which provides a set of libraries to interact with different Google services such as SpreadSheet, Picasa, Analytics, YouTube etc. Google Data API is available in different flavors such as Java, .NET, Python etc. To download .NET client library of Google Data API you can navigate here.
       
  4.   Ms-Visual Studio: To read YouTube feeds using .NET a developer need Microsoft Visual studio. You can use Visual Studio 2005/2008/2010 or whatever is available to you.

Once you complete all the above steps you are ready to read YouTube feeds. In the next article we will learn how we can read a public feed like most popular feed.

Reference: Developers Guide: YouTube

Popular Posts

Real Time Web Analytics