How can i see all videos in a youtube channel? - youtube

I want to get all videos in a YouTube channel. Is there any way to do that? Can be with pagination, but I can't see any pagination (can't use ajax). I can get urls with PHP.

See the Developers Guide | Videos uploaded by a specific user.
For example the following code retrieves the list of videos uploaded by $userName. You have to page through the results.
function getAndPrintUserUploads($userName)
{
$yt = new Zend_Gdata_YouTube();
$yt->setMajorProtocolVersion(2);
printVideoFeed($yt->getuserUploads($userName));
}

Related

Search youtube channel for specific video id's

I have a large array of video id's. (Over 100) I need to determine which videos belong to the oauth'd user. Looking through the Youtube API docs it doesn't look like they have a way to get videos by ID for a channel. I see how to get all videos for a channel but that looks like it limits the results. Is there an efficient way to do this that I'm missing?
Ideally I'd like to say grab all videos with this id that belong to this channel. I'd accept a way to just get all videos for the users channel so I can compare the array of videos with my array of id's.
Using Laravel socialite and the PHP google api client.
You can either
Get videos by IDs using the videos:list API endpoint. The id parameter takes up to 50 comma-separated videoIDs.
or
Get all videos in a channel using the channels:list API endpoint. The id parameter takes up to 50 comma-separated channelIDs. Each page of results has up to 50 videos.
If you already have the videoIDs, option 1 would be best.
I have figured it out if you want to get the video with particular video id
https://www.youtube.com/watch?v=hcMzwMrr1tE
if you want the thumbnails for the particular video
https://storage.googleapis.com/yt-trends-top-ten-lists-2022/thumbs/**hcMzwMrr1tE**.jpg
put the video id you will get the details you can use google api like this

YouTube API: why can't I see latest video for this channel?

The latest video for this channel shows up when viewed via the Youtube website:
https://www.youtube.com/user/stefbot/videos
(video ID a4pPLwAL_Qo)
However that video does not get returned when the channel is queried via the Youtube API. I retrieve the channel video list by making a call to channels, followed by a call to playlistItems e.g.:
https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=stefbot&key=xxxxxxxxxxxxxxxxx
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UUC3L8QaxqEGUiBC252GHy3w&key=xxxxxxxxxxxxxxxxxx
See playlist response JSON here
It has been more than 24hrs since this video was posted. Can someone explain why the API would not be returning the latest video for this channel?
Based from this support page, it can take a few days for uploaded videos to be reflected in YouTube search results, especially if you recently changed or removed your video. Also, you can use this reference and use Search: list to get the latest videos from user's uploads.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={CHANNEL_ID}&maxResults=10&order=date&type=video&key={YOUR_API_KEY}

Youtube data apis 3.0: how to get channel video urls using video.list api?

I am using youtube data apis 3.0. I want to get the NDTV channel videos to publish in our site.
I can get the list of videos description and some other basic info, but I want information like file details, ratings, liveStreamingDetails, player, processingDetails, recordingDetails, statistics, status, suggestions, topicDetails etc...
can any one please help me?
This is the way to grab the last 50 (maximum allowed) videos of a user with Youtube with Api 3.0
//search channels of user
https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername={USERNAME}&key={KEY}
//search playlist items of upload channel
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId={PLAYLIST}&key={KEY}
//search videos of the playlist items of the upload channel
https://www.googleapis.com/youtube/v3/videos?part=id,snippet,contentDetails,status&id=BBfPP0rTjxo,o04cSB5afGc&maxResults=50&key={KEY}

YouTube API- retrieve all comments text on each video

I am using YouTube API to fetch user feed and all video details.
Eg : Number of likes,number of dislikes.etc. Number of comments on video is correct but while I am fetching all the comments data found nothing.
Thanks.
The correct URL to request is http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/comments?v=2 (with any other parameters you want).
E.g. http://gdata.youtube.com/feeds/api/videos/fhWaJi1Hsfo/comments?v=2&alt=json&prettyprint=true returns the comments feed for video id fhWaJi1Hsfo, and I do see the content of the actual comments in that feed.
If you're not able to successfully reproduce that with a specific video id, could you let us know which video you're having trouble with?

Youtube get videos and playlist accounts

I'm creating a media house mock app and am wondering whether there is a way I can get video playlists from a certain account which is not mine for example if a user has a page that is http://www.youtube.com/someuser is it possible to get all the videos and playlist from that user?
You can use youtube video feeds(Youtube RSS Video Feeds)
Make following requests using GET and read the xml data returned.
http://gdata.youtube.com/feeds/api/users/{{username}}/playlists - For playlists
http://gdata.youtube.com/feeds/api/users/{{username}}/uploads - For uploads
Orderby parameter can be used to change order of videos.

Resources