How to apply filter in the youtube most_viewed video .
Like url for most_viewed videos is :
http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed?v=2
i wanted to apply filters inside the above url .
like how to search the videos by keywords inside the most_viewed category .
Request :Please don't refer Youtube Developer Guide
The only filter I know of is the category keyword. For example, to filter most viewed "Games" videos, you would use :
http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed_Games?v=2
The complete categories list is made available by Google.
[EDIT :]
The manual page statement makes it clear :
In general, parameters that are used for filtering and ordering
results are only supported for search requests.
Here is the full manual page
Hope this helps !
Related
I currently use something like https://www.googleapis.com/youtube/v3/search?part=id&order=date&channelId=CHANNELID&maxResults=1&type=video&key=KEY and I want to be able to retrieve only the latest video and to totally exclude shorts.
How can I achieve this? 🤔
The Youtube search method
Will allow you to search for things like keyword, location, events, your own videos and related videos.
There is no way to filter or limit videos returned. Your only hope would be to sort them out locally when you get the results.
You may want to add a feature request here there is this one but it's really old Search API: More flexible/logical videoDuration requests
(sorry its my 1st time answering at stackoverflow, so might not be descriptive)
if you you use youtube serch method
then you'll realise that shorts description are assigned as empty string "" where as the videos have some description . so with an if condition like below can slove your problem (js)
if(!(video.snippet.description == ""))
I have a problem with the Youtube API, I want to get all my liked videos.
Using this : https://developers.google.com/youtube/v3/docs/channels/list
I find all my playlist but not the liked one..
Do you know if it's protected ?
So there is no way i can get my liked videos ?
There's no search filter for Youtube API that says 'get only my liked videos'. But there's a "part" property called 'statistics' that returns how many likes your videos has.
https://www.googleapis.com/youtube/v3/channels?part=statistics&key={YOUR_API_KEY}
If you want to get a list of all your "Liked" YouTube videos, regardless of where they are then you need to use:
"Videos : list"
You are using:
"Channels : list"
The URL for "Videos : list" is:
https://www.googleapis.com/youtube/v3/videos
See documentation at:
https://developers.google.com/youtube/v3/docs/videos/list#request
There is a sample of Request Parameters for:
list (my liked videos)
An option parameter of:
myRating=like
must be included in the URL search string if you are using the REST API.
Good day!
Let's say I have a web page dedicated to a specific song by a specific author (eg "Imagine" by "John Lennon"). I would like to programmatically:
Search Youtube for the first n videos with "Imagine John Lennon"
Loop through these results to find a video which is available in the country where the user is located
Display the first video that matches the constraints on point 2. If no video matches them, then I won't display any video.
How can I do this? Is it better to do it with PHP or Ajax calls? I already checked some similar questions (1, 2) but as they are "old" I was wondering if there is a better method now.
Thanks for any help
This can be done with a single call to the Search: list endpoint, setting the 'q' and 'regionCode' parameters. Use any programming language you prefer.
When I make an authorized call for Youtube videos, I get all the tags/keywords in the feed.
http://gdata.youtube.com/feeds/api/users/default/uploads?alt=jsonc&v=2
However, if I want to filter this result by a single keyword/category, the tags are not returned by the API. Example, I want to reduce the number of videos in the feed by tag "English"/"French".
http://gdata.youtube.com/feeds/api/users/default/uploads/-/English?alt=jsonc&v=2
Is this expected behavior or a bug?
It's expected behavior; this blog post explains how your second request is going against the search index, which will never return keywords/tags in the response.
I am using following rss feed to get videos from youtube. works fine.
http://gdata.youtube.com/feeds/api/users/zeetv/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile;
now i like to apply certain filter... for example: listing videos which has "Episode" in title.
http://gdata.youtube.com/feeds/api/users/zeetv/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile&q=Episode;
But it doesnot filter out the videos,which matches "episode", instead it list all.
i had checked this link https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters
and applied query string.
anyhelp is much appreciated. Thanks
It seems like you can't query a users videos, like that.
You have to build your query like this: http://gdata.youtube.com/feeds/api/users/zeetv/uploads?q=Episode&fields=entry(title)
you can read more about the fields syntax here: https://developers.google.com/youtube/2.0/developers_guide_protocol_partial#Fields_Formatting_Rules
The link provided in the question now has the answer. You should perform a search for the term you want and filter by author:
https://gdata.youtube.com/feeds/api/videos?q=episode&author=zeetv