How to Scrape All Videos from Any YouTube Channel (Metadata & Stats)
If you manage a YouTube channel, you have analytics. But what if you want to analyze a competitor's channel?
You want to know:
- Which of their videos got the most views in the last 30 days?
- What is their average video length?
- Which keywords are they using in their titles?
- How has their upload frequency changed over the last year?
To answer this, you need a list of all videos on their channel, with metadata (views, likes, publish date).
The official YouTube Data API makes this surprisingly hard. It costs a lot of "quota" to list videos, and you have to paginate endlessly.
In this guide, we'll show you how to export an entire channel's video list using SociaVault.
Need YouTube data without quota limits? Check our YouTube API alternatives comparison.
The "Uploads" Playlist Trick
Every YouTube channel has a hidden playlist called "Uploads" that contains every video they have ever posted.
- Channel ID:
UC_x5XG1OV2P6uZZ5FSM9Ttw(Google Developers) - Uploads Playlist ID:
UU_x5XG1OV2P6uZZ5FSM9Ttw(ReplaceUCwithUU)
SociaVault exploits this structure to scrape videos efficiently.
Step 1: Get the Channel ID
You can search for the channel using SociaVault, or just grab it from the URL.
youtube.com/channel/UC...
Step 2: Scrape the Videos
We use the youtube/channel/videos endpoint.
import requests
import pandas as pd
API_KEY = "YOUR_SOCIAVAULT_API_KEY"
CHANNEL_ID = "UC_x5XG1OV2P6uZZ5FSM9Ttw" # Example Channel
def get_all_videos(channel_id):
videos = []
next_token = None
has_more = True
print(f"Scraping videos for {channel_id}...")
while has_more:
url = "https://api.sociavault.com/v1/scrape/youtube/channel/videos"
params = {
"channelId": channel_id,
"token": next_token # Pagination
}
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
if not data.get('success'):
break
new_videos = data['data']['videos']
videos.extend(new_videos)
print(f"Fetched {len(new_videos)} videos. Total: {len(videos)}")
next_token = data['data'].get('next_token')
if not next_token:
has_more = False
return videos
all_videos = get_all_videos(CHANNEL_ID)
Step 3: Analyze the Data
Now convert it to a DataFrame and find insights.
df = pd.DataFrame(all_videos)
# 1. Top 5 Most Viewed Videos
print("--- Top 5 Videos ---")
print(df.sort_values('views', ascending=False).head(5)[['title', 'views']])
# 2. Average Views per Video
print(f"Average Views: {df['views'].mean()}")
# 3. Best Day to Upload?
df['publish_date'] = pd.to_datetime(df['publish_date'])
df['day_of_week'] = df['publish_date'].dt.day_name()
print(df.groupby('day_of_week')['views'].mean().sort_values(ascending=False))
Use Case: Content Gap Analysis
- Scrape your competitor's channel.
- Filter for videos with High Views but Low Subscribers (if you can estimate subs at the time). Or simply look for outliers—videos that performed 10x better than their average.
- These are viral topics.
- Make a better version of that video.
Conclusion
Auditing a YouTube channel shouldn't require manual copy-pasting. With SociaVault, you can turn any channel into a dataset in seconds.
Start auditing channels: Get your API Key
Found this helpful?
Share it with others who might benefit
Ready to Try SociaVault?
Start extracting social media data with our powerful API. No credit card required.