# YouTube Search Scraper - Extract Videos, Shorts, Channels (`igview-owner/youtube-search-scraper`) Actor

Powerful YouTube Search Scraper to extract videos, shorts, channels, and playlists with complete metadata. Perfect for market research, SEO analysis, and content discovery.

- **URL**: https://apify.com/igview-owner/youtube-search-scraper.md
- **Developed by:** [Sachin Kumar Yadav](https://apify.com/igview-owner) (community)
- **Categories:** Videos, SEO tools, Developer tools
- **Stats:** 35 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Search Scraper - Extract YouTube Search Results

**Search and scrape YouTube videos, channels, playlists, and shorts. Extract comprehensive metadata including titles, views, thumbnails, channel info, and more with advanced filtering options. Perfect for market research, content analysis, and data collection!**

### 📋 Table of Contents

- [🚀 Features](#-features)
- [🎯 Use Cases](#-use-cases)
- [⚡ Quick Start](#-quick-start)
- [📊 Input Parameters](#-input-parameters)
- [📤 Output Format](#-output-format)
- [🔧 Advanced Filters](#-advanced-filters)
- [❓ FAQ](#-faq)

### 🚀 Features

#### 🔎 **Search Capabilities**

- ✅ **Powerful Search** - Search any YouTube content with keywords
- ✅ **Multiple Content Types** - Videos, Shorts, Channels, Playlists, Movies, Shows
- ✅ **Pagination Support** - Automatically fetch multiple pages of results
- ✅ **Advanced Filtering** - Filter by duration, upload date, and content type
- ✅ **Smart Sorting** - Sort by relevance, rating, date, or views

#### 📊 **Metadata Extraction**

- ✅ **Complete Video Information** - Title, description, duration, view count
- ✅ **Channel Details** - Channel name, ID, handle, and thumbnails
- ✅ **Engagement Metrics** - View counts, publish dates, and badges
- ✅ **Thumbnails** - Multiple thumbnail sizes and formats
- ✅ **Rich Data** - Publication dates, video URLs, and more

#### 🌍 **Global Support**

- ✅ **25+ Countries** - Localized search results for different regions
- ✅ **18+ Languages** - Multi-language support for global content
- ✅ **Regional Trending** - Access region-specific trending content

### 🎯 Use Cases

| Use Case | Description | Benefits |
|----------|-------------|----------|
| 📊 **Market Research** | Analyze trending content and competitor videos | Identify trends, track competitors, content strategy |
| 🎓 **Content Discovery** | Find educational and tutorial videos | Curate learning materials, discover new creators |
| 📈 **SEO Analysis** | Research video keywords and metadata | Optimize video titles, improve discoverability |
| 🎬 **Content Curation** | Build video collections and playlists | Organize content, create recommendations |
| 📱 **Social Media Monitoring** | Track viral videos and trending topics | Stay updated, identify opportunities |
| 🔍 **Competitive Analysis** | Monitor competitor channels and content | Benchmark performance, strategy insights |

### ⚡ Quick Start

#### 1️⃣ **Basic Search**

```json
{
  "query": "funny videos",
  "maxResults": 20
}
```

#### 2️⃣ **Advanced Search with Filters**

```json
{
  "query": "cooking recipes",
  "maxResults": 50,
  "geo": "US",
  "lang": "en",
  "type": "video",
  "duration": "medium",
  "upload_date": "week",
  "sort_by": "views"
}
```

#### 3️⃣ **Search YouTube Shorts**

```json
{
  "query": "travel shorts",
  "maxResults": 30,
  "type": "shorts",
  "sort_by": "date"
}
```

### 📊 Input Parameters

| Parameter | Type | Required | Description | Default |
|-----------|------|----------|-------------|---------|
| `query` | String | ✅ | Search term or keywords | - |
| `maxResults` | Integer | ❌ | Maximum results to scrape (1-100) | `20` |
| `geo` | String | ❌ | Country/region code (US, IN, GB, etc.) | `US` |
| `lang` | String | ❌ | Language code (en, hi, es, etc.) | `en` |
| `type` | String | ❌ | Content type filter | `video` |
| `duration` | String | ❌ | Video duration filter | - |
| `upload_date` | String | ❌ | Upload date filter | - |
| `sort_by` | String | ❌ | Sort results by | `relevance` |

#### 🎬 **Content Types**

- `video` - Regular YouTube videos
- `shorts` - YouTube Shorts
- `channel` - YouTube channels
- `playlist` - Video playlists
- `movie` - YouTube movies
- `show` - YouTube shows

#### ⏱️ **Duration Filters**

- `short` - Less than 4 minutes
- `medium` - 4 to 20 minutes
- `long` - More than 20 minutes

#### 📅 **Upload Date Filters**

- `hour` - Last hour
- `today` - Today
- `week` - This week
- `month` - This month
- `year` - This year

#### 🔢 **Sort Options**

- `relevance` - Most relevant (default)
- `rating` - Highest rated
- `date` - Newest first
- `views` - Most viewed

### 📤 Output Format

#### 🎬 **Video/Shorts Data Structure**

```json
{
  "type": "video",
  "videoId": "FkZX68lZEH8",
  "title": "Try Not To Laugh 🤣 Top 100 Funniest Videos",
  "description": "Try Not To Laugh Top 100 Funniest Videos...",
  "viewCount": "42129",
  "viewCountText": "42,129 views",
  "publishedTimeText": "1 day ago",
  "publishDate": "2025-12-04",
  "publishedAt": "2025-12-04T00:00:00Z",
  "lengthText": "35:39",
  "channelTitle": "FMW - Funny Moments",
  "channelId": "UCw92QzuT_stf8jSaGWoKawQ",
  "channelHandle": "@FMW650",
  "badges": ["New"],
  "videoUrl": "https://www.youtube.com/watch?v=FkZX68lZEH8",
  "thumbnail": [...],
  "channelThumbnail": [...]
}
```

#### 📊 **Data Fields Explained**

- **videoId** - Unique YouTube video identifier
- **title** - Video title
- **description** - Video description snippet
- **viewCount** - Numeric view count
- **viewCountText** - Formatted view count (e.g., "1.2M views")
- **publishedTimeText** - Relative publish time (e.g., "2 days ago")
- **publishDate** - ISO date format
- **lengthText** - Video duration (e.g., "10:25")
- **channelTitle** - Channel name
- **channelHandle** - Channel handle (e.g., @username)
- **badges** - Video badges (New, Live, etc.)
- **videoUrl** - Direct video URL

### 🔧 Advanced Filters

#### 🌍 **Supported Regions**

🇺🇸 United States, 🇮🇳 India, 🇬🇧 United Kingdom, 🇩🇪 Germany, 🇯🇵 Japan, 🇧🇷 Brazil, 🇨🇦 Canada, 🇫🇷 France, 🇪🇸 Spain, 🇷🇺 Russia, 🇦🇺 Australia, 🇮🇹 Italy, 🇳🇱 Netherlands, 🇹🇷 Türkiye, 🇮🇩 Indonesia, 🇲🇽 Mexico, 🇰🇷 South Korea, 🇸🇦 Saudi Arabia, 🇦🇪 UAE, 🇵🇰 Pakistan, 🇵🇭 Philippines, 🇹🇭 Thailand, 🇻🇳 Vietnam, 🇪🇬 Egypt, 🇳🇬 Nigeria

#### 🗣️ **Supported Languages**

🇬🇧 English, 🇮🇳 Hindi, 🇪🇸 Spanish, 🇫🇷 French, 🇩🇪 German, 🇯🇵 Japanese, 🇰🇷 Korean, 🇧🇷 Portuguese, 🇷🇺 Russian, 🇸🇦 Arabic, 🇮🇹 Italian, 🇮🇩 Indonesian, 🇹🇷 Turkish, 🇻🇳 Vietnamese, 🇹🇭 Thai, 🇨🇳 Chinese, 🇳🇱 Dutch, 🇵🇱 Polish

### ❓ FAQ

#### **Q: How many results can I scrape?**

**A:** You can scrape up to 100 results per run. The actor automatically handles pagination to fetch multiple pages.

#### **Q: Can I search for YouTube Shorts specifically?**

**A:** Yes! Set the `type` parameter to `"shorts"` to search only for YouTube Shorts.

#### **Q: How do I get the latest videos?**

**A:** Use `"upload_date": "today"` or `"upload_date": "week"` and `"sort_by": "date"` to get the newest content.

#### **Q: Can I search in different languages?**

**A:** Yes! Use the `lang` parameter to specify your preferred language (e.g., "hi" for Hindi, "es" for Spanish).

#### **Q: How do I find trending videos in a specific country?**

**A:** Set the `geo` parameter to your target country (e.g., "IN" for India) and use `"sort_by": "views"`.

#### **Q: What's the difference between viewCount and viewCountText?**

**A:** `viewCount` is a numeric value (e.g., 42129), while `viewCountText` is formatted text (e.g., "42,129 views").

#### **Q: Are there any usage limits?**

**A:** Usage depends on your Apify subscription plan. The actor is optimized for efficient API usage with built-in rate limiting.

#### **Q: Can I scrape channel information?**

**A:** Yes! Set `"type": "channel"` to search for channels instead of videos.

#### 🔍 **Debug Tips**

1. **Start Simple** - Begin with just a query, then add filters
2. **Check Logs** - Review actor run logs for detailed information
3. **Test Filters** - Try different filter combinations to optimize results
4. **Validate Region** - Ensure geo/lang codes are valid ISO codes
5. **Adjust Max Results** - Start with smaller numbers (10-20) for testing

#### 💡 **Best Practices**

- Use specific search queries for better results
- Combine filters strategically (e.g., duration + upload\_date)
- Set appropriate maxResults based on your needs
- Use geo/lang parameters for localized content
- Monitor usage to stay within limits

***

### 🏷️ **Tags**

`youtube search`, `youtube scraper`, `youtube api`, `video metadata`, `youtube shorts scraper`, `youtube data extraction`, `youtube search api`, `youtube video scraper`, `youtube channel scraper`, `youtube playlist scraper`, `youtube trending`, `youtube analytics`, `youtube seo`, `youtube research`, `youtube automation`, `apify actor`, `youtube data mining`, `content discovery`, `video search`, `youtube insights`

***

### 🚀 Get Started Now

**Ready to extract YouTube search results?**

1. 👤 Enter the **query** (e.g., `funny videos`)
2. 📝 Enter the **maxResults** (e.g., `20`)
3. 🌍 Select the **geo** (US, GB, DE, etc.)
4. ▶️ Click **Start** to run the actor
5. 📥 Download your data in JSON, CSV, Excel, or HTML format
6. Click ["Try for free"](https://apify.com?fpr=ykgg9c) to test the actor

**⭐ Star this actor if it helps you scrape YouTube search results efficiently!**

### Related Actors 🤝

Looking for more YouTube data? Check out these complementary actors:

- **[YouTube Video Downloader](https://apify.com/igview-owner/youtube-video-downloader-api)**
- **[YouTube Comment Scraper](https://apify.com/igview-owner/youtube-comment-finder)**

*Built with ❤️ using Apify Platform*

# Actor input Schema

## `query` (type: `string`):

Enter your YouTube search term. Example: 'funny videos', 'cooking recipes', 'tech reviews'

## `maxResults` (type: `integer`):

Maximum number of search results to scrape (1-100). Higher values may take longer to process.

## `geo` (type: `string`):

Select the region for localized search results. Different regions may show different trending content.

## `lang` (type: `string`):

Select the preferred language for search results and metadata.

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

Filter search results by content type. Choose what kind of content you want to scrape.

## `duration` (type: `string`):

Filter videos by duration length. Only applicable for video content type.

## `upload_date` (type: `string`):

Filter videos by when they were uploaded. Get the latest or older content.

## `sort_by` (type: `string`):

Choose how to sort the search results. Different sorting can reveal different content.

## Actor input object example

```json
{
  "query": "funny videos",
  "maxResults": 20,
  "geo": "US",
  "lang": "en",
  "type": "video",
  "sort_by": "relevance"
}
```

# Actor output Schema

## `overview` (type: `string`):

Open the dataset view with an overview of all YouTube search results including type, title, channel, views, and more.

# 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 = {
    "query": "funny videos",
    "maxResults": 20,
    "geo": "US",
    "lang": "en",
    "type": "video",
    "sort_by": "relevance"
};

// Run the Actor and wait for it to finish
const run = await client.actor("igview-owner/youtube-search-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 = {
    "query": "funny videos",
    "maxResults": 20,
    "geo": "US",
    "lang": "en",
    "type": "video",
    "sort_by": "relevance",
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "funny videos",
  "maxResults": 20,
  "geo": "US",
  "lang": "en",
  "type": "video",
  "sort_by": "relevance"
}' |
apify call igview-owner/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=igview-owner/youtube-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/B1i13N0IVucgKHx82/builds/DNqnQ7VoigqhJXPeC/openapi.json
