
Youtube Search
Pricing
$10.00/month + usage

Youtube Search
The YouTube Search Scraper is an Apify actor that extracts metadata from YouTube search results.
5.0 (1)
Pricing
$10.00/month + usage
0
Total users
2
Monthly users
2
Runs succeeded
>99%
Last modified
2 days ago
YouTube Search Scraper
Overview
The YouTube Search Scraper is an Apify actor that extracts metadata from YouTube search results. It retrieves video details such as title, video ID, uploader, duration, view count, and more, based on a search query, with flexible filters for Shorts, duration, upload date, and sorting. The actor uses Apify’s proxies to ensure reliable scraping and includes robust error handling, logging, and retry logic. It’s ideal for analyzing YouTube search trends and is accessible via Apify’s UI, CLI, or API in any programming language.
Features
- Comprehensive Metadata: Extracts title, video ID, URL, uploader, uploader ID, upload date, duration, view count, thumbnail, and Shorts status.
- Search Filters: Supports filtering by Shorts (
shorts_only
,exclude_shorts
), duration (min_duration
,max_duration
), upload date (last_24h
,last_week
,last_month
,last_year
), and sorting (relevance
,date
,view_count
,rating
). - Proxy Support: Uses Apify’s proxies for reliable scraping.
- Robust Execution: Includes detailed logging, 3-minute actor timeout, 90-second scrape timeout, and exponential backoff retries.
- Output Formats: Data stored in Apify’s dataset, exportable as JSON or CSV, with a table view in Apify UI.
- Cross-Language Access: Run via Apify’s REST API or SDKs (Python, Node.js, etc.) for integration with any language.
Input Configuration
The actor accepts a JSON input with the following fields:
Field | Type | Description | Required | Default |
---|---|---|---|---|
query | String | Search query for YouTube videos | Yes | - |
max_results | Integer | Maximum number of videos to scrape (1–100) | No | 10 |
shorts_only | Boolean | Only include Shorts in results | No | false |
exclude_shorts | Boolean | Exclude Shorts from results | No | false |
min_duration | Integer | Minimum video duration in seconds | No | - |
max_duration | Integer | Maximum video duration in seconds | No | - |
upload_date_filter | String | Filter by upload date (last_24h , last_week , last_month , last_year ) | No | "" (Any) |
sort_by | String | Sort results (relevance , date , view_count , rating ) | No | relevance |
sleep_interval | Integer | Seconds to wait between requests | No | 2 |
max_retries | Integer | Maximum retry attempts for failed requests | No | 3 |
Notes:
shorts_only
andexclude_shorts
are mutually exclusive.max_results
is capped at 100 to avoid excessive runtime.- Increase
sleep_interval
ormax_retries
for heavy scraping or persistent errors.
Example Input:
{"query": "python tutorial","max_results": 20,"shorts_only": false,"exclude_shorts": true,"min_duration": 300,"max_duration": 3600,"upload_date_filter": "last_month","sort_by": "view_count","sleep_interval": 2,"max_retries": 3}
Output Format
The actor outputs data to Apify’s dataset, viewable as a table in the Apify UI or exportable as JSON/CSV. Each record contains:
Field | Type | Description | Format |
---|---|---|---|
title | String | Video title | Text |
video_id | String | Unique video ID | Text |
url | String | Video URL | Text |
uploader | String | Uploader name | Text |
uploader_id | String | Uploader ID | Text |
upload_date | String | Upload date (YYYYMMDD) | Date |
duration | Integer | Duration in seconds | Number |
view_count | Integer | Number of views | Number |
thumbnail | String | Thumbnail URL | Text |
short | Boolean | Is the video a Short | Boolean |
error | String | Error message if scraping failed | Text |
Example Output:
{"title": "Python Tutorial for Beginners","video_id": "abc123","url": "https://www.youtube.com/watch?v=abc123","uploader": "TechTutorials","uploader_id": "UCxyz","upload_date": "20250101","duration": 1800,"view_count": 100000,"thumbnail": "https://i.ytimg.com/vi/abc123/hqdefault.jpg","short": false}