Do you know that YouTube had an API? And do you know that this API can be utilized to get all the info you want for a cool knowledge science challenge? Nicely, now you do.
On this article we’ll show learn how to use it to get a wealthy dataset which can permit us to investigate and evaluate the highest tech channels.
So as to have the ability to make requests to the YouTube API we have to comply with these steps:
- Create a brand new challenge in your Google Builders Console — all you want is a Google account to do that
- Request an API key on the “CREDENTIALS” tab by clicking “CREATE CREDENTIALS”
- Allow the YouTube API service by clicking on “ENABLE APIS AND SERVICES” in your dashboard then search and tick the “YouTube Knowledge API v3”
And we at the moment are able to name the API to get our knowledge.
A extra detailed model of those explanations can be found on Google documentation if mandatory:
Now that we’ve got all the pieces we want, let’s get coding!
On this article we’ll:
- Get a channel primary info (creation date, description, variety of movies, variety of subscribers, …)
- Get all video particulars of this channel (title, description, length, views, likes, …)
- Do that for the 5 channels we wish to examine
- Construct some (attention-grabbing) analyses round this knowledge
As a way to kick begin our challenge, we first want to put in the google api consumer library (
pip set up google-api-python-client) and import the two libraries we’ll use all through (pandas and the google api consumer library). We additionally retailer our API key and construct this youtube object which can permit us to make the API…