# YouTube Search Scraper - Videos by Keyword (`wrenfield-data/youtube-search-scraper`) Actor

Search YouTube for videos by keyword and get title, URL, channel, views, duration and publish date. Licensed YouTube SERP data, no browser, no login. $0.001 per video. Built for YouTube SEO and AI agents.

- **URL**: https://apify.com/wrenfield-data/youtube-search-scraper.md
- **Developed by:** [Wrenfield Data](https://apify.com/wrenfield-data) (community)
- **Categories:** Videos, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 video 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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Search Scraper: videos by keyword via licensed YouTube SERP data

**YouTube Search Scraper** searches YouTube for your keywords and returns each **video title, URL, video ID, channel, views, duration, publish date and thumbnail**. Flat JSON, ready for spreadsheets, pipelines and AI agents.

- **$0.001 per video**, pay per result, no subscription (a 20-video keyword search costs $0.02).
- **Licensed data**: DataForSEO YouTube SERP API. No browser, no YouTube login, no residential proxies.
- Free Apify plan: 5 keywords per run.

### Input example

```json
{
    "keywords": ["best crm for small business", "hubspot crm tutorial"],
    "country": "US",
    "language": "en",
    "maxResultsPerKeyword": 20
}
```

`queries` is accepted as an alias of `keywords`.

### Output example

One row per video (real row from a test run on Oct 19, 2026, `best crm for small business`, US):

```json
{
    "keyword": "best crm for small business",
    "rank": 1,
    "title": "Best CRM Software for Small Business for 2026 (Top 5 Tested & Compared)",
    "url": "https://www.youtube.com/watch?v=RIRyuq-AKOU",
    "videoId": "RIRyuq-AKOU",
    "channelName": "LYFE Accounting",
    "channelUrl": "https://www.youtube.com/@LYFEAccounting",
    "views": 49964,
    "publishedAtIso": "2025-11-19 13:34:37 +00:00",
    "durationSecs": 682,
    "duration": "11:22",
    "isShorts": false,
    "isLive": false,
    "country": "US",
    "language": "en"
}
```

Other fields: `channelId`, `description` (snippet), `publishedAt` (relative, as YouTube shows it), `thumbnailUrl`, `scrapedAt`.

### What you can use it for

- **YouTube SEO and rank checks:** see which videos and channels rank for your keywords, in which position (`rank`), in any country and language.
- **Competitor and creator research:** find the channels that own a topic, with views, duration and publish date.
- **Content research for AI pipelines:** collect video IDs for a topic, then pull their transcripts with [YouTube Transcript Scraper](https://apify.com/wrenfield-data/youtube-transcript-scraper).
- **Monitoring:** schedule the same keywords weekly and compare `rank` over time.

### Use it from an AI agent (MCP)

Add this Actor as a tool in Claude, Cursor, VS Code or any MCP client with one URL:

`https://mcp.apify.com?tools=wrenfield-data/youtube-search-scraper`

- **Minimal input:** `{"keywords": ["best crm for small business"], "country": "US", "language": "en"}`
- **Cap the bill:** set `maxTotalChargeUsd` on the run (a run option, not an input field) to limit what a run can charge.
- Rows are flat JSON with the fields documented above, so an agent can use them without post-processing.

### FAQ

**Do I need a YouTube or Google account, or an API key?** No.

**How many results per keyword?** Set `maxResultsPerKeyword`. You pay only for videos returned.

**Is `rank` the same as what I see on YouTube?** It is the position in YouTube search results for the country and language you set. Personalized results in your own browser can differ.

**What about Shorts and live streams?** When YouTube includes them in the results, they are flagged with `isShorts` and `isLive`.

### Pricing

| Event | Price |
| --- | --- |
| Video result (`video-result`) | **$0.001** per video returned |

Example: 10 keywords × 20 videos = $0.20. Set **Maximum cost per run** to cap spend.

### How the data is obtained

Results come from **DataForSEO's YouTube SERP API**, a commercial data provider. This Actor does not open YouTube in a browser and does not use your Google account.

### Feedback and support

Missing a field, hit an error, or need another country or option? Open an issue on the **Issues** tab and include the run ID. We read every issue and reply there.

### Acceptable use

Independent tool, not affiliated with YouTube, Google or DataForSEO. Use for research and monitoring. Not for use from sanctioned jurisdictions listed in our other Actor READMEs (Russia, Belarus, Cuba, Iran, Syria, Myanmar, North Korea, Crimea, occupied Ukrainian territories).

# Actor input Schema

## `keywords` (type: `array`):

YouTube search queries, one per line (up to 200).

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

Same as Keywords: one query per line. Use this if you are migrating from another YouTube search Actor.

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

2-letter country code (US, GB, DE...) or country name.

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

Alias of Country.

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

2-letter language code (en, de, fr...).

## `maxResultsPerKeyword` (type: `integer`):

How many videos to return per keyword (up to 50).

## Actor input object example

```json
{
  "keywords": [
    "best crm for small business"
  ],
  "country": "US",
  "language": "en",
  "maxResultsPerKeyword": 20
}
```

# Actor output Schema

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

No description

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

No description

## `summary` (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 = {
    "keywords": [
        "best crm for small business"
    ],
    "country": "US",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("wrenfield-data/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 = {
    "keywords": ["best crm for small business"],
    "country": "US",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("wrenfield-data/youtube-search-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 '{
  "keywords": [
    "best crm for small business"
  ],
  "country": "US",
  "language": "en"
}' |
apify call wrenfield-data/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wrenfield-data/youtube-search-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/NnXrl4Taj4D352Rmz/builds/KVhRnXTVsTfwDkONf/openapi.json
