Channel Search in Youtube Data API within a particular category - youtube-api

I want to get all the channels within one particular category say "X".How can i achieve this using youtube data API?
Getting all the channels is easy and we can get these on the basis of searched keyword.

With the Youtube API v3 the channels can be filtered by the Freebase topic ID, besides keyword
https://developers.google.com/youtube/v3/docs/search/list

Related

Is there a way to access the comments I make on YouTube through the API?

I'm trying to retrieve the comments I've made on YouTube to turn them into Markdown files, but I can't find a way to do it filtering by user in the API documentation.
I thought it would be possible since the Google account has a link for it but when using the parameter "channelID" in the API to list comments as it says in the documentation, it gives back a 400 error.
You are looking for the comments your channel posted, however when using CommentThreads: list with channelId=YOUR_CHANNEL_ID you are listing comments people wrote on your channel, as described the documentation:
channelId
string
The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)
One more time YouTube Data API v3 AFAIK doesn't provide this basic feature.
You have two possibilities:
Use Google TakeOut (make sure to export Comments in YouTube and YouTube Music)
Web-scrap the webpage you provided

How do I get channel IDs for all YouTube channels in Japan?

I want to get channel IDs for all YouTube channels in Japan.
I tried to set the following parameters and call /search of YouTube Data API v3.
part: id
maxResults: 50
regionCode: jp
type: channel
pageInfo.totalResults in the API response is about 200,000 but actually I can only get 583 channel IDs.
583 is too little even if pageInfo.totalResults is an approximate value.
I would like to know how to get all the channel IDs in Japan, either by using the API or not.
I hope you will be able to provide the related information.
I tried to do almost the same for France. As said #stvar there isn't any appropriate endpoint to do so. However with patience and work we can make a kind of work around. My method only retrieves Japanese YouTube channels having indirectly publicly interacted with your starting set (see below).
Get a good starting set (in order to maximize the discover of the Japanese YouTube channels graph). I recommend you for instance to retrieve the top 100 Japanese YouTube channels sorted by view count by using SocialBlade.
For each channel discovered by the comments retrieved at step 3 (automatically) choose whether or not it is a Japanese YouTube channel. You can retrieve this piece of information if it is available for the channel in the "About" tab. To do it in an automatic way check whether or not snippet["country"] == "JP" in https://youtube.googleapis.com/youtube/v3/channels?part=snippet&id=CHANNEL_ID&key=YOUR_API_KEY If country isn't defined you can try to guess (automatically) whether or not it is a Japanese YouTube channel by making more complex checks see isFrench function. These checks are based on "About" tab and uploaded videos.
If the channel is interesting you (is Japanese) retrieve all comments (and so the YouTube channel about channel's videos and in the community tab using CommentThreads: list with part containing snippet and allThreadsRelatedToChannelId filter. If this method doesn't return any data because a video has disabled comments then retrieve the videos list and comments associated using (a) then CommentThreads: list with filter videoId. The approach (a) consists in getting the uploads auto-created playlist id of the YouTube channel by using Channels: list with contentDetails in part and then use PlaylistItems: list to retrieve all public videos uploaded on this YouTube channel. And if the YouTube channel contains more than 20 000 videos which is the upper limit for playlist size, use this script instead of (a). The script consists in faking requests done when browsing videos on a YouTube channel.
Then continue to dive into the Japanese YouTube channel graph by discovering Japanese YouTube channels through the comments found in your starting set and so on.
You can have a look for more details and some helping tools on my GitHub repository dedicated to the same approach for France (I was trying to list all comments let on French YouTube videos).
Of course you might need multithreading and group your YouTube Data API v3 request to reach maxResults upper limit in order to maximize your quota efficiency. Good luck.

YouTube API V3 difficulties while fetching top channels based on specific country

I want to fetch top channels (i.e top 10,100,150 channels) based on their subscribers and view count for specific country, How can I do that?
I have tried to use
https://www.googleapis.com/youtube/v3/search
but there is not any way found to fetch/search top YouTube channels with this API call, and not other way found for my need
Note: Tried regionCode parameter but that's not for filter the channels it fetching based on videos viewing in specific country
Thank you for your help in advance
What you want to do is not currently possible with this api.
search.list
Supports searching on a single region code
The Q paramater only does a fulltext search on the description and title of the video
There is no way to sort on either channels or subscribers.

YouTube Preferred Channels Feed or API

I'm looking to programmatically discover the YouTube Preferred channels (Examples: https://www.youtube.com/channel/UCiq_aAkP44mMpRx8VvQiF6w/channels?shelf_id=5204494150831773367&view=49 and https://www.youtube.com/channel/UCpXBkrx5YWAe8I9nbmLK_fA/channels?) but the channel pages with their AJAX lists is all I've found. Obviously it would be much easier to crawl an API or an RSS feed (or even a static HTML page!) and I've yet to find anything like that with each of the YouTube Preferred channel ids.
Am I missing something? Do these preferred channel lists really only exist in this one form?
Edit #1: I have tried to use the YouTube Data API to pull these "Preferred" channels' playlists via /channel/lists, but both efforts were a bust as the /channel/list only returned the single top-level channel and the playlists were empty.
Edit #2: I tried the solution from this: Youtube api get the channels from the Featured channels module and it did not work (despite this question being tagged as a duplicate of it).
You can use the channelSections.list endpoint with the Google Preferred channel id (UCiq_aAkP44mMpRx8VvQiF6w), the preferred channel ids are in the contentDetails separated in 1% and 5% groups
Example: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channelSections.list?part=contentDetails&channelId=UCiq_aAkP44mMpRx8VvQiF6w&_h=1&

Google API to retrieve all movies in a a category

i am looking for a pi which can retrieve all movies available on youtube in a particular category.
for example i want list of movies available at http://www.youtube.com/movies?cl=te.
Thank you
Perhaps YouTube API is what you are looking for:
http://code.google.com/intl/pl/apis/youtube/overview.html
Precisely, look into Data API Protocol. There is parameter called "category".

Resources