Youtube Scraper avatar
Youtube Scraper

Pricing

from $4.00 / 1,000 results

Go to Apify Store
Youtube Scraper

Youtube Scraper

Alternative to the YouTube API with zero quota limits. Crawl YouTube videos and channels to extract names, views, likes, and subscriber data.

Pricing

from $4.00 / 1,000 results

Rating

0.0

(0)

Developer

JPrime

JPrime

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Share

A powerful Apify Actor for scraping videos, channels, playlists, and search results from YouTube. Extract comprehensive video metadata including views, likes, channel information, and more.

Features

  • ๐ŸŽฅ Multiple URL Types: Scrape individual videos, entire channels, playlists, and search results
  • ๐ŸŽฌ Shorts Support: Automatically discovers and tags YouTube Shorts from channels
  • ๐Ÿ“บ Streams Support: Automatically discovers and tags live streams and past streams
  • ๐Ÿ” Search Functionality: Search YouTube by keywords and scrape the results
  • ๐ŸŽ›๏ธ Advanced Search Filters: Filter search results by type, duration, features, sort order, and upload date
  • ๐Ÿ“Š Rich Metadata: Extract titles, descriptions, views, likes count, upload dates, and more
  • ๐Ÿ‘ค Channel Information: Get channel names, URLs, subscriber counts
  • ๐Ÿ–ผ๏ธ Thumbnails: Get high-quality video thumbnail URLs
  • โš™๏ธ Flexible Configuration: Control what data to scrape and how many results to collect

Input

The Actor accepts the following input parameters:

FieldTypeDescriptionDefault
startUrlsArrayList of YouTube URLs to scrape (videos, channels, playlists, search results)Required
searchQueriesArraySearch queries to find videos[]
searchFiltersObjectFilters to apply to search results (see Search Filters section){}
maxResultsNumberMaximum number of videos to scrape per channel/playlist/search query20
maxRequestsPerCrawlNumberMaximum number of pages to process (0 = unlimited)100
scrapeVideoDetailsBooleanExtract detailed information from each video pagetrue
scrapeChannelInfoBooleanExtract channel information when scraping videostrue
proxyConfigurationObjectProxy settings (recommended for YouTube)Uses Apify Proxy

Example Input

{
"startUrls": [
{ "url": "https://www.youtube.com/@lexfridman" },
{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
{ "url": "https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf" }
],
"searchQueries": ["web scraping tutorial", "machine learning"],
"maxResults": 20,
"scrapeVideoDetails": true
}

Search Filters

The Actor supports advanced search filters to refine YouTube search results. Filters can be combined to create highly targeted searches.

Available Filters

FilterTypeOptionsDescription
typeString (Single)videos, shorts, channels, playlists, moviesFilter by content type
durationString (Single)under3, 3to20, over20Filter by video duration
featuresArray (Multi)live, 4k, hd, subtitles, creativeCommons, 360, vr180, 3d, hdr, location, purchasedFilter by video features
sortByString (Single)relevance, popularitySort search results
uploadDateString (Single)today, thisWeek, thisMonth, thisYearFilter by upload date

Important Notes

  • Upload Date Limitation: The uploadDate filter is only applicable to videos, shorts, and movies. When an upload date is applied, YouTube automatically defaults to video type.
  • Filter Combination: โœ… Fully Supported! You can now combine filters from different categories (e.g., type + duration + sortBy + uploadDate)into a single SP parameter.
  • Multi-Select Features: โœ… Fully Supported! You can combine multiple features (e.g., ["hd", "4k", "subtitles"]).

Example with Search Filters

{
"startUrls": [],
"searchQueries": ["web scraping tutorial", "machine learning basics"],
"searchFilters": {
"type": "videos",
"duration": "3to20",
"features": ["hd", "subtitles"],
"sortBy": "popularity",
"uploadDate": "thisMonth"
},
"maxResults": 10,
"scrapeVideoDetails": true
}

This example searches for popular videos about "web scraping tutorial" and "machine learning basics" that are:

  • Between 3-20 minutes long
  • In HD with subtitles
  • Uploaded within the last month
  • Sorted by popularity

Search Filter Examples

Example 1: Recent HD Shorts

{
"searchQueries": ["cooking recipes"],
"searchFilters": {
"type": "shorts",
"features": ["hd"],
"uploadDate": "thisWeek"
}
}

Example 2: Long-form Educational Videos

{
"searchQueries": ["python programming"],
"searchFilters": {
"type": "videos",
"duration": "over20",
"features": ["subtitles"],
"sortBy": "relevance"
}
}

Example 3: 4K HDR Content

{
"searchQueries": ["nature documentary"],
"searchFilters": {
"type": "videos",
"features": ["4k", "hdr"],
"duration": "over20"
}
}

Output

The Actor outputs structured data for each video scraped:

{
"videoId": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"type": "video",
"description": "The official video for "Never Gonna Give You Up"...",
"thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"channelId": "@RickAstleyYT",
"channelName": "Rick Astley",
"channelUrl": "https://www.youtube.com/@RickAstleyYT",
"channelSubscribers": "3.5M subscribers",
"viewCount": 1500000000,
"likeCount": 15000000,
"commentCount": 1200000,
"uploadDate": "Oct 25, 2009",
"duration": "3:33",
"category": "Music",
"tags": ["rick astley", "never gonna give you up", "80s music"]
}

Supported URL Types

The Actor automatically detects and handles different YouTube URL types:

  • Videos: https://www.youtube.com/watch?v=VIDEO_ID or https://youtu.be/VIDEO_ID
  • Shorts: https://www.youtube.com/shorts/VIDEO_ID
  • Channels: https://www.youtube.com/@CHANNEL_NAME or https://www.youtube.com/channel/CHANNEL_ID
  • Playlists: https://www.youtube.com/playlist?list=PLAYLIST_ID
  • Search Results: https://www.youtube.com/results?search_query=QUERY

Use Cases

  • Market Research: Analyze video trends, engagement metrics, and popular content across all content types
  • Competitor Analysis: Monitor competitor channels and their video performance (videos, shorts, and streams)
  • Content Discovery: Find videos on specific topics for research or curation
  • SEO Analysis: Extract metadata and tags from successful videos
  • Data Analysis: Build datasets for machine learning or analytics projects
  • Channel Monitoring: Track new uploads and engagement on specific channels
  • Content Type Analysis: Compare performance across videos, shorts, and streams
  • Stream Analysis: Track live stream performance and archived streams

Performance Tips

  1. Use Proxies: YouTube may rate-limit or block requests without proxies. Enable Apify Proxy in the input.
  2. Limit Results: Use maxResults to control how many videos to scrape per source.
  3. Adjust Concurrency: The Actor uses conservative concurrency (3) to avoid blocks. This is configurable in the code.

Notes

  • The Actor respects YouTube's Terms of Service. Use responsibly and ethically.
  • For production use, always use proxies to avoid IP blocks
  • YouTube may show different content based on location/cookies
  • Some videos may have restricted data (age-restricted, private, etc.)