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

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