Skip to content

How to Scrape List of YouTube Videos from Any Channel With Python 🐍

Sara Taher
1 min read
How to Scrape List of YouTube Videos from Any Channel
How to Scrape List of YouTube Videos from Any Channel

If you're looking to pull all the YouTube Videos off a channel (with video title) and output them into a csv file or a comma separated .txt file, this blog is for you. I also decided to scrape YouTube Channels using channel names vs. the commonly used channel IDs, since some channels have already add a unique string to their URLs. Example:

💡
https://www.youtube.com/@DisneyMusicVEVO

I've looked at different resources, and I highly recommend you learn to read and use the YouTube API documentation. I also recommend you learn how to use Google Cloud APIs and how to create an API key for YouTube. The process is pretty straight forward:

Create a YouTube API Key
Create a YouTube API Key

How to create a YouTube API key

  1. Log in to Google Developers Console
  2. Create a new project.
  3. On the new project dashboard, click Explore & Enable APIs.
  4. In the library, navigate to YouTube Data API v3 under YouTube APIs.
  5. Enable the API.
  6. Create a credential.
  7. A screen will appear with the API key.

For more details checkout this resource.

Once you have your API key, the rest is piece of cake!

Here's the code, all you need to do from here is just add your API key and your channel name. You can also easily modify the code to get the channel name as input from the user. Here's the code:

That's that! You'll end up with a file that has a list of Video URLs and their titles. Happy coding!

Photo Credit: Midjourney. Prompt: computer screen showing code --v 5 --ar 3:2

Python

Related Posts

Members Public

Calculating SERPs Compression Ratio With Python

I love how this community builds on top of the work of each other! Well this article is no different from that. It all started with Roger Montti publishing a post about "How Compression Can Be Used To Detect Low Quality Pages" on Search Engine Journal. Next thing

The Output of a Python Script that pulls the top 10 results for a keyword and calculates the compression ratio for them
Members Public

Python For Marketers Workshop

Hello Fellow SEOs and Marketers! Let me introduce you to my latest offering, Python for Marketers Workshop! Python For Marketers 2HR Workshop Signup Never coded before? No problem! This live, interactive workshop is designed to introduce marketers like you to the world of Python. In just 2 hours, you'

Python for marketers workshop banner
Members Public

Python Projects for Beginners

If you're trying to learn Python, your best shot is working on some easy projects! I'm a Java developer by training but didn't program for so long, but all the concepts of object oriented programming are still here. All I needed was a quick

Computer screen with python code