Youtube Scraper
by ayuugoyal
A powerful Apify Actor that scrapes YouTube videos from channels, playlists, or search results without using the official YouTube API. Built with Pyth...
Opens on Apify.com
About Youtube Scraper
A powerful Apify Actor that scrapes YouTube videos from channels, playlists, or search results without using the official YouTube API. Built with Python and the scrapetube library.
What does this actor do?
Youtube Scraper is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
YouTube Scraper Actor A powerful Apify Actor that scrapes YouTube videos from channels, playlists, or search results without using the official YouTube API. Built with Python and the scrapetube library. ## Features - Channel Scraping: Get videos from any YouTube channel - Support for channel ID, URL, or username - Filter by content type (videos, shorts, streams) - Sort by newest, oldest, or popular - Playlist Scraping: Extract all videos from any playlist - Search Scraping: Search YouTube and get results - Filter by result type (video, channel, playlist, movie) - Sort by relevance, upload date, view count, or rating - No API Key Required: Uses scrapetube to scrape data without YouTube API limitations - Proxy Support: Optional proxy configuration to avoid blocking - Structured Output: Clean, normalized data with thumbnails, view counts, and more ## Input Parameters ### Required - scrapeType (string): Choose what to scrape - channel, playlist, or search ### Channel Scraping - channelId (string): YouTube channel ID (e.g., UCXuqSBlHAE6Xw-yeJA0Tunw) - channelUrl (string): Full channel URL (alternative to channel ID) - channelUsername (string): Channel username without @ (alternative to channel ID) - contentType (string): Type of content - videos, shorts, or streams (default: videos) - sortBy (string): newest, oldest, or popular (default: newest) ### Playlist Scraping - playlistId (string): YouTube playlist ID ### Search Scraping - searchQuery (string): Search term to find videos - resultsType (string): video, channel, playlist, or movie (default: video) - sortBy (string): relevance, upload_date, view_count, or rating (default: relevance) ### Common Parameters - maxVideos (integer): Maximum number of videos to scrape (default: 100) - sleepInterval (number): Seconds to sleep between requests to prevent blocking (default: 1) - proxyUrls (array): Optional proxy URLs in format http://username:password@host:port ## Output The actor outputs structured data for each video including: - videoId: YouTube video ID - title: Video title - url: Full YouTube URL - channelName: Channel name - channelId: Channel ID - viewCount: Number of views - publishedTime: When the video was published - lengthText: Video duration - thumbnailUrl: Video thumbnail image URL - descriptionSnippet: Short description excerpt - rawData: Complete raw data from scrapetube ## Example Usage ### Scrape Latest Videos from a Channel json { "scrapeType": "channel", "channelUsername": "LinusTechTips", "contentType": "videos", "sortBy": "newest", "maxVideos": 50 } ### Search YouTube json { "scrapeType": "search", "searchQuery": "python tutorial", "resultsType": "video", "sortBy": "view_count", "maxVideos": 100 } ### Scrape a Playlist json { "scrapeType": "playlist", "playlistId": "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf", "maxVideos": 200 } ## Local Development ### Prerequisites - Python 3.11+ - Apify CLI ### Install Apify CLI Windows: powershell irm https://apify.com/install-cli.ps1 | iex macOS/Linux: bash curl -fsSL https://apify.com/install-cli.sh | bash ### Setup and Run 1. Install dependencies: bash pip install -r requirements.txt 2. Create a local input file .actor/INPUT.json: json { "scrapeType": "search", "searchQuery": "apify tutorial", "maxVideos": 10 } 3. Run locally: bash apify run ### Deploy to Apify Platform 1. Login to Apify: bash apify login 2. Push the actor: bash apify push ## Technical Details - Runtime: Python 3.11 - Base Image: apify/actor-python:3.11 - Main Libraries: - apify - Apify SDK for Python - scrapetube - YouTube scraping library ## Notes - The actor respects YouTube's structure and implements rate limiting via sleepInterval - No authentication or API key required - Data extraction is based on YouTube's public HTML structure - Some fields may be unavailable depending on the video/channel ## Contributing This actor was generated as part of the Apify AI Challenge. Feel free to submit improvements! ## License ISC ## Support For issues or questions, please open an issue on the GitHub repository.
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Youtube Scraper now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- ayuugoyal
- Pricing
- Paid
- Total Runs
- 33
- Active Users
- 3
Related Actors
🏯 Tweet Scraper V2 - X / Twitter Scraper
by apidojo
Instagram Scraper
by apify
TikTok Scraper
by clockworks
Instagram Profile Scraper
by apify
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support