My Actor avatar
My Actor

Pricing

Pay per usage

Go to Apify Store
My Actor

My Actor

Yt data scraper

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Kween Ash

Kween Ash

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

3

Monthly active users

7 days ago

Last modified

Categories

Share

YouTube Scraper Actor (no external APIs)

Scrape YouTube channels, playlists, videos, and search results using Playwright and YouTube’s own page data (DOM + window.ytInitial*). No YouTube Data API and no youtube-transcript-api.

What’s new

  • Channel info only mode: set channelInfoOnly = true to scrape only the channel’s “About” data for the URLs you provide (channel or video). The actor will not scrape any videos or run searches in this mode.
  • Accepts:
    • Channel URLs (e.g., https://www.youtube.com/@theleaderstalk, https://www.youtube.com/channel/UCC...)
    • Video URLs (the actor resolves the channel from the video)
    • A single @handle in searchTerms (e.g., ["@theleaderstalk"])

Output in this mode (type: "channel_info"):

  • channelName
  • channelUrl (prefers handle URL when available)
  • channelUsername (handle without the @)
  • channelId
  • description
  • channelLocation
  • joinedDate
  • channelTotalVideos
  • channelTotalViews (numeric) and channelTotalViewsFormatted (with commas)
  • numberOfSubscribers (numeric) and subscriberCountText
  • socialLinks (array of { title, url })
  • avatarUrl
  • isMonetized (best-effort)
  • sourceUrl (the input you provided)

Other capabilities

  • Channel enrichment (when not in channel-only mode):
    • name, URL, ID, @handle, subscriber counts, total views, total videos, location, social links, avatar, description, joined date
  • Video details:
    • title, URL, thumbnail, view count, likes (best-effort), comments count (best-effort)
    • release date (ISO), duration (seconds + HH:MM:SS), hashtags
    • optional subtitles scraped via the UI, optional comments
  • Search with rich UI filters (applied via YouTube “Filters” menu):
    • sorting, date filter, type, duration
    • feature toggles: HD, Subtitles/CC, Creative Commons, 3D, Purchased, 4K, 360°, Location
  • Per-term limits for search (videos/shorts/streams)

Input

Key fields:

  • channelInfoOnly (boolean): Only scrape channel About info for provided URLs. If true:
    • Provide one or more channel or video URLs in startUrls, or
    • Provide a single @handle in searchTerms; the actor will treat it as a channel.
  • startUrls: URLs to process (channel, video, playlist, search results)
  • directUrls: extra URLs to merge into startUrls
  • searchTerms: terms to search (ignored when channelInfoOnly is true unless a single @handle is provided)
  • Subtitles options: downloadSubtitles, saveSubsToKVS, subtitlesLanguage, preferAutoGeneratedSubtitles, subtitlesFormat
  • Search filters (non-channelOnly): searchSortOrder, searchDateFilter, searchVideoType, searchDuration
  • Features (non-channelOnly): hd, subtitles_cc, creative_commons, three_d, purchased, four_k, three_sixty, location
  • Limits: maxVideosPerTerm, maxShortsPerTerm, maxStreamsPerTerm, maxResults, maxComments
  • Filters for post-processing: dateFilter, videoRegex
  • proxyConfiguration, verboseLog

Examples

Channel info only

{
"channelInfoOnly": true,
"startUrls": [
{ "url": "https://www.youtube.com/@theleaderstalk" },
{ "url": "https://www.youtube.com/watch?v=zslTD2Mq00E" }
],
"proxyConfiguration": { "useApifyProxy": true }
}

Channel + videos (not channel-only)

{
"startUrls": [{ "url": "https://www.youtube.com/@LofiGirl" }],
"maxResults": 50,
"proxyConfiguration": { "useApifyProxy": true }
}

Search with filters

{
"searchTerms": ["traveler", "ai trends 2025"],
"maxVideosPerTerm": 15,
"maxShortsPerTerm": 8,
"maxStreamsPerTerm": 2,
"searchSortOrder": "relevance",
"searchDateFilter": "this_year",
"searchVideoType": "video",
"searchDuration": "any",
"hd": true,
"subtitles_cc": true,
"downloadSubtitles": true,
"fetchFullVideoDetails": true,
"maxResults": 30,
"proxyConfiguration": { "useApifyProxy": true }
}

To search for the keyword

{
"startUrls": [],
"searchTerms": ["marketing"],
"maxResults": 10,
"maxVideosPerTerm": 10,
"proxyConfiguration": { "useApifyProxy": false },
"verboseLog": false
}

Notes and limitations

  • YouTube does not expose subscriber usernames publicly; this actor cannot collect them.
  • Likes and comments counts can be hidden; values are best‑effort.
  • Layouts vary by region; enable Apify Proxy for more consistent results.

Local development

pip install -r requirements.txt
python -m playwright install --with-deps chromium
python main.py