What is working: getting the latest videos from the uploads playlist in a channel.
What is not working: getting the latest videos from a specific playlist in a channel. With "specific" i mean playlist like this one here:
http://www.youtube.com/user/fckoeln/videos?tag_id=UCQZhvmm636X6I5rrnLFBp1w.3.netcologne-fc-tv-star-talk&flow=grid&view=46
For example the playlistId for the uploads playlist is "UUQZhvmm636X6I5rrnLFBp1w" and that works.
Now i assumed the playlistId for this specific playlist would be "UCQZhvmm636X6I5rrnLFBp1w.3.netcologne-fc-tv-star-talk", but it's not working.
I'm also not able to get the playlistId for this by querying for the contentDetails of the channel, this playlist doesn't exist there.
Anybody has an idea?
I am banging my head against the wall, because this is the first time I've seen a playlist in the above format (with tag_id= in the URL), usually a playlist would have the url of something like this: youtube.com/playlist?list=UCQZhvmm636X6I5rrnLFBp1w, however your above example has too many chars for a playlist id (which is 16 chars strictly).
I wasn't able to find anything in the Youtube API documentation in regards to that tag_id query.
Obviously, you'd want to return results similar to a list like this: gdata.youtube.com/feeds/api/playlists/BK6tyexCQakO9SGMFiv_GJYvc61eQ7yX?v=2&max-results=50&orderby=position
like a normal playlist, but I saw nothing in the YouTube API to find the ID of this type of playlist (which, again first time I new this type existed).
Sorry I couldn't be more helpful and hopefully you can find a solution. I tried lookign at the Youtube API reference to see if there was a way you could query the results from your request from the User Account (something like gdata.youtube.com/feeds/base/users/fckoeln/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile&q=%22netcologne-fc-tv-star-talk%22 but not as idiotic) but nothing was readily apparent from the documentation
https://developers.google.com/youtube/2.0/reference
Related
Does anyone know how this website is able to get historical views data for YouTube playlists?
From my research, YouTube API doesn't even let you get the current playlist views (I might be wrong).
I am talking about the playlist views, not the views from videos that were added to the playlist (you can see the view count here for example, on the left side - on desktop).
How can we get access to this type of data?
One more time YouTube Data API v3 doesn't provide a basic feature.
I would recommend you to use my open-source YouTube operational API. Indeed by requesting the JSON document https://yt.lemnoslife.com/playlists?part=statistics&id=PLAYLIST_ID containing item["statistics"]["viewCount"] integer, your problem is solved.
You can request up to maxResults (currently 50) playlists separating playlist ids by a comma in id, example: https://yt.lemnoslife.com/playlists?part=statistics&id=PLAYLIST_ID_0,PLAYLIST_ID_1,...,PLAYLIST_ID_49
You can also request the title of the playlist by adding snippet to part, example: https://yt.lemnoslife.com/playlists?part=snippet,statistics&id=PLAYLIST_ID
I would like is to be able to search youtube for any given keyword or Channel, and for the results to show in a list basic information about the video, including video title, number of views, number of comments, when the video was posted and which videos are currently monetized. What I would then like to be able to do is create a list of all the monetized videos along with the URL's..
Can anyone knows how to do it?
I don't see any documentations regarding your concern. I only checked on this documentation that you can only get a list of videos that match the API request parameters using Videos: list. You can only get channelId, title, description, tags, and categoryId. You may check this thread on how to check monetized and non-monetized videos from my YouTube channel. You may also read this Monetization Guidelines from YouTube.
I'm building a tool to help creators improve their Channel's activity/revenue/visibility/whatever.
One of the checks is about the videos being or not into a playlist.
For what I can see I can get the list of most recent video uploaded with the search.list then I thought to just call the playlistItem.list to verify if there is a match passing the videoId but instead I see that I need to pass a playlistId too at least. So this is not viable.
The only way seems to get all the playlist of the channel (playlist.list) and then get the last N items of every Playlist (with playlistItems.list) and then run some verification of these results locally.
Is this really the best possible solution?
I want to output last videos and popular videos of my youtube channel.
Is there any standart widget, api method for this?
Based on this answer, you can use the YouTube Data V3 API to get the uploads playlist ID, which you can then use to get the latest videos in that playlist. You can change the value of maxResults to return however many videos you want (from 0 to 50).
Use the search:list method to get your most viewed videos by specifying the channel ID and setting order=viewcount (not quite sure what you want when you say popular videos, you could also set order=rating to get the highest rated videos). This video might also help you out.
Since the old feed on http://gdata.youtube.com/feeds/api/videos?author=[channel]&start-index=[index] is no longer available, I had to switch to the official YouTube API to get a list of all videos present on a channel. However, I've ran into the issue that this API does not return the right videocount on a channel. This also leads to being unable to use the pageToken, as none is returned.
The expected result is to have a an amount of 159 videos in total, however, at around 50% the API tells me there are only 16 videos.
I'm using the following url:
https://www.googleapis.com/youtube/v3/search?key=*****&channelId=UCsuBLfTDK4Hjn9Q6AYPwGqQ&part=snippet,id&order=date&maxResults=25
As 16 is lower than the max amount of results per request, I wont have a nextPageToken half of the time which I need to paginate and get a list of every record, making this API completely useless in production..
Is there anything I can do to resolve this issue, or is this a problem that lies on the YouTube side? Or is there anything else I can use as an alternative? All I need is the video IDs of every video on a certain channel.
First, get the ID for your uploads playlist:
GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=CHANNEL_ID&key=API_KEY
The ID should be under 'uploads'.
Then, you can use the playlistItems list method:
GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PLAYLIST_ID&key=API_KEY
and get the number of videos from totalResults.
Alternatively, you can use the code from the playlistItems documentation
to get a list of the uploaded videos.