Youtube V3 Data API

977 Views Asked by At

I would like to know a very simple way of getting the list of videos that were uploaded by user/or videos in a channel.

For example, I want to retrieve basic information about videos those were posted in the Youtube spotlight channel (http://www.youtube.com/user/YouTube/videos). All I need is read-only publicly available information.

I am so lost with the Youtube v2/v3 API / Google APIs etc. I could partially make one example work but I think all the examples are heavily biased towards "third-party" access. I started developing one example by looking at their samples and when I compiled and ran the application - it was asking me to sign-in to my google account.

Any help is greatly appreciated. Thanks.

1

There are 1 best solutions below

0
meda On

For the sake of simplicity you can use the api v2 like this:

const string channelName = "YourChannel";
var URL =string.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads",
                                                                    channelName);
using (var reader = new XmlTextReader(URL))
{
    while (reader.Read()) 
    {
        if (reader.Name.Equals("media:player"))
        {
                string attribute = reader["url"];
                if (attribute != null)
                {
                    Response.Write("Youtube Video Link" + attribute + "<br />");
                }                            
        }
    }
}

You can achieve similarly using v3 but It will require some more work