Using the youtube data api version 3 I download subscribers using a query similar to this:
v3.channels().\
list(part=parts,mySubscribers=True,
maxResults=50, pageToken=nextPageToken).execute()
I never manage to download more than 70,000 results in total. This result is despite there being many more results available as reported on the channels' page.
For example one channel has over 2 million subscribers so I am retrieving only a small subset of the total.
Is this a limit enforced by Google? Is it possible to extract more?
Related
So I am building a web app whereby I want to check if certain channels (users) are subscribed to an certain (authed) channel via the API using the v3 Data API:
https://developers.google.com/youtube/v3/docs/subscriptions/list
Obviously the subscriptions/list API has restrictions when trying to retrieve mySubscribers=true and it simply wouldn't be feasible for large channels. Also the number of users I want to check is dynamic, and so iterating over them and checking from their perspective (I have auth tokens) seems a little intensive.
What I have noticed is that the forChannelId filter works to filter a users subscriptions, but not for filtering a channels subscribers.
Is this possible at all?
Ideally the query:
https://youtube.googleapis.com/youtube/v3/subscriptions?part=subscriberSnippet&forChannelId=xxxxxxx%2Cyyyyyy&mySubscribers=true&key=[YOUR_API_KEY]
Would return the authed channels subscribers filtered by the forChannelId channels, the same way as the it does for subscriptions:
https://youtube.googleapis.com/youtube/v3/subscriptions?part=subscriberSnippet&forChannelId=xxxxxxx%2Cyyyyyy&mine=true&key=[YOUR_API_KEY]
Is there any alternative way to achieve such a check in a single bulk call, without having to loop over users I want to check and spending potentially unnecessary quota points?
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.
I am trying to create a Youtube feed reader using https://www.youtube.com/feeds/videos.xml?channel_id={CHANNEL:ID}, everything works but I want to read only one or two entries.
Is this possible to limit these feeds to return only a concrete number of entries? I don't want to use the V3 api as it will restrict the number of calls per day.
Cheers
The old-fashion way of limiting/paginating results of feeds have been depracated long ago and tourned off since 2015 along with YouTube Data API v2.
https://www.youtube.com/feeds/videos.xml?channel_id=XXXXX is still on but fixed (and limited) to 15 results.
So, one of the two:
- migrate to YouTube Data API (v3)
or
- parsing yourself the feed server side (PHP or whatever) to get only the first one/two results.
sadly, no other way.
Is it possible to get the below data from YouTube Data API?
Artist Channel Subscriber counts, by day
Thumbs Up, Thumbs Down for YouTube Videos or by ISRC, by day
Shares for YouTube Videos or by ISRC, by day
Unfortunately, you can't filter dates in Youtube Data API
In Youtube Data API :Channels
A channel resource contains information about a YouTube channel.
To get Subscriber count, use:
statistics.subscriberCount
The number of subscribers that the channel has.
You can use Youtube Analytics and Reporting APIs, to create a concrete stats regarding subscriber count,likes or dislikes and shares read carefully the dimension and metrics for a good search query parameters.
Metrics
This document defines the metrics that you can retrieve using the YouTube Analytics API. This API supports real-time queries to generate custom YouTube Analytics reports.
Metrics are individual measurements of user activity, ad performance, or earnings. User activity metrics include things like video view counts and ratings (likes and dislikes).
The list below identifies some of the API's core metrics.
dislikes
likes
shares
subscribersGained
subscribersLost
Dimensions
This document defines the dimensions that the YouTube Analytics API supports. This API supports real-time, targeted queries to generate custom YouTube Analytics reports.
Dimensions are common criteria that are used to aggregate data, such as the date on which user activity occurred or the country where users were located.
Each query report identifies the dimensions that it supports. For example, when retrieving user activity by time, you choose the time period for which data will be reported: day, 7DayTotals, 30DayTotals, month. In any report, each row of data has a unique combination of dimension values.
NOTE:
Core dimension and Core Metrics is subject to the Deprecation Policy.
Unfortunately you have to use staticstics of Youtube Data API to get Subscriber counts, likesCount and dislikeCount. Hope it helps!
So after scouring the youtube API, and thinking that this may not be possible, I'll give a last try here.
In a nutshell, I am trying to obtain analytical data from youtube's analytics's API for specific videos for a date range (by day if possible). I've found ways to get the channel data that the video reside in, but I have been unable to find how to ontain the specific video data itself. Assuming it exists in v3 that is.
Anyone had any luck with this kind of task at all? Has this feature been developed for v3 as of yet?
Channel Reports is the API to retrieve video metrics. It can filter by video, by country, by lead (for some fields) and accepts timespan and data aggregation granularity. In brief, Available Reports lists all the valid query parameter combinations.
Individual comments can be retrieved with v2 Data API - together with their dates.