Nice to meet you. Since I am a beginner in the IT industry, the definition of words may be wrong. If you have any notice, I would appreciate it if you could give me some advice.
In May of this year, I welcomed a dog to my house and started using Youtube to organize the videos I shot. I checked various videos to get started, but as an individual, I noticed ...
――There is an animal-based Youtuber that is so popular that you think "Youtube can make a living?" ――It seems that there is no big relationship between the number of views and the quality of the video. Not expensive)
It was interesting, so I decided to analyze it using the Youtube API.
At home [Welsh Corgi](https://ja.wikipedia.org/wiki/%E3%82%A6%E3%82%A7%E3%83%AB%E3%82%B7%E3%83%A5 % E3% 83% BB% E3% 82% B3% E3% 83% BC% E3% 82% AE% E3% 83% BC) I started to keep a breed of dog.
I want to do analysis related to my Youtube, so I will analyze videos related to Corgi and Youtuber.
This article is written for the following people.
--People who are simply interested in the number of views of videos about Corgi --People who have touched Python and are wondering what you can do with the Youtube API
Unfortunately, the Youtube API isn't very versatile, and the content that can be analyzed is very limited. First of all, I will explain "what I was able to do".
You can use the Search function to search for information on popular videos and channels. For details and code, see Youtube API Reference and Youtube Data API in Python Get Youtube data.
Since we specified q ='Corgi' and order ='viewCount' this time, we succeeded in acquiring the videos that hit the search term Corgi in descending order of the number of views.
** I tried to get 1000 video information, but I couldn't because of the Youtube API specifications. ** ** (950 cases were acquired.) Also, videos that are viewed most often are displayed, but the results change each time you search. When I investigated, there were many videos with less than 100 views in the 900th to 950th. I've posted a video with over 100 views, but it didn't show up, so unfortunately I can't trust the search results too much.
You can use the videos function to specify the videoId and get the video information. For more information, see the Youtube Data API reference here [https://developers.google.com/youtube/v3/docs/videos/list?hl=ja&apix=true#try-it).
In Getting Youtube data with Python using Youtube Data API, you can get the basic information of many videos by the method of "What you can do 1". , The number of views and the number of likes are obtained using the videoId obtained here.
** Note that you cannot specify the channel ID in the videos function. ** ** If you want to get information about all the videos on a channel (such as HIKAKIN), there is no way to get it. ~~ Maybe it's just a lack of ability. .. ~~
You can use the channels function to search for channel information by specifying the Id. See the Youtube Data API reference here [https://developers.google.com/youtube/v3/docs/channels/list?hl=ja) for more information.
We also created a function (below) that allows you to get the total number of views, total likes, etc. of a channel by specifying the channel Id.
#Create a function to get the number of views and likes of the channel by inputting the channelId
def channel_statistics(id):
statistics = youtube.channels().list(part = 'statistics', id = id).execute()['items'][0]['statistics']
return statistics
df_static = pd.DataFrame(list(df_channel['channelId'].apply(lambda x : channel_statistics(x))))
df_channel_output = pd.concat([df_channel,df_static], axis = 1)
As mentioned above, the content of the analysis is limited and the results are not robust, but since I have investigated it, I will publish the analysis results as well.
We got 950 information about videos that have been played most often, and compared the top 10 most frequently played channels by video upload year. As a result, until 2018, the situation was divided into groups, but in 2019, "Corgi Inu Noe-san" appeared like a comet, and it can be seen that in 2019 and 2020, it is overwhelmingly different from the second place.
I thought, "Mr. Noe, who has an overwhelming difference in 2nd place, is posting the most videos?", And compared the total number of views and the total number of videos posted on the top 10 channels. As a result, "Corgi Inu Noe-san" was the top in the total number of views, but another channel was the top in the total number of video posts.
As you might guess, the more videos you play, the more likes you get. The correlation coefficient is 0.87.
What was a little surprising was that as the number of times the video was played, the number of bad likes increased, and the correlation coefficient was 0.82, which is close to the correlation coefficient between the number of likes and the playback function.
Corgi dog Noe's Youtube is very interesting with Hokkaido & children & 2 Corgis! By the way, videos are posted almost every day.
Animal-based Youtuber is a tough world. .. ..
* My dog also gave up on becoming a popular Youtuber, saying, "I can't help it. I don't want to work so hard."Recommended Posts