Python Project to Scrape YouTube using YouTube Data API | Analyze and Visualize YouTube data

preview_player
Показать описание
In this video, we build a Python Project to Scrape YouTube data using YouTube Data API. Using YouTube API, we extract the data and then load this data into a Python Pandas DataFrame and then analyze this data. Finally, we build simple visualization from this data using the Python Seaborn library.

Timestamp:
00:00 Intro
01:19 How to generate YouTube API Key
03:27 Google YouTube Data API Documentation
07:48 Pre Requisite for project (Creating virtual environment and install python packages)
09:45 Part 1 - Scrape Channel statistics from youtube. Analyze and Visualize YouTube channel
32:32 Part 2 - Scrape Video details for a youtube channel. Analyze and Visualize video details.

We start this project by first creating an YouTube API Key which will be our credential to access youtube data. I will should you in detail, how to create an API Key.
Once the API Key is generated, we will then learn how to use this API key to access different youtube data. I.e. we will walk through the documentation given by google to use youtube API. We will look at the different sections in the documentation to access different data we need to build this project. We will also look at the sample python code given by google to call different resources and methods to fetch youtube data.

Finally, we will get into writing the python code to build this project. I will be using Jupyter Notebook to write my python code. Since it is a new project, we will create a new virtual environment for this project. We will use anaconda for this. Once the virtual environment is set, we will then install all the required python packages. So we will install "google-api-python-client" (which is the google python package required to access youtube api data), we will also install pandas and seaborn. I will show you how to create a virtual environment and also how to install all these packages in detail.

Once our environment is set and required packages are installed, we will then start writing the code in Jupyter Notebook. I have divided this project into 2 parts.
In the first part, we extract channel details from youtube. I.e. we extract details such as youtube channel name, total no of subscribers, total views and total number of videos posted by each channel. We gather these details for few Data Analyst/Data Scientist kind of channel and then compare these channel data with each other. We shall see who has the highest subscriber and who gets the most views and the amount of videos posted by these channels. We will be loading all of this data into a pandas dataframe and then analyze it. We will also generate some basic visualization using this data so we can easily compare these multiple channels.

In the second part of the video, we shall build a logic to extract video details from a particular channel. We shall extract details such as video title, total views each video has got, total number of likes, dislikes and comments each video has got. We shall extract these details for all of the videos posted by a particular channel. We will then analyze this data by loading it into a pandas dataframe. At the end we will create some simple visualization using Seaborn python library.

Hopefully, this can be a good starting project for anyone aspiring to become a Data Analyst. If you find this video useful then please make sure to like the video and subscribe to the channel.

🔴 WATCH MORE VIDEOS HERE 👇

✅ SQL Tutorial - Basic concepts:

✅ SQL Tutorial - Intermediate concepts:

✅ SQL Tutorial - Advance concepts:

✅ Practice Solving Basic SQL Queries:

✅ Practice Solving Intermediate SQL Queries:

✅ Practice Solving Complex SQL Queries:

✅ Data Analytics Career guidance:

✅ SQL Course, SQL Training Platform Recommendations:

✅ Python Tutorial:

THANK YOU,
Thoufiq
Рекомендации по теме
Комментарии
Автор

Wow, as a fellow data scientist, I am truly amazed by the incredible work you've done! Your expertise in data analysis and modeling is truly inspiring. Your ability to harness the power of data to uncover insights and make informed decisions is truly invaluable. Your work has helped businesses optimize their operations, improve customer experiences, and drive innovation.

Thank you for your hard work and dedication in making the world a better place through data-driven insights. Keep up the amazing work!

AlexandreDias
Автор

I haven't found anything better on youtube than your videos for data analysis. Only request I have is for you to make as many projects as you can from easiest to most difficult projects so that we can be thorough in this field. Even if I have to pay for it, I'd be more than happy. BUT, please don't stop here especially for projects...learning languages is slightly different than when we have to put together all of the learned tings in the project

urvindarkaur
Автор

This is the first video that I've watched on scraping ANYTHING that I was able to follow from beginning to end, understand, and be able to apply to my own channels and project...without running into problems that couldn't be easily fixed! I could fix my own mistakes because you explained each step so thoroughly. Thank you!!

mhapich
Автор

This is impresive and easy to follow, 👌🏻 however Youtube disabled the dislike count( The statistics.dislikeCount property was made private as of December 13, 2021. This means that the property is included in an API response only if the API request was authenticated by the video owner.) and this will affect the function to get video details.

KingofZamunda.
Автор

Hi Thoufiq, this is very impressive! I’m watching this purely out of curiosity bc I’ve not started my python class yet; however, I would love to see SQL project ideas, maybe for data cleaning and/or analysis. Thanks as always for your clear explanations and guidance 👍🏻 Also very glad to see you’re closing in on 15K, friend!! Congratulations in advance 😀👌🏻🙏🏻

laurak
Автор

Best tutorial about getting YouTube data I found here! Your code is cleaner than the one proposed in other tutorials. Thank you!

digdra
Автор

for a non-tech background like me, your tutorial is super easy to follow.

uvlrbkn
Автор

I liked the video but from college prospective:
1)how this project will be helpful
2) why should we develop this project
Please answer me....

.divyajaiswal
Автор

I am happy I struggled over this. I was googling for a Google Apps script and ended in Python. It is a very clear explanation and I am so happy about your English pronounciation. Lot of your country men(or women) have a strong accent i get very very tired of, so I give up or miss too much. So I subscribed to your channel!

hoekbrwr
Автор

Here's how to get channel ID in 2023:
1. Go to the desired channel and right click on the channel page
2. Go to 'View Page Source'
3. On the source page, top left will have 'Line wrap' with a check box, check that box
4. Press ctrl+F on your keyboard to open search tab
5. Type '?channel_id', it will highlight channel ID for you
6. Copy and use it

SMajid--SMajid
Автор

I had to do a project like this for my internship. You are a lifesaver!

MichaelThompson-pewi
Автор

A great video which covers all aspects of creating a project in Python for Data Science. Thank you for your service to the community at large. Regards.

mayankjacky
Автор

Hi Thoufiq, this is a very impressive tutorial. I followed this and managed to create my own visualizations for my Master of Arts project, which analyzes several political YouTubers' video output. Very helpful!

fortunusgames
Автор

Thanks a lot for this video!!! 😊😊
Btw liked and ofc already subscribed.

Please upload more videos of projects

sultankhatri
Автор

One of the best Analysis video I have seen so far
Amazing Content, Expecting videos on some more projects .
Appreciate your hard work !!

Anonymous-lezr
Автор

That was wonderfully helpful, Thoufiq. I am a complete novice and while elemets of the coding, such as programs you used, where to find them, how to intergrate are aspects I need to further study, the process you took was clear and inciteful. I paid attention throughout and flatter myself that I saw a few of your return errors before you did 😉 Now to study some more and see where this takes me. Thanks again. David

wingdigitalmarketing
Автор

Fab as always... concise and on fleek. Keep up👌🏻👌🏻🙏

fathimafarahna
Автор

Assalamualaikum Toufiq,
It's really a best ever vedio which i look in Youtube for web scrapping.

khanofficial
Автор

Thanks, Brother. This was a bit intricate for me as I have just started out learning Python for Data Analysis but the tricks you have used are new and I am eager to learn and use them and create a new project based off of this information. Don't worry, keep at it, you will be bigger than Ken Jee one day, just stay consistent.

dakshbhatnagar
Автор

Brilliant tutorial. Appreciated the pace and detail. With this tutorial, I can focus my time on exploring YouTube data and not worrying about how to get it!

sethpai