I am trying to fetch YouTube videos based on keyword search.
https://www.googleapis.com/youtube/v3/search?part=snippet&q=eminem&key=YouTube-API-Key&maxResults=5
items[0].id.videoId and items[3].id.videoId do not exist. Instead they have channelId.
So why am I getting channelIds for non-existent videos ? Do I need to filter them manually or is it possible to filter them via the API ?
You have to request the id in the part parameter.
https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=eminem&key=YouTube-API-Key&maxResults=5&type=video
Related
Basically, I am tring to fetch a youtube account using search list function and it's giving me incorrect channel details in responce. I am using Youtube API V3 and the issue is with API only, I have tested the same with official documentation aslo and it doesn't return any responce either. Responce of API when tried with forUsername parameter
I want to fetch Youtube channel information e.g. total number of subscribers, language, info tab etc. What's the endpoint to do so if I have only my API key and channel id.
Figured out the answer, following is the API call to fetch channel information.
https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics&id=UCSJ4gkVC6NrvII8umztf0Ow&key=[API_KEY]
Google's API Doc
https://developers.google.com/apis-explorer/#search/youtube.channels.list/m/youtube/v3/youtube.channels.list
using of below link which i shared might be useful for your problem
https://developers.google.com/youtube/v3/docs/channels/list
I've got a YouTube user, which doesn't contain a YouTube channel. But the YouTube data API does return a channel, if I query the youtube.channels.list API method by using the "mine=true" attribute like in following example (1).
Example:
(1) Returns a channel (mine=true; by using OAuth):
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet%252CcontentDetails%252Cstatistics&mine=true&_h=5&
This query (1) returns a channel which contains a channelId. Now I'm trying to query for the playlists of this channel by using the previously returned channelId.
(2) Returns a 404 "channel not found" error
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.playlists.list?part=snippet&channelId=UCIReEy02ibumfYhQP3-0drQ&_h=4&
As described here it's possible to use a YouTube account without a channel but with limited functionality like using playlists:
With a Google Account, you can watch and like videos and subscribe to channels. However, without a YouTube channel, you have no public presence on YouTube. Even if you have a Google Account, you need to create a YouTube channel to upload videos, comment, or make playlists. You can use a computer or the YouTube mobile site to create a new channel.
What's the reason query (1) is returning a channel even if a YouTube account doesn't contain a channel?
BR
ninsky
[1] Returns a channel (mine=true; by using OAuth):
Because of every account on youtube itself a channel. They can do all the things they want like any channel can do e.g. upload videos. Also, we can make multiple channels under the same account.
[2] Doesn't return a channel (forUsername=UCIReEy02ibumfYhQP3-0drQ; by/without using OAuth):
Please make sure UCIReEy02ibumfYhQP3-0drQ is a valid username
I'm building something with the YouTube API. I've found a few oddities so far. The first thing is that a channel can have a title of 'blah blah - Topic' so you probably want to screen those out if you want to retrieve channels with their own content. If I'm right in my thinking, these are just channels with Playlists. Example: https://www.youtube.com/channel/UC6tQSWkTxbPNaJ_LQ-Ia6jQ/
Also be aware that channels don't have to have a unique title.
Finally there are many channels that return nothing from the API Channels.List method, even though they are channels. I'm still figuring these out. I don't think they are returned from searching through the API, but if you get your Channel IDs from another source then this could be an issue.
We did have this playlist. It is great because using this info we can show a latest video on YouTube.
https://gdata.youtube.com/feeds/base/users/africawoodgrow/uploads?alt=rss&v=2&orderby=published
How do we receive the same information from the new 3.0 API?
The first thing you'll need to do is register for an API key -- you can do this by creating a project at console.developers.google.com, setting the YouTube data API to "on," and creating a public access key.
Once you have your API key, you'll need to get the channel ID you're interested in (rather than the username). If you don't know the channel ID, you can get it this way:
https://www.googleapis.com/youtube/v3/channels?part=snippet&forUsername={username}&key={YOUR_API_KEY}
Once you have the channel ID, you can get those videos with the search endpoint, like this:
https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&channelId={channel id here}&maxResults=25&key={YOUR_API_KEY}
There are also a lot of other parameters you can use to retrieve videos; see https://developers.google.com/youtube/v3/docs/search/list for more details.
I want to retrieve popular videos on Dailymotion without login. Youtube has an API for the same. Is there any API available to perform this task?
You need to use the "sort" parameter with rated, visited ...
Something like https://api.dailymotion.com/videos?sort=visited
See here for more infos.