Today, there are more than 2.7 billion active YouTube users, and for many people, YouTube is not just entertainment but an important source of income. but how does it work? How many views or subscribers can different YouTube channels get? With the help of Python, Pandas, and YouTube Data API, we can get some interesting insights.
Methodology
This article will be divided into several parts:
- Using the YouTube Data API. With this API we can obtain a list of YouTube channels for different search requests. For each channel, we will get information about the number of videos, views and subscribers.
- Get the list of channels that interest us. This can be done only once.
- Channel data collection. To obtain statistical information, we need to collect data over a period of time.
- Data analysis.
Without further ado, let’s get into it.
1. YouTube Data API
First, some good news for everyone who is interested in collecting data from large networks like YouTube: the YouTube API is free and we don’t need to pay for it. To start using this API, we need two steps:
- Open https://console.cloud.google.com and create a new project. I already had an old project there, but after a period of inactivity, all of its API limits were set to zeros and I couldn’t find a way to reset them. So, it’s easier to make a new one.
- Go to “API & Services” and enable “YouTube Data API”. Open the API, go to “Credentials” and create an API key. If everything is done correctly, the Odds page will look like this: