# YouTube Search Results Scraper - Video Data (`benthepythondev/youtube-search-results-scraper`) Actor

Scrape YouTube search results by keyword: video title, URL, description, duration, channel, channel URL, views, thumbnail and verification flag.

- **URL**: https://apify.com/benthepythondev/youtube-search-results-scraper.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** Social media, Marketing, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Results Scraper - Video & Channel Data

Scrape YouTube search results by keyword and export clean video metadata in one run. Get video title, URL, description, duration, channel, channel URL, uploader id, view count, thumbnail, verification flag and the query that produced each result. Export to JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### What is the YouTube Search Results Scraper?

YouTube search is one of the easiest ways to discover content, competitors, creators and market trends. This actor turns keyword searches into structured datasets that can be used for SEO research, influencer discovery, content monitoring, topic analysis, video prospecting and reporting.

The actor uses `yt-dlp` flat extraction. It does not download videos. It only reads metadata for search-result entries, which keeps runs lightweight and practical for scheduled workflows.

#### What data does it extract?

- **Video metadata:** title, video id, watch URL, description, duration and thumbnail.
- **Channel metadata:** channel name, channel id, channel URL, uploader id and verification flag when available.
- **Performance signals:** view count and publish timestamp when YouTube exposes them in the result.
- **Search context:** the exact query that produced each row, useful when exporting multiple keyword groups.

### Input

Add one or more search phrases in `queries`. Examples:

- `python tutorial`
- `ai agents`
- `shopify dropshipping`
- `real estate investing`
- `fitness coaching`

Set `maxResults` to control how many videos are returned per query. The default is intentionally small enough for quick tests.

#### Example input

```json
{
  "queries": ["python tutorial", "ai automation agency"],
  "maxResults": 10
}
````

### Output

Each dataset row can include:

```json
{
  "video_id": "abc123",
  "url": "https://www.youtube.com/watch?v=abc123",
  "title": "Python Tutorial for Beginners",
  "description": "Learn Python from scratch...",
  "duration_seconds": 3600,
  "channel": "Example Channel",
  "channel_id": "UC123",
  "channel_url": "https://www.youtube.com/channel/UC123",
  "uploader_id": "examplechannel",
  "view_count": 1250000,
  "timestamp": 1767139200,
  "thumbnail": "https://i.ytimg.com/...",
  "channel_is_verified": true,
  "query": "python tutorial"
}
```

### Use cases

🎥 **SEO and content research:** Search the same keyword set weekly and compare which video titles, channels and thumbnails appear. This is useful for content teams planning new videos or studying what YouTube rewards in a niche.

🧲 **Influencer discovery:** Search buyer-intent or niche keywords, then use the channel fields to build a shortlist of creators. You can enrich the channel URLs later with emails, websites or social links.

📊 **Competitive monitoring:** Brands can watch keywords around their products, competitors, categories or problem statements. The output is easy to store and compare over time.

🧠 **Market research:** Agencies, investors and product teams can use YouTube search results as a public signal for what audiences are learning, comparing and buying.

🗂️ **Video lead lists:** Build a dataset of channels and videos around a market, then pipe channel URLs into contact enrichment or manual review workflows.

### Workflow ideas

Run this actor weekly for the same keyword list and store the result in a dataset, spreadsheet or database. Compare new videos, repeated channels, title patterns and thumbnails. For content marketing, combine it with transcript extraction to study the top videos in more detail. For sales and partnerships, combine it with a website/contact extractor to find the public business contact behind a creator or brand channel.

Because each row keeps the source `query`, you can run a mixed list of keywords in one task and still filter the output later. That makes it useful for agencies managing several client niches or for teams tracking many product categories at once.

### Reliability notes

The actor does not use a YouTube API key and does not download media. YouTube may occasionally change page behavior, so keep scheduled runs modest and avoid aggressive high-volume scraping.

For very large datasets, split your keyword list into several tasks. That makes failures easier to retry and gives cleaner per-topic datasets. If you are monitoring important keywords, keep a saved task per keyword group so the run history stays easy to inspect.

### Pricing

This actor uses pay-per-result pricing. You are charged for each video result pushed to the dataset, plus a tiny actor-start event.

### FAQ

#### Does it download videos?

No. It only extracts metadata.

#### Does it require a YouTube API key?

No. It uses public YouTube metadata extraction through `yt-dlp`.

#### Can I scrape multiple queries?

Yes. Add multiple values to `queries`; each row includes the source query.

#### Can I schedule it?

Yes. Use saved tasks to monitor keywords daily, weekly or monthly.

#### Does it include channel data?

It returns channel name, channel id and channel URL when available.

#### Can it return every YouTube result for a keyword?

No scraper can guarantee a complete YouTube search universe because YouTube search is dynamic and personalized. This actor is designed for practical result snapshots and repeatable keyword monitoring.

#### Can I use it for lead generation?

Yes, as a discovery step. It gives you videos and channels. You can then review channels manually or enrich channel websites with a separate contact extractor.

#### Is it legal?

This actor extracts publicly available metadata. You are responsible for using the output lawfully, respecting YouTube's terms, privacy rules, copyright, CAN-SPAM, GDPR and any platform-specific limits that apply to your use case.

#### Why use this instead of the official YouTube API?

The official API is excellent when you already have a quota and a developer setup. This actor is simpler for no-code exports, scheduled scraping, quick research and Apify workflows.

### You might also like

- YouTube Transcript Scraper - extract transcripts from videos
- YouTube Playlist Extractor - export playlist videos
- Website Contact Extractor - find emails from creator websites
- Google News Scraper - monitor news results

### Keywords

YouTube search scraper, YouTube SERP API, YouTube video data, YouTube keyword research, YouTube channel discovery, YouTube SEO scraper, video search results, creator discovery, influencer lead generation.

# Actor input Schema

## `queries` (type: `array`):

YouTube search keywords to scrape.

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

Maximum YouTube videos to return per query.

## Actor input object example

```json
{
  "queries": [
    "python tutorial",
    "ai agents"
  ],
  "maxResults": 10
}
```

# Actor output Schema

## `results` (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 = {
    "queries": [
        "python tutorial",
        "ai agents"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/youtube-search-results-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 = {
    "queries": [
        "python tutorial",
        "ai agents",
    ],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/youtube-search-results-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 '{
  "queries": [
    "python tutorial",
    "ai agents"
  ],
  "maxResults": 10
}' |
apify call benthepythondev/youtube-search-results-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Search Results Scraper - Video Data",
        "description": "Scrape YouTube search results by keyword: video title, URL, description, duration, channel, channel URL, views, thumbnail and verification flag.",
        "version": "1.0",
        "x-build-id": "IFtd893xjpHiIY4XM"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/benthepythondev~youtube-search-results-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-benthepythondev-youtube-search-results-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/benthepythondev~youtube-search-results-scraper/runs": {
            "post": {
                "operationId": "runs-sync-benthepythondev-youtube-search-results-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/benthepythondev~youtube-search-results-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-benthepythondev-youtube-search-results-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "queries": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "YouTube search keywords to scrape.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max results per query",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum YouTube videos to return per query.",
                        "default": 10
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
