Youtube API not returning liked videos - youtube

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.

Related

Get all videos for a given user

I'm trying to find a way to retrieve all videos posted by a given user (eg: https://www.youtube.com/user/laliga/videos).
All the examples I've found online or the doc (https://developers.google.com/youtube/v3/docs/) seems to require either a playlist ID, channel ID or video ID.
Is there any way I can directly query the author's videos or am I forced to retrieve all playlists and then iterate over?
Thanks
You just need to map the user name to its channelID first via the YouTube API like so:
https://www.googleapis.com/youtube/v3/channels?forUsername=USER_NAME&part=id&key=API_KEY
Full docs: https://developers.google.com/youtube/v3/docs/channels/list
Then you can make a Videos:List call with that channelID to get the videos.
1)take your google key id and channel id and put inside below url
https://www.googleapis.com/youtube/v3/search?key=APIKEY&channelId=CHANNELID&part=snippet,id&order=date&maxResults=20
ex
https://www.googleapis.com/youtube/v3/search?key=adsjsdakhkjshd&channelId=sdahghsadhgj&part=snippet,id&order=date&maxResults=20

YouTube API v3 Channels: list method doesn't work for some channels names

For some reason I can't get any information for some channels via API. For example this channel: http://youtube.com/vithorvascovv and API request
GET https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=vithorvascovv&key={YOUR_API_KEY}
gives me empty response. Why? You can try here with part=id and forUsername=vithorvascovv.
Even if I use search method like this:
GET https://www.googleapis.com/youtube/v3/search?part=id&q=vithorvascovv&type=channel&key={YOUR_API_KEY}
I have empty response but in same time channel can be found by using regular search on Youtube.
One more channel name with the same problem: Nsamurail
It looks like the user "vithorvascovv" merged with another channel. I'm not exactly sure why the username lookup no longer works, but I see that http://youtube.com/vithorvascovv redirects to https://www.youtube.com/channel/UCsLprVocGZ9mUl6SGBZ91Ng. Using part=id and id=UCsLprVocGZ9mUl6SGBZ91Ng, I was able to return the proper results from the API.
For your second question, it looks like user "Nsamurail" changed their username to "xRidan" (http://www.youtube.com/Nsamurail redirects to https://www.youtube.com/user/xRidan). Using part=id and forUsername=xRidan, I was able to return the channel information from the API.
Question : How Can Fetch Playlists From Any Youtube Channel Name/User By Using YOUTUBE DATA API ?
Answer : When You Try To Do This We Always Face A Problem to apply "FILTER" in order to fetch Playlists , here you can use two different filters (forUsername,Id) in two different Youtube channel urls such as :
1. https://www.youtube.com/user/flashbuilding/playlists
Here channel name is : flashbuilding
Required Filter For API is: forUsername
Code Structure :
forUsername:flashbuilding
2. https://www.youtube.com/channel/UCJUmE61LxhbhudzUugHL2wQ/playlists
Here Chanel Name is not clear in this case:-
Required filter for API is : Id
Code Structure :
Id:UCJUmE61LxhbhudzUugHL2wQ
Note : use Id in API Filter section instead of API part Section

Search in youtube by using youtube api

I need to retrieve videos that contain some topic in title or description ,
I use the following request
https://www.googleapis.com/youtube/v3/search?part=snippet&q=???&channelId=???&key=???
it return result that not related to the query that I mentioned
Where is the problem?
How api retrieve the result ??

Tags (keywords) are missing from the Youtube API video feed when using category search

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.

Retrieving youtube most_viewed url

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 !

Resources