# Youtube Smart Scraper (Pay Per Event) (`vtrdev/youtube-smart-scraper`) Actor

Extract YouTube data 3.5x faster with parallel processing. Get 30+ fields including views, likes, comments, thumbnails. 100+ countries supported. No API quotas or rate limits. Auto-resume prevents data loss - no subscriptions.

- **URL**: https://apify.com/vtrdev/youtube-smart-scraper.md
- **Developed by:** [VTRDEV](https://apify.com/vtrdev) (community)
- **Categories:** Videos, Social media, Developer tools
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Smart Scraper

Fast YouTube scraper with parallel processing. Extract video data without API rate limits or quota costs.

### 🎯 Why Choose This Scraper?

- **🚀 Fast**: Extract 10 videos in ~7 seconds with parallel processing
- **💎 Complete Data**: 30+ data fields including engagement metrics, thumbnails, and channel details
- **🌍 Global**: Geo-targeted results from 100+ countries
- **🔄 Auto-resume**: State persistence prevents data loss if interrupted
- **💰 No API Costs**: No YouTube API key or quota limits
- **🛡️ Reliable**: Smart proxy rotation prevents blocking

### ✨ Key Features

| Feature | Benefit |
|---------|---------|
| ⚡ **High-Speed Scraping** | Up to 50 parallel workers for maximum throughput |
| 💾 **Incremental Saving** | Data saved immediately as found - no lost data |
| 🔄 **State Persistence** | Auto-resume from exact point if interrupted |
| ♻️ **Smart Proxy Rotation** | Automatic residential proxy management |
| 🎯 **Shorts Detection** | Automatically identify YouTube Shorts vs regular videos |
| 🌍 **Geo-Targeting** | Get localized results from any country (100+ supported) |
| 🔤 **Auto Language Detection** | Language automatically detected from country |
| 🔍 **Powerful Filters** | Sort by relevance/date/views, filter by upload date |
| 🛡️ **Anti-Blocking Technology** | Advanced techniques to prevent detection |

### 📊 Performance Benchmarks

| Videos | Concurrency | Time | Speed |
|--------|-------------|------|-------|
| 10 | 20 workers | **~7s** | 1.4 videos/sec |
| 20 | 50 workers | **~6s** | 3.3 videos/sec |
| 50 | 50 workers | **~14s** | 3.5 videos/sec |
| 100 | 50 workers | **~28s** | 3.6 videos/sec |

*Based on average performance. Actual results may vary based on target location and YouTube's response times.*

### 🎛️ Input Parameters

| Field | Type | Description | Default |
|-------|------|-------------|---------|
| **searchQueries** | array | Keywords to search for | `["python tutorial", "web scraping"]` |
| **maxVideos** | integer | Maximum videos to scrape (1-1000) | `10` |
| **sortBy** | string | Sort: `relevance`, `date`, `viewCount`, `rating` | `relevance` |
| **uploadDate** | string | Filter: `lastHour`, `today`, `thisWeek`, `thisMonth`, `thisYear` | `Any time` |
| **country** | string | Geo-target Country Code (e.g. US, GB, ID, JP) | `US` |
| **language** | string | Language (leave empty for auto-detect from country) | `Auto-detect` |
| **maxConcurrency** | integer | Parallel workers (1-50, higher = faster) | `20` |

> **💡 Tip**: Use higher concurrency (30-50) for fastest results with large batches.

### 📝 Input Examples

#### Basic Search

```json
{
  "searchQueries": ["apify scraper", "python web scraping"],
  "maxVideos": 20,
  "sortBy": "relevance"
}
```

#### High-Speed Extraction (Recommended)

```json
{
  "searchQueries": ["machine learning tutorial"],
  "maxVideos": 50,
  "maxConcurrency": 50,
  "country": "US",
  "sortBy": "viewCount"
}
```

#### Geo-Targeted Search

```json
{
  "searchQueries": ["local news"],
  "maxVideos": 30,
  "country": "ID",
  "language": "id",
  "uploadDate": "thisWeek"
}
```

#### Recent Content Discovery

```json
{
  "searchQueries": ["AI tools 2024"],
  "maxVideos": 100,
  "maxConcurrency": 50,
  "uploadDate": "thisMonth",
  "sortBy": "date"
}
```

### 📦 Output Example

Each video object contains **30+ data fields**:

```json
{
  "id": "m8DXAsyaMK0",
  "url": "https://www.youtube.com/watch?v=m8DXAsyaMK0",
  "title": "Python beginner course | Great for kids!",
  "viewCount": 242409,
  "durationSeconds": 2935,
  "duration": "48:55",
  "date": "20230125",
  "uploadDate": "20230125",
  "text": "This beginner Python tutorial is a great place to start if you have never typed any code before. We break down the early topics and build 8 incredible projects in under 1 hour.",
  "thumbnails": {
    "default": "https://i.ytimg.com/vi_webp/m8DXAsyaMK0/sddefault.webp",
    "mq": "https://i.ytimg.com/vi_webp/m8DXAsyaMK0/mqdefault.webp",
    "hq720": "https://i.ytimg.com/vi_webp/m8DXAsyaMK0/hq720.webp",
    "maxres": "https://i.ytimg.com/vi_webp/m8DXAsyaMK0/maxresdefault.webp"
  },
  "thumbnailUrl": "https://i.ytimg.com/vi_webp/m8DXAsyaMK0/maxresdefault.webp",
  "channelName": "Hackingtons Code School",
  "channelId": "UCZm9lZj5tnybywdAsfI6GHw",
  "channelUrl": "https://www.youtube.com/channel/UCZm9lZj5tnybywdAsfI6GHw",
  "subscriberCount": 10600,
  "isVerified": false,
  "isVerifiedArtist": false,
  "uploader": "Hackingtons Code School",
  "likeCount": 3365,
  "commentCount": 284,
  "engagementRate": 1.51,
  "keywords": ["hackingtons", "coding for kids", "python for kids", "python tutorial for kids", "python crash course"],
  "isFamilySafe": true,
  "isAgeRestricted": false,
  "isShorts": false,
  "subtitleLanguages": ["ar", "zh-Hant", "nl", "fr", "de", "hi", "id", "it", "ja", "ko", "pt", "ru", "es", "th", "uk", "vi", "en"],
  "searchQuery": "python tutorial"
}
```

### � Pricing - Simple & Transparent

**Pay only for what you scrape** - no hidden fees, no subscriptions!

| What You Get | Cost | Per Video | Example |
|--------------|------|-----------|---------|
| 🎬 **10 videos** | ~$0.021 | $0.002/video | Market research |
| 📊 **100 videos** | ~$0.201 | $0.002/video | Competitor analysis |
| 🚀 **1,000 videos** | ~$2.001 | $0.002/video | Large-scale data extraction |
| 💎 **10,000 videos** | ~$20.01 | $0.002/video | Enterprise analytics |

\*Plus one-time $0.001 actor start fee per run.

**What you get:**

- ⚡ **Fast**: ~5 minutes for 1,000 videos (3+ videos/second)
- 📊 **Complete data**: 30+ fields per video
- 🌍 **Global**: 100+ countries supported
- 🛡️ **No maintenance**: Proxy and anti-blocking handled automatically
- ♻️ **Auto-resume**: Data saved incrementally
- 📄 **Export**: JSON/CSV format

### 🚀 What's New in v5.2

- **⚡ True Parallel Processing**: Optimized concurrency for maximum speed
- **🎯 3.5x Performance Boost**: From 25s → 7s for 10 videos
- **♻️ Smart Rotation**: Intelligent request management
- **🌍 Auto Language Detection**: 100+ countries supported automatically
- **🛡️ Enhanced Reliability**: Improved success rate with smart retries

### 💡 Use Cases

- **📊 Market Research**: Analyze trending content in your niche
- **🎬 Content Planning**: Find high-performing videos to inspire your content
- **🏢 Competitive Analysis**: Monitor competitors' video performance
- **📰 News Monitoring**: Track breaking news across countries
- **🎓 Educational Content**: Find tutorials and courses on any topic
- **📈 SEO Research**: Discover high-traffic keywords and topics
- **🛍️ Product Research**: Analyze product reviews and unboxing videos
- **🎵 Music Discovery**: Track trending music and artist content

### 🌍 Supported Countries

100+ countries supported including:

- **Americas**: US, CA, BR, MX, AR, CO, PE, CL...
- **Europe**: GB, DE, FR, IT, ES, NL, PL, RU...
- **Asia**: JP, KR, ID, IN, PH, SG, TH, VN, MY...
- **Middle East**: SA, AE, EG, TR, IL...
- **Africa**: ZA, NG, EG, MA...
- **Oceania**: AU, NZ...

### ✅ Data Quality

- **30+ Data Fields** per video
- **Engagement Metrics**: views, likes, comments, engagement rate
- **Channel Details**: name, ID, subscriber count, verification status
- **Video Metadata**: duration, upload date, thumbnails, keywords
- **Shorts Detection**: Automatically identifies YouTube Shorts
- **Validation**: Comprehensive data validation ensures accuracy

### ❓ Frequently Asked Questions

#### ⚡ **"How fast is it?"**

Benchmarks with parallel processing:

- 10 videos in ~7 seconds
- 100 videos in ~28 seconds
- 1,000 videos in ~5 minutes

Speed comes from parallel processing (up to 50 workers). Actual performance varies based on network conditions and target location.

#### 🌍 **"Can I scrape videos from specific countries?"**

Yes. Supported features:

- 100+ countries supported
- Proxies automatically match your target country
- Language auto-detected from country (can override manually)
- Results match what users in that country see

Useful for market research and regional content analysis.

#### 🛡️ **"Will I get blocked by YouTube?"**

Unlikely. Anti-blocking measures:

- Smart proxy rotation with residential IPs
- Browser emulation to mimic real users
- Per-thread rate limiting
- Auto-retry logic for failed requests

No system is 100% block-proof, but these techniques significantly reduce the risk.

#### 💾 **"What if the scraper crashes mid-run?"**

State persistence features:

- Data saved incrementally as videos are found
- Auto-resume from last checkpoint if interrupted
- No data loss on crashes or network issues

If you crash at video 750, restart continues from that point.

#### 📊 **"What data do I get?"**

30+ fields per video:

**Engagement**: Views, likes, comments, engagement rate

**Video**: Title, description (text), duration, upload date, keywords, thumbnails (4 resolutions), subtitle languages

**Channel**: Name, ID, subscriber count, verified status, verified artist status

**Technical**: Video ID, URL, is\_shorts flag, family safe flag, age restricted flag

**Metadata**: Search query, thumbnail URL

Exported as JSON/CSV.

#### 🎯 **"Should I build my own scraper?"**

**Building yourself:**

- Development time: 40+ hours
- Maintenance when YouTube updates
- Proxy costs: $50-200/month
- Debugging and troubleshooting

**Using this scraper:**

- Ready to use immediately
- $2 per 1,000 videos (pay per use)
- Maintenance handled automatically
- Tested infrastructure

Cost-effective if you need occasional scraping. Build your own if you need full control or have ongoing high-volume needs.

#### 🆓 **"Can I try it for free?"**

Yes. Apify gives new users $5 free credits:

- \~2,500 videos free
- Test all features
- No credit card required

Enough to evaluate if it fits your needs.

#### 🔧 **"Is it easy to use?"**

3 steps:

1. Enter search queries
2. Configure filters (country, sort, max videos)
3. Start and download results

No coding required. Results export as CSV/JSON.

# Actor input Schema

## `searchQueries` (type: `array`):

Enter keywords to search for on YouTube

## `maxVideos` (type: `integer`):

Maximum number of videos to scrape (recommended: 10-100 for faster results)

## `sortBy` (type: `string`):

Sort search results by

## `uploadDate` (type: `string`):

Filter by upload date

## `country` (type: `string`):

Country for localized results AND Proxy Location. Apify Proxy will automatically run from this country to ensure correct geo-targeted results.

## `language` (type: `string`):

Language for results (optional - leave empty to auto-detect from Country)

## `maxConcurrency` (type: `integer`):

Maximum concurrent video extraction threads (1-50, higher = much faster with proper rotation)

## Actor input object example

```json
{
  "searchQueries": [
    "python tutorial",
    "web scraping"
  ],
  "maxVideos": 10,
  "sortBy": "relevance",
  "uploadDate": "",
  "country": "US",
  "language": "",
  "maxConcurrency": 20
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "python tutorial",
        "web scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vtrdev/youtube-smart-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "searchQueries": [
        "python tutorial",
        "web scraping",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("vtrdev/youtube-smart-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "python tutorial",
    "web scraping"
  ]
}' |
apify call vtrdev/youtube-smart-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vtrdev/youtube-smart-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/iaiR0CKFfj1yh4nR8/builds/314Z6bSeNdCiUoQkX/openapi.json
