Youtube Scraper
Pricing
$7.00/month + usage
Go to Apify Store

Youtube Scraper
This Python script scrapes YouTube search results using yt-dlp. It fetches the top 20 videos for a given query, extracts video and channel details (title, views, duration, publish time, thumbnails), formats the data, saves it as a JSON file
Pricing
$7.00/month + usage
Rating
0.0
(0)
Developer

Data Pilot
Maintained by Community
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Share
YouTube Search Scraper
A powerful Apify Actor that searches YouTube and extracts detailed video metadata including titles, views, duration, thumbnails, channel information, and more. Uses yt-dlp for reliable data extraction.
🎯 Features
- 🔍 YouTube Search - Search for any keyword or phrase
- 📹 Detailed Video Data - Title, URL, thumbnail, description, views, duration
- 👤 Channel Information - Channel name, ID, URL
- 📊 Formatted Metrics - Human-readable view counts and durations
- ⏱️ Publish Dates - "X days/weeks/months ago" format
- 🔄 Batch Results - Get up to 50 search results
- 🌐 Proxy Support - Optional Apify Proxy
- 💾 Dual Output - Complete results + individual videos
📥 Input
{"searchQuery": "minecraft","maxResults": 20,"useApifyProxy": true}
Input Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
searchQuery | String | Yes | - | YouTube search term |
maxResults | Integer | No | 20 | Number of results (1-50) |
useApifyProxy | Boolean | No | false | Enable Apify Proxy |
apifyProxyGroups | Array | No | ["RESIDENTIAL"] | Proxy pool type |
Input Examples
Simple Search:
{"searchQuery": "cooking recipes"}
Custom Results:
{"searchQuery": "python tutorial","maxResults": 50}
With Proxy:
{"searchQuery": "music playlist","maxResults": 30,"useApifyProxy": true}
📤 Output
The actor outputs two types of records:
1. Complete Search Results
{"query": "minecraft","timestamp": "2026-01-18T05:30:00.000Z","totalResults": 20,"video": [{"videoId": "dQw4w9WgXcQ","url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ","title": "Minecraft Survival Guide","thumbnail": "https://i.ytimg.com/vi/...","description": "Complete beginner's guide to Minecraft...","channelName": "Gaming Channel","channelId": "UCxxxxx","isChannelVerified": false,"publishedTime": "2 weeks ago","viewH": "1.2M views","view": 1234567,"durationH": "15 minutes, 30 seconds","duration": 930}],"channel": [{"channelId": "UCxxxxx","url": "https://www.youtube.com/channel/UCxxxxx","channelName": "Gaming Channel","username": "gamingchannel","avatar": "","isChannelVerified": false,"subscriberH": "N/A","description": "Channel by Gaming Channel"}]}
2. Individual Video Records
{"_type": "video","videoId": "dQw4w9WgXcQ","url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ","title": "Minecraft Survival Guide","thumbnail": "https://i.ytimg.com/vi/...","description": "Complete beginner's guide...","channelName": "Gaming Channel","channelId": "UCxxxxx","viewH": "1.2M views","view": 1234567,"durationH": "15 minutes, 30 seconds","duration": 930,"publishedTime": "2 weeks ago"}
🚀 Usage
On Apify Platform
- Go to Actor page
- Click "Try for free" or "Start"
- Enter search query
- Set max results (optional)
- Click "Start"
- Download results from Dataset
🛠️ How It Works
- Input Processing - Validates search query
- yt-dlp Search - Executes YouTube search via yt-dlp
- Data Extraction - Extracts video and channel metadata
- Formatting - Converts views, duration, dates to readable format
- Output - Pushes complete results + individual videos to dataset
📝 Use Cases
- Content Research - Find popular videos on topics
- Competitor Analysis - Track competitor video performance
- Trend Analysis - Discover trending content
- Data Collection - Build video datasets
- SEO Research - Analyze video titles and descriptions
- Channel Discovery - Find channels in your niche
📊 Output Data Fields
Video Fields
videoId- YouTube video IDurl- Direct video URLtitle- Video titlethumbnail- Highest quality thumbnail URLdescription- Video description (truncated)channelName- Channel/creator namechannelId- YouTube channel IDviewH- Human-readable view count (e.g., "1.2M views")view- Raw view count numberdurationH- Human-readable durationduration- Duration in secondspublishedTime- Relative time (e.g., "2 weeks ago")
Channel Fields
channelId- YouTube channel IDurl- Channel URLchannelName- Channel nameusername- Channel username/handledescription- Channel description
💡 Tips for Best Results
- Specific Queries: Use specific search terms for better results
- Result Limit: Start with 20 results, increase if needed
- Proxy: Enable for large batches or if blocked
- Data Access: Filter by
_type: "video"for individual videos - Rate Limiting: Add delays between multiple actor runs