I could see that in the past, we could retrieve for example the most viewed Youtube videos using this link (http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed)
But I think that link no longer works.
So I don't know how to retrieve the most viewed, most liked Youtube videos, search for a video using keywords...
I tried to watch directly on "https://developers.google.com/youtube/v3/docs/videos" but without any success
So I found this link which allows to retrieve the info of the videos thanks to a Youtube api key and one or more search keywords
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=10&order=relevance&q=KEYWORD&key=APIKEY
Related
I am trying to get a specific comment from a YouTube video. For example I want to get the details from the 34th comment of a YouTube video. Does anybody knows how can I do this without reading all the comment list?
Or if there isn't available any solution for retrieving only one comment, can you get a list with all the comments from a YouTube video? (I used the API method commentThreads but it has a limit of 100 comments within a call).
Btw, I read this How to get a specific comment of a youtube video? , but maybe the answer is outdated.
Just use https://www.googleapis.com/youtube/v3/comments to get specific comment from a video like
https://www.googleapis.com/youtube/v3/comments?part=snippet&id={COMMENT_ID}&textFormat=html&key={YOUR_API_KEY}
Use the ID that is specific for every comment and the API Key on your Google Developer Console. You can get the commentID clicking on the timestamp link beside the commenter's name.
I've been searching for this a lot but have not found exactly what I'm looking for.
So, I have a page (index.php) which displays my YouTube channel's uploaded videos as thumbnails, and either displays them inline above the thumbnails, or as links that redirect to Youtube. What I'd like to do, is to get the video's ID (which is in the a href link) and post it to another page (video.php) that shows the full embedded video (of the ID in question), with title & description. Is this possible to do?
My site is loosely based on this: http://www.yvoschaap.com/youtube.html and I've tried Youmax, but like said, they only play videos inline. I want to pass the ID of a clicked video as a parameter to the video.php page.
Sorry if this is confusing, but I'm still quite new to programming :)
You can look into Youtube Data API.
The main link you will need to retreive a list of all Videos for a channel will be somewhat like:
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults={number_of_videos_you_want}
It will recieve it's response in JSON Format containing information like your Video ID which you can pass as Parameter to your video.php page
What I'm trying to do is get the exact look of the videos on the youtube homepage (image: click here) including the time-stamp.
If you look in the source code, you'll find a link to the image of the video, however, I can't quite figure out how to get the time-stamp of the video and format it exactly how youtube has it simply from a youtube link (in this case: http://www.youtube.com/watch?v=IpBNr-oNT1g). I take it this would be done with PHP, but how?
Thanks!
http://itwigle.com/twig/Capturing_video_thumbnails_with_PHP
is this what you're looking for?
Perhaps I am missing something but how does one go about retrieving the xml feed of videos from a single YouTube playlist. I have tried all the ways listed on google and so on but they keep returning an invalid playlist if error even though the id is exactly the one in the youtube url that works on youtube.
Thanks
You can get listing of user's public playlists at:
http://gdata.youtube.com/feeds/api/users/username/playlists?alt=rss&v=2
And you can get xml data for an individual playlist by at:
http://gdata.youtube.com/feeds/api/playlists/AA8A0579E8329C7A?alt=rss&v=2
replace AA8A0579E8329C7A with the playlist-id you want.
I've been working with a couple of API's before like Vimeo, Dribbble and Twitter. Now I am trying out YouTube's API. But the complexity of the API gets me lost.
I've been going through parts of it and reading up on a couple of tutorials but can't seem to find what I want.
They say something about zend_gdata but I don't understand what that has to do with YouTube's API and can't seem to get it work either.
This is what I want to accomplish:
Get video data for each video from [playlist] by [user]:
Video poster (big thumbnail)
Title
Description
Embed code (iframe probably)
I am using PHP and prefer an output in JSON.
Can you guys point me out where to start (tutorial, which API, ...) to accomplish this rather simple task?
EDIT
Example for Vimeo: http://vimeo.com/api/v2/channel/52750/videos.json
Which URL can I CURL for YouTube to get al videos in a specified playlist?
From Data API Protocol site:
As noted in the previous section, each entry in a user's playlists feed contains a tag that specifies the URL for retrieving the list of videos in the playlist. The following example shows the URL for retrieving a playlist as that URL appears in a playlists feed entry:
<content type='application/atom+xml' src='http://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2'/>
So the url is something like this:
http://gdata.youtube.com/feeds/api/playlists/PLAYLISTID?v=2
Update
For JSON format, add &alt=json GET parameter at the end of the url:
http://gdata.youtube.com/feeds/api/playlists/PLAYLISTID?v=2&alt=json