I want to get related videos on Youtube when user enters the video id on my system. But system will work like this:
User will enter video id
System will find related videos of the video that user entered.
After that, system will choose one of the related videos and start to get that video's related vids list.
System will repeat this for 10 times.
And will show to user last video.
So, my problem is getting first video's related video and after last video's, after last video's etc... And my aim is try to find the journey from first video to last video.
How can I do this?
You can do this via search->list method specifying relatedToVideoId.
You can use PHP API client.
Here is a similar sample. https://github.com/youtube/api-samples/blob/master/php/search.php
Related
I'm using Youtube API v3 to upload video. At the first time I use, it requires authorization then do upload but there are two videos is created. They are exactly the same but there is no error, the API returns the latest id. I checked in my channel, two videos could be view.
When I try to upload the previous video, another id returns, too, but if I use this, Youtube will show me "This video is a duplicate of another video". Other times, the API works right. Did anyone encounter this problem?
I'm trying to get the channel views of the logged in user, through googles' oauth2. I'm able to get name and email via this url: https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=[GENERATED TOKEN]
Now, I'm having a hard time finding any information about how I would go about getting the users channel views. I know you can get a list of videos and such, but how would I do this?
Is there an equivalent to the link I posted above? :)
You can do a channels->list
GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true&key={YOUR_API_KEY}
In response contentDetails.relatedPlaylists.watchHistory will have the playlist id of watched videos. You can iterate through that playlist with playlistItems->list.
GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2C+contentDetails&id={PLAYLIST_ID}&key={YOUR_API_KEY}
On a website, i use API Youtube with ZendGdata for retrieve all video of a user and create webpage with the video and his informations.
Now i need to add a system for like or dislikes video on my website, and i need to retrieve the number of likes and dislikes.
(Yes, there are 2 questions here^^)
So, i retrieve for example title with $videoEntry->getVideoTitle();, number of views with $videoEntry->getVideoViewCount(); but how i can retrieve number of likes/dislikes ?
And how i can vote for a video on my website ?
If you take a look at the videos resource in YouTube 3.0 API, among the values included are:
likeCount
dislikeCount
Full details here: https://developers.google.com/youtube/v3/docs/videos
If you're using the YouTube 2.0 API, then check out the <yt:rating> tag, which contains the following fields:
numLikes
numDislikes
More info here: https://developers.google.com/youtube/2.0/reference#youtube_data_api_tag_yt:rating
An update to Cormac answer is that youtube will remove this and you can use it for yourself only.
Note: The statistics.dislikeCount property will be made private as of December 13, 2021. This means that the property will only be included in an API response if the API request was authenticated by the video owner. See the revision history for more information.
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).
Is it possible to request all the videos associated with a face book account? So I can loop through and echo them to the page. Sort of like getting the json data of an album that has all the images within this album. I have been using [Facebook Graph API for Video][1]
[1]: http://developers.facebook.com/docs/reference/api/video/ as a reference.
I have it working for the albums and images so when a photo is added to face book it updates the website. Now I want to do the same thing for the videos.
Any ideas would be great.
Thanks!
It does not appear the Graph API offers access to a list of videos. You would need to use FQL
https://developers.facebook.com/docs/reference/fql/
And query the video table
https://developers.facebook.com/docs/reference/fql/video/
For videos owned by a user. Note you'd have to keep track of the last time you queried and limit your query only for videos with a created_time after the last time you checked.