I need to get the video/playlists/show data from youtube.com.
Example :
http://www.youtube.com/channel/SWMb9NxQL9I6c
http://www.youtube.com/show/mtvroadies9/featured
Is there a way I can get the video details for the above URL using the youtube API?
Yes, using:
https://developers.google.com/youtube/v3/docs/channels
e.g.
https://www.googleapis.com/youtube/v3/channels?part=snippet&id=SWMb9NxQL9I6c&key={YOUR_API_KEY}
You need to look at the YouTube Data API. You will find there documentation about how the API can be accessed. You can also find client libraries.
You could also make the requests yourself. Here is an example URL that retrieves the latest videos from a channel :
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20"
Related
I am trying to fetch metrics like views, likes, dislikes for videos in some popular public Youtube channels and also subscription information of the Channelsa on a daily basis. Also, country wise stats and gender wise stats for the channels required. But, Youtube Reporting API always prompts authentication. Is there any way to fetch those metrics for public Youtube channels without user authentication?(https://www.googleapis.com/youtube/analytics/v1/reports - need to use this API). Your suggestions will be very helpful.
For some of read-only requests you can just use access token without need to authorize. Check the documentation. Each request's documentation tells if authorization is needed.
The API you linked to is part of the "YouTube Analytics and Reporting APIs", which is split up in these very two pieces - analytics and reporting. I don't see why you need to use this exact API, but I can tell you that you won't succeed with it. This API is intended for channel owners and network owners to get information about their own channels. You absolutely have to authenticate via OAuth in order to use it, there is no way around this.
In order to get video and channel metrics, you can consult the YouTube Data API. Here, an API key from the Google Cloud Console will let you fetch any public data without further authentication. But it will not provide you with data records in specific periods of time, it always returns the current values of the requested properties.
In other words: what you are asking is, as far as I know, impossible to achieve with any official YouTube API.
A workaround for your problem would be to fetch the desired properties via the Data API on a, say, daily basis and compare their values to the previous day's values and calculate the delta.
My company runs a live web stream and has started duplicating this to YouTube. Unfortunately the staff won't check if it's live and internet issues cause our web encoder to stop encoding at times.
Is there a programmatic way I can tell if a channel is ACTUALLY streaming? i.e. if live video is coming out the channel and not just that "the channel is live"?
You may use Search: list.
Using this request returns a collection of search results that match the query parameters that you have specified in the API request. Add part=snippet in your request since this is a required parameter. Then, you may add the following optional parameters with their corresponding values in your HTTP request:
channelId=[channelId] - to search resources created by a particular channel.
type=video - to retrieve a particular type of resource
eventType=live - to return only active broadcasts. Please note that if you use eventType, also set the type parameter's value to video.
Combining all of these parameters, you may send HTTP request using the following format:
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCXswCcAMb5bvEUIDEzXFGYg&type=video&eventType=live
To better filter your search, you may also opt to add more parameters that are listed in supported parameters.
Lastly, solution in this related SO post - How to check if YouTube channel is streaming live might also help.
SoundCloud's API has a nice endpoint for submitting a permalink and getting back information about the media there.
Given the many YouTube URL variants (i.e. http://www.youtube.com/watch?v=-<someID>, http://youtu.be/-<someID>, http://www.youtube.com/v/-<someID>?version=3&autohide=1, etc...) is there a way to request a Video Resource given a URL?
You can use Videos: list which returns a list of videos that match the API request parameters.
HTTP request:
GET https://www.googleapis.com/youtube/v3/videos
You can also add query parameters and additional properties in your HTTP request for multiple video resources properties as given in the documentation.
Sample requests to the YouTube API are shown in Sample API Requests.
https://www.googleapis.com/youtube/v3/videos?part=snippet&id={VIDEO_ID}&key={YOUR_API_KEY}
I am trying to make a certain request work via the Dailymotion API, for work. Our client is a Dailymotion Partner who asked us to do 2 things from our application :
Generate a XML file to MRSS-upload their videos on Dailymotion (but we do not do the actual uploading, only the XML file creation)
Later, once they have uploaded their video, we have to get its Dailymotion ID (for logs necessities).
The thing is that this process has been developed circa 2012, and not fully tested. My job today is to make sure the process works now for good. In order to get the ID, we have been using this request:
https://api.dailymotion.com/video/PARTNER_NAME:GUID?fields=id
but I can't find any mention of "partner" and "guid" in the Dailymotion Documentation today. All I know is that we use the name of the channel as PARTNER_NAME and the guid we put in the XML file as GUID.
The thing I don't understand is that:
sometimes, the request does succeed and I get the ID,
most of the time, I get alternatively "400" and "403" errors from the API.
First, I tried to set the attribute "private" in the XML file to 'false', and it helped get the ID of some videos imported as public, but it does not do the trick for all videos.
Could someone show some light on this matter?
I am trying to filter tweets from the Streaming API using a url in the track parameter. However I'm not getting the tweets I expect. My suspicion is that the filter doesn't apply to the expanded url and but to the automatically shortened url (t.co).
Can anyone confirm that this is the case? The Streaming Api docs don't even mention how the filtering is applied.
If this is the case does anyone have a workaround?
I'm using the extended URL with cURL. I get the live tweets on my terminal for a particular search parameter. You may like to look into this one.
curl https://stream.twitter.com/1/statuses/filter.json?track=SEARCH_PARAMETER -uUSERNAME:PASSWORD