I am looking to find a way to work with a particular channel on youtube
I want to be able to receive a list of videos in that particular channel in xml format
also would like to be able to receive the latest video or couple of videos
I searched through the youtube API but didn't find exactly what I need.
Found the solution
http://gdata.youtube.com/feeds/api/users/[Channel or User]/uploads
you receive a XML with 25 newest videos along with all their information
also all the attributes and more documentation can be found here
[http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Retrieving_and_searching_for_videos][1]
Related
i trying to know if my channel is streaming on youtube. I'm using the youtube api v3 with the php library.
I'm able to get the last broadcasts with liveBroadcasts.list but when I start streaming with OBS I put the parameters broadcastStatus = active and nothing is returned.
I also tried with liveStreams.list but I still get nothing. I don't know what I'm doing wrong, can someone explain me please ? :D
Try to use the search.list, Here you can set the optional parameters to search what you need. Like the channelId, eventType that you can set to live to include active broadcast, and type parameter that restricts a search query to only retrieve a particular type of resource.
Read the other parameters to know more about its purpose and description.
For more information you can also check this SO question:
Using YouTube API v3 to tell if a channel has a live stream
How to check if YouTube channel is streaming live
The request url is :
GET https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id%2Csnippet%2Cstatus&mine=true&broadcastStatus=active&key={YOUR_API_KEY}
you should receive :
{"status":{ "lifeCycleStatus":"live"}}
You can use the search API - something like this:
https://www.googleapis.com/youtube/v3/search?part=id&channelId={CHANNEL_ID_YOU_WANT_TO_QUERY}&type=video&key={YOUR_API_KEY}&eventType=live
However, this might take 3-5 minutes before it shows the Video ID of broadcast video after the broadcast has started. This has been discussed in another StackOverflow Question: Using YouTube API v3 to tell if a channel has a live stream
I want to display youtube videos for particular channel in XML format.
This is the channel for which I want to retrieve videos:
https://www.youtube.com/channel/UCxiaIKXjo25U1AMCBAcplRQ
can anyone suggest how can i get XML format video listing for particular channel from youtube.
I just want URL for which i can get what i want.
I can write PHP code to use XML retrieved from youtube API URL.
Here is the URL for API that you need to use for your purpose. hope it helps.
http://gdata.youtube.com/feeds/api/users/UCxiaIKXjo25U1AMCBAcplRQ/uploads?max-results=2
I noticed some inconsistencies between the data retrieved via the Youtube API v3 and what Youtube shows accessing directly the website.
Sometimes, the data returned via the playlistitem list contains a lower number of items (videos) than the playlist shown in the website.
This happens when the playlist contains deleted videos. In fact, at times, a video marked as deleted on youtube's playlist, it is still reported in the returned data of a playlistitems call, other times it is not, leading to a playlist having 2 different sizes (i.e. 20 videos on the website and only 18 returned via the api).
This is puzzling for my users when they compare the playlists on youtube and in my application, as they see 2 different results...
Anyone knows how to handle playlists with deleted videos? Or how to retrieve the same data as it is shown in the website?
I'm using php and youtube v3 apis and youtube's php libraries if it is relevant.
I think it is a bug in the YouTube API version 3.
You should check if it is already reported as a bug and if not you can file it yourself here:
https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube
if you decide to file it as a bug you should mention a playlistID that shows the problem.
I have noticed it too. However, it does not bother me.
In my case:
Using API version 3. The response is missing one or more items.
Missing playlist items always appear as DELETED on youtube.com
It happens on some playlists but not all.
The playlist is PUBLIC and contains only videos from other channels.
In a PHP system, my client suggested to download videos AND MAINLY captions from YouTube using the following tools:
cclive
gcap
As I have never heard of these before, my question is does anyone have any experience with them? Both projects seem to be inactive for like one year or so... Do they still work?
Is it possible to download captions for any YT video with them? I have stumbled upon some YT API info that the captions are not available for unauthorized users (i.e. you can only get your own captions if you are authorized with the API)?
Caption tracks can only be accessed via the Data API by the authorized owner of a given video.
The official YouTube Players can access caption data, but they use a different mechanism for accessing that data which is not part of a public API.
What I want to do is, to show uploaded videos list of my youtube channel to website's visitors.
Something like that. (Image take from youtube channel, I want to show exactly this way)
Don't want to create iframe. Can I fetch data from channels exact page with PHP or something else? I have no idea if it's possible with youtube api. Any suggestions?
Yes you can. The videos on a channel are essentially a user's so using the YouTube GData API you can make a call to http://gdata.youtube.com/feeds/api/videos?author=ahmednuaman (my videos for example).