Hvezdar2012 Posted July 29, 2020 Share Posted July 29, 2020 Hello, I have a little problem I want to make a page linked to youtube, but I can't figure out how to set the latest video from that channel to appear, can anyone advise me? thanks. Link to comment Share on other sites More sharing options...
Makwana Prahlad Posted August 20, 2020 Share Posted August 20, 2020 First, you need to get the ID of the playlist that represents the uploads from the user/channel: https://developers.google.com/youtube/v3/docs/channels/list#try-it You can specify the username with the forUsername={username} param, or specify mine=true to get your own (you need to authenticate first). Include part=contentDetails to see the playlists. GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=jambrose42&key={YOUR_API_KEY} In the result "relatedPlaylists" will include "likes" and "uploads" playlists. Grab that "upload" playlist ID. Also note the "id" is your channelID for future reference. Next, get a list of videos in that playlist: https://developers.google.com/youtube/v3/docs/playlistItems/list#try-it Just drop in the playlistId! GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=UUpRmvjdu3ixew5ahydZ67uA&key={YOUR_API_KEY} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now