YouTube Search Scraper avatar

YouTube Search Scraper

Pricing

from $0.90 / 1,000 results

Go to Apify Store
YouTube Search Scraper

YouTube Search Scraper

An optimized YouTube scraper to search videos, shorts, and streams by keywords, playlists, or channel URLs. Extract rich metadata, views, likes, and download subtitles/transcripts automatically.

Pricing

from $0.90 / 1,000 results

Rating

0.0

(0)

Developer

seungkyu cho

seungkyu cho

Maintained by Community

Actor stats

1

Bookmarked

1

Total users

1

Monthly active users

3.6 days

Issues response

a day ago

Last modified

Share

๐Ÿš€ Ultimate YouTube Scraper: Video, Search, Subtitles, Channels & Playlists (Fast & Ultra-Low Cost)

Apify Actor Node.js Playwright License: MIT Memory Optimized

A highly optimized, production-grade YouTube Scraper engineered to extract deep metadata, search queries, channel lists, playlists, and full transcripts/subtitles. It is designed to maximize speed, ensure bypasses against anti-bot triggers, and operate on an ultra-low memory budget to save you up to 80% on cloud compute fees.


๐Ÿ’ก Why Choose This YouTube Scraper? (Key Advantages)

Unlike other heavy, browser-only scrapers on the market that easily crash or consume massive amounts of RAM, this actor is designed for maximum business utility and cost efficiency.

Feature / Advantage๐Ÿš€ This ScraperโŒ Generic ScrapersYour Benefit
Minimum RAM Requirement256 MB1 GB - 2 GBSave ~80% on platform compute costs.
Hybrid Execution EngineYes (HTTP + Playwright)No (Browser Only)Fast queries bypass slow page renders.
Absolute Epoch TimestampsYes (interpolatedTimestamp)No (Vague relative dates)Ready-to-use data for time-series and AI.
Robust Subtitle DownloaderYes (SRT, VTT, TXT, JSON)No or LimitedInstant text corpus for LLMs and NLP training.
Targeted Geo & LanguageYes (gl and hl control)No (Forced English/US)Get localized search order and original language titles.
Duplication GuardYes (Automated Deduplication)NoNo wasted storage; you pay only for unique data.
Auto V8 Garbage CollectionYes (Container Safe)NoEliminates Out-Of-Memory (OOM) failures mid-job.

๐Ÿ—๏ธ Technical Architecture

The scraper implements a smart multi-stage dispatch pipeline to execute high-throughput extraction while keeping resources low.

graph TD
A[Input JSON Config] --> B{Task Distributor}
B -- "Search Query / Search URL" --> C[HTTP InnerTube API - Ultra Fast]
B -- "Channel Handle / Playlist URL" --> D[Playwright Stealth Browser]
C --> E[Video IDs & Search Metadata]
D --> E
E --> F[Stage 2: Deep Watch Page Extraction]
F --> G[Extract InnerTube Player Details: Views, Likes, Description]
F --> H[Extract Captions / Subtitles if enabled]
G --> I[Relational Timestamp Interpolator]
H --> J[Compile Dataset Item]
I --> J
J --> K[Push to Apify Dataset]
K --> L[V8 Garbage Collection Memory Cleanup]

๐ŸŽฏ Business Use Cases & Value Drivers

This tool is more than just a scraper; it is a pipeline feeder for critical data operations:

  • ๐Ÿง  AI & LLM Training: Extract clean video transcripts/subtitles (available in multiple formats) and video details to compile datasets for natural language processing, summarization, and custom AI agents.
  • ๐Ÿ“Š Market & Trend Monitoring: Analyze video views, likes, upload dates, and engagement velocities to identify emerging viral trends before they peak.
  • ๐Ÿ•ต๏ธ Competitor & Brand Intelligence: Track brand mentions, monitor competitor channel uploads, and analyze video tags and descriptions to optimize your own YouTube SEO.
  • ๐Ÿค Influencer Marketing: Search for target keywords to find high-performing creators, analyze their subscriber-to-like engagement ratios, and export lists for partnership outreach.

โš™๏ธ Full Configuration Parameters

The Actor accepts a comprehensive JSON configuration, allowing you to fine-tune the scraping behavior to balance depth, speed, and cost.

๐Ÿ” Main Targets & Input

ParameterTypeDefaultDescription
searchQueriesarray[]List of search keywords or phrases to query.
startUrlsarray[]Direct YouTube URLs to scrape (supports Videos, Channel URLs, or Playlist URLs).
channelHandlesarray[]Channel handles (e.g. @SpaceX, UC3xY...) to fetch uploads from.

๐Ÿ“Š Results & Limits

ParameterTypeDefaultDescription
maxResultsinteger50Maximum standard video results to collect per query/channel/playlist source.
maxResultsShortsinteger0Maximum YouTube Shorts results to scrape per source.
maxResultStreamsinteger0Maximum YouTube Live Streams to scrape per source.
concurrencyLimitinteger3Parallel scraping workers to run concurrently (increases speed).
batchSizeinteger1Number of items to batch together before flushing to dataset storage.

๐Ÿ› ๏ธ Filtering & Sorting

ParameterTypeDefaultDescription
sortingOrderstring"relevance"Sort search results: relevance, popularity (views), uploadDate, or rating.
dateFilterstring"any"Upload date filter: any, hour, today, thisWeek, thisMonth, thisYear.
lengthFilterstring"any"Video duration filter: any, under4 (mins), between420 (4-20 mins), over20 (mins).
featuresstring"any"Special features filter: any, live, 4k, hd, subtitles, creativeCommons, 3d, hdr.
sortVideosBystring"NEWEST"Sort channel tab videos: NEWEST, OLDEST, POPULAR.
oldestPostDatestring""Optional ISO date limit. Stop scraping if video is older than this date (e.g., "2025-01-01").
useQueryExpansionbooleanfalseEnable to expand query terms for broader, semantic search coverage.

๐Ÿ’ฌ Subtitles & Localisation

ParameterTypeDefaultDescription
downloadSubtitlesbooleanfalseSet to true to extract full transcripts.
subtitlesFormatstring"srt"Subtitle output format: srt, vtt, txt, json.
preferAutoGeneratedSubtitlesbooleanfalseFallback to auto-translated/auto-generated transcripts if manual ones are missing.
saveSubsToKVSbooleanfalseStore heavy transcript text files to Apify Key-Value Store instead of inline Dataset items to save file space.
hlstring"en"Host Language code (e.g., ko, ja, es). Forces YouTube to return data in specific translations.
glstring"US"Geographical localization country code (e.g., KR, JP, FR). Influences search rankings and trend relevance.

๐ŸŒ System & Bypasses

ParameterTypeDefaultDescription
usePlaywrightbooleanfalseForce browser automation for all tasks (Warning: increases RAM consumption).
channelTabstring"videos"Channel tab to scrape: videos, shorts, streams, playlists, community, about.
proxyConfigurationobject{"useApifyProxy": true}Proxy configuration details. Residential proxies are highly recommended.

๐Ÿ“ฆ Output Dataset Schema

Each item pushed to the Apify dataset represents a detailed video report:

{
"id": "R8m3G1E4s-g",
"url": "https://www.youtube.com/watch?v=R8m3G1E4s-g",
"title": "SpaceX Starship Test Flight 4 Launch",
"description": "Watch SpaceX launch Starship Flight 4 from Starbase, Texas...",
"thumbnailUrl": "https://i.ytimg.com/vi/R8m3G1E4s-g/maxresdefault.jpg",
"channelName": "SpaceX",
"channelUrl": "https://www.youtube.com/@SpaceX",
"channelId": "UC3xYfSxxxxxxx",
"channelSubscriberCount": "15.4M subscribers",
"lengthSeconds": 3600,
"viewCount": 2450000,
"likes": 120000,
"publishedDate": "2026-06-25T12:00:00.000Z",
"publishedTimeText": "2 days ago",
"interpolatedTimestamp": 1744027200000,
"badges": ["4K", "CC"],
"keywords": ["space", "rocket", "starship"],
"transcript": "[00:01] Welcome back...\n[00:10] Starship is fully fueled...",
"subtitlesLanguage": "en"
}

๐Ÿš€ Get Started

Run via Apify Client (Node.js SDK)

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('your-username/youtube-search-scraper').call({
searchQueries: ["Generative AI Trends"],
maxResults: 50,
downloadSubtitles: true,
subtitlesFormat: "txt",
hl: "en",
gl: "US",
proxyConfiguration: {
useApifyProxy: true,
apifyProxyGroups: ["RESIDENTIAL"]
}
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Successfully scraped ${items.length} videos!`);

Local Development Setup

  1. Clone & Install Dependencies:
    $npm install
  2. Configure Input: Edit input.json in the root folder.
  3. Run the Actor:
    $npm start
  4. Execute Local Tests:
    $npm test

๐Ÿ›ก๏ธ License & Disclaimers

  • License: MIT Licensed. Free to customize, modify, and distribute.
  • Disclaimer: This scraper is intended for research, analytics, and archiving purposes. Please utilize proxies responsibly and respect YouTube's Terms of Service.