YouTube Scraper avatar

YouTube Scraper

Pricing

Pay per usage

Go to Apify Store
YouTube Scraper

YouTube Scraper

Scrape YouTube videos, channels, comments, and playlists. Search by keyword, extract video details, comments, channel info, and playlist contents.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

abdulrahman alrashid

abdulrahman alrashid

Maintained by Community

Actor stats

1

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

Apify Actor for scraping YouTube videos, channels, comments, and playlists. Uses YouTube's internal API (youtubei/v1) for fast, reliable data extraction with CheerioCrawler for page scraping and PlaywrightCrawler as fallback.

Features

  • Search videos by keyword with pagination and type filtering (video, channel, playlist)
  • Scrape video details: title, description, view/like/comment counts, upload date, duration, channel info, tags, category, thumbnails, chapters
  • Scrape video comments with pagination: author, text, likes, reply count, published date, creator reply flag
  • Scrape channel info: name, subscribers, video count, total views, description, joined date, country, social links
  • Scrape channel video lists with sort options (newest, popular, oldest)
  • Scrape playlist contents: all video titles, URLs, durations, and playlist metadata

Input

FieldTypeDefaultDescription
searchKeywordsstring[][]Keywords to search YouTube for
videoUrlsstring[][]Direct video URLs to scrape details from
channelUrlsstring[][]Channel URLs to scrape info/videos from
playlistUrlsstring[][]Playlist URLs to scrape
scrapeCommentsbooleanfalseScrape comments for each video
maxCommentsinteger100Max comments per video (0 = unlimited)
maxSearchResultsinteger50Max results per search keyword (0 = unlimited)
maxChannelVideosinteger50Max videos per channel (0 = unlimited)
channelVideoSortstring"newest"Sort order: newest, popular, oldest
scrapeChannelInfobooleantrueScrape channel metadata
scrapeChannelVideosbooleantrueScrape channel video list
searchTypestring"video"Filter: video, channel, playlist, any
proxyConfigurationobjectnullProxy settings
maxRetriesinteger3Max retries for failed requests

Example Input

{
"searchKeywords": ["web scraping tutorial"],
"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
"channelUrls": ["https://www.youtube.com/@MrBeast"],
"playlistUrls": ["https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"],
"scrapeComments": true,
"maxComments": 50,
"maxSearchResults": 20,
"maxChannelVideos": 30,
"channelVideoSort": "popular",
"searchType": "video"
}

Output Examples

Search Result

{
"type": "video",
"videoId": "abc123",
"title": "How to Web Scrape in 2024",
"url": "https://www.youtube.com/watch?v=abc123",
"thumbnailUrl": "https://i.ytimg.com/vi/abc123/maxresdefault.jpg",
"duration": "12:34",
"durationSeconds": 754,
"viewCount": 150000,
"channelName": "TechChannel",
"publishedTimeText": "3 months ago",
"descriptionSnippet": "Learn web scraping with Python...",
"searchKeyword": "web scraping tutorial"
}

Video Detail

{
"type": "videoDetail",
"videoId": "abc123",
"title": "How to Web Scrape in 2024",
"description": "Full description text...",
"viewCount": 150000,
"likeCount": 5200,
"commentCount": 340,
"uploadDate": "2024-01-15",
"duration": "12:34",
"durationSeconds": 754,
"channelName": "TechChannel",
"channelId": "UCxxxxxxxx",
"channelUrl": "https://www.youtube.com/channel/UCxxxxxxxx",
"tags": ["web scraping", "python", "tutorial"],
"category": "Science & Technology",
"thumbnails": [],
"chapters": [
{ "title": "Introduction", "startSeconds": 0 }
]
}

Comment

{
"type": "comment",
"commentId": "xyz789",
"author": "UserName",
"authorChannelUrl": "https://www.youtube.com/@UserName",
"text": "Great tutorial, very helpful!",
"likeCount": 15,
"replyCount": 3,
"publishedTimeText": "2 months ago",
"isCreatorReply": false,
"videoId": "abc123"
}

Channel Info

{
"type": "channelInfo",
"channelId": "UCxxxxxxxx",
"channelName": "TechChannel",
"channelUrl": "https://www.youtube.com/channel/UCxxxxxxxx",
"description": "Channel description...",
"subscriberCount": 1200000,
"videoCount": 450,
"totalViews": 250000000,
"joinedDate": "Jan 15, 2018",
"country": "United States",
"socialLinks": [
{ "title": "Twitter", "url": "https://twitter.com/techchannel" }
]
}

Playlist Video

{
"type": "playlistVideo",
"videoId": "abc123",
"title": "Playlist Video Title",
"url": "https://www.youtube.com/watch?v=abc123",
"duration": "8:45",
"durationSeconds": 525,
"channelName": "TechChannel",
"index": 1,
"playlistId": "PLxxxxxxxx"
}

Pricing

This Actor uses Pay-Per-Event pricing at $0.35 per 1,000 results ($0.00035 per result). Each scraped item (video, comment, channel info entry, playlist video) counts as one result.

Technical Details

  • Uses YouTube's internal youtubei/v1 API for search, comments, channel browsing, and playlists
  • Falls back to page scraping via CheerioCrawler for video detail extraction (extracts ytInitialData and ytInitialPlayerResponse)
  • Uses PlaywrightCrawler as a secondary fallback when pages require JavaScript rendering
  • Handles pagination via continuation tokens for all data types
  • Built with Apify SDK v3 and Crawlee

This Actor is intended for personal use, research, and legitimate business purposes. Ensure your use complies with YouTube's Terms of Service and applicable laws. The Actor does not bypass any authentication or access restrictions.