I'm looking to get the title and duration of a YouTube video and display it within my app. I want to do this dynamically since there will be several videos and they will change. I've looked for a URL that provides this information, but I've had no luck. Does anyone know a way to do this?
You need to use the Youtube API, details on how to do this for a single video are here:
https://developers.google.com/youtube/2.0/developers_guide_protocol_video_entries
Here's the URL to get the API data for Friday:
https://gdata.youtube.com/feeds/api/videos/kfVsfOSbJY0?v=2
Related
Good morning
I am using the youtube api to get the latest videos from a channel, but I also get the short videos that are like instagram or tiktok reels, is there any way to not get these videos?
I leave the endoint I am using
https://www.googleapis.com/youtube/v3/search?channelId=${channel_id}&part=snippet,id&order=date&maxResults=${totalVideos}&key=${API_KEY_YOUTUBE}
Greetings and thank you
If you check the Search.list method you will notice that it does not have any way of limiting the data that is returned.
You will need to remove these locally.
It may be worth adding a feature request to the issue forumn
Here is a link to video which does not work
https://www.youtube.com/watch?v=abEOkul6HEx
How I can programatically detect this ?
The scenario would be to monitor a list of youtube videos and detect if a single video was deleted or is no longer available
Any ideas ?
You can use following youtube v3 API GET request
https://www.googleapis.com/youtube/v3/videos?part=id&id={VIDEO_ID}&key={YOUR_API_KEY}
In the results check for pageInfo.totalResults attribute
Update
If you want to pass multiple video ids in one API, it also can. id={VIDEO_ID1},{VIDEO_ID2}. In this case you can't depend on pageInfo.totalResults you have to go through items[].id decide.
I know about how to play video in device. But Here I just want to know that is it possible to get streaming URL from any YouTube Video? Then how can I do it, I tried to search on google but I can not able to find my solution.
Generally I does not want to play direct stream from video, actually I want to save this URL (stream) in my buffer memory OR whatever temporary file and whenever user click on particular button then particular URL Stream is play.
Al Last I got YouTube APIs + iPhone = Cool mobile apps. But I am not sure that it's helpful in my case or not ? If anybody who worked on this API then please suggest me, Otherwise How can I get streaming URL.
Your suggestion will be appreciated.
Thanks in advance.
http://www.youtube.com/get_video_info?&video_id={VIDEO_ID}
This will not work on all files, some will display the message "This+video+contains+content+from.....". But many will work.
Is it possible to get streaming URL from any YouTube Video? - No, it is not possible without hurting the terms of service of youtube. Google has built the business model of youtube around the advertisements all over youtube, in-video banners and video ads and they want your user to see their ads. This is the reason they completely hide the video stream and would ban your app if you anyway access and stream it directly.
The only consented way to play youtube videos on iOS is to embed it into an iframe of a web view.
I am trying to add some youtube videos from my Admin page to database. So that mobile application can make use of them to play.
I want to filter the result from YouTube API link so that i can make sure that whatever videos i add to the database will be able to play on mobile devices like IOS and Android.
I tried
&format=5 and &format=1
but no use.
I also went through Youtube API v2.0 Docs but unable to find the correct way to assign fields parameter to my query string
can anyone guide me to fix this?
What you need is videoEmbeddable and videoSyndicated.
Here's my answer to original question: retrive only mobile-supported video from YouTube API
based on http://youtubecreator.blogspot.com/2012/08/tags-removed-from-video-watch-pages.html, youtube has made media:keywords element empty in youtube api as well.
However, it is important for my application to scan through the tags/keywords. Is there an alternate solution for me to get the tags/keywords for a video?
This blog post gives information relevant to developers: http://apiblog.youtube.com/2012/08/video-tags-just-for-uploaders.html
You can get the tags if you're authenticated as the owner of the video. Otherwise, no, it's not currently possible.