# YouTube Search Scraper: Videos, Channels (`herus13/youtube-search-scraper`) Actor

Search YouTube by keyword and get videos, channels or playlists with no login and no API key. Filter by upload date, duration and sort order. Every row has the title, link, views, duration and channel. Export JSON, CSV or Excel.

- **URL**: https://apify.com/herus13/youtube-search-scraper.md
- **Developed by:** [herus13](https://apify.com/herus13) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 youtube search 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

The YouTube Search Scraper searches YouTube by keyword and returns videos, channels or playlists, with no login and no API key. Get one clean row per result with its title, link, description, views, duration and owner, ready for keyword research, competitor discovery and influencer lists.

### What you get

One row per search result, in YouTube's order, with a `rank` starting at 1 for each query. A video result carries its duration and view count (rounded, like `13M`); a channel result carries the subscriber count and verified badge; a playlist result carries its owner. Columns a result type has no value for stay empty.

```json
{
  "kind": "video",
  "query": "python tutorial",
  "rank": 1,
  "result_id": "ix9cRaBkVe0",
  "url": "https://www.youtube.com/watch?v=ix9cRaBkVe0",
  "title": "Python Full Course for free",
  "description": "Python tutorial for beginners full course...",
  "thumbnail_url": "https://i.ytimg.com/vi/ix9cRaBkVe0/hq720.jpg",
  "duration_seconds": 43200,
  "view_count": 13202802,
  "live_status": null,
  "channel_id": "UC4SVo0Ue36XCfOyb5Lh1viQ",
  "channel_name": "Bro Code",
  "channel_handle": "@BroCodez",
  "channel_url": "https://www.youtube.com/channel/UC4SVo0Ue36XCfOyb5Lh1viQ",
  "channel_subscribers": null,
  "channel_verified": false,
  "scraped_at": "2026-10-30T09:00:00Z",
  "_meta": {"author": "https://apify.com/herus13", "status": "ok", "message": null}
}
```

`_meta` is run metadata, not scraped data. `kind` says what the row is (`video`, `channel` or `playlist`) and `result_id` is the video id, channel id or playlist id. The sort, upload window and length filters are the same ones YouTube's own filter menu sets, so results match what a person sees. Video results do not carry a publish date or exact views; read them with the [YouTube Video Scraper](https://apify.com/herus13/youtube-video-scraper).

### What it costs

| Event | Price |
|---|---|
| Actor Start (`apify-actor-start`) | $0.00005 |
| YouTube search result (`result`) | $0.0005 |

### Input

| Field | Type | Required | Default | What it does |
|---|---|---|---|---|
| `queries` | array | no | — | What to search YouTube for, one query per entry, for example `python tutorial`. Each query is searched on its own and its results keep YouTube's order. Leave empty and the run stops with an error, so give at least one query. |
| `result_type` | string | no | `"videos"` | What kind of result to return: `videos`, `channels` or `playlists`. Default videos. |
| `sort_by` | string | no | `"relevance"` | How YouTube orders the results: `relevance`, `upload_date` (newest first), `view_count` (most viewed first) or `rating`. Default relevance. |
| `upload_date` | string | no | `"any"` | Only results uploaded within this window: `hour`, `today`, `week`, `month`, `year`, or `any`. Default any. |
| `duration` | string | no | `"any"` | Only videos of this length: `short` (under 4 minutes), `medium` (4 to 20 minutes), `long` (over 20 minutes) or `any`. Applies to video results only. Default any. `all`, `s` and `l` mean any, short and long. |
| `max_results_per_query` | integer | no | `50` | How many results to return for each query. Default 50, minimum 0. Set 0 to return none. |
| `max_results_total` | integer | no | `1000` | Stop after this many results across all queries. Default 1000, minimum -1. Set 0 for no results. Set -1 for no limit. |
| `proxyUrls` | array | no | — | Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run. |

### How to run it

1. Add one or more search queries.
2. Choose videos, channels or playlists.
3. Set the sort order and, for videos, the upload window and length.
4. Run it and export the dataset as JSON, CSV or Excel.

The 20 newest short videos about cats from the last week:

```json
{
  "queries": [
    "cats"
  ],
  "sort_by": "upload_date",
  "upload_date": "week",
  "duration": "short",
  "max_results_per_query": 20
}
```

Minimal input:

```json
{
  "queries": [
    "python tutorial"
  ]
}
```

Available as the MCP tool `herus13--youtube-search-scraper` on mcp.apify.com, so an AI agent can call it with the same input.

### Use cases

- **Keyword and topic research**: see which videos and channels rank for a phrase and how popular they are.
- **Competitor discovery**: find channels in a niche, with subscriber counts, to benchmark against.
- **Influencer lists**: search a topic as channels and collect handles, links and audience size.
- **Trend monitoring**: sort by upload date over the last day or week to catch new videos on a subject.
- **Datasets for AI**: build a table of titles, descriptions and channels for a topic.

### FAQ

**Does it need a YouTube account or API key?** No. It reads what any visitor can see, without logging in.

**Can I search for channels or playlists, not only videos?** Yes. Set the result type to channels or playlists. Each row's `kind` says which it is.

**Why is the view count rounded?** YouTube's result list shows rounded views such as 13M. For the exact count, likes and publish date, pass the video links to the YouTube Video Scraper.

**What happens with a query that has no results?** It returns no rows, costs nothing, and the run log names the query.

**Can I use my own proxy?** Yes. Paste gateway URLs into Your own proxy URLs and the run uses them first, then falls back to the included residential proxy if they fail.

**Is the data fresh?** Every run searches YouTube live, so rows reflect the moment of the run, and each row carries its `scraped_at` time.

**I use another YouTube search actor. Do I have to rewrite my input?** Usually not. Over the API or MCP, the run also reads the input of the most-used YouTube actors as you would send it to them. Single names work too: `keyword`, `keywords`, `searchQueries`, `searchTerms` or `q` for the queries (a YouTube search link works too, the term is read from it), `maxResults` for the limit per query, `maxItems` for the total, and `type` (`video`, `channel` or `playlist`) for the result type. A field you set on this actor's own form always wins. A limit of 0 means none here, never "all"; a form whose 0 means all gets this actor's own limit instead. Sorts and filters from another actor are not translated, and the run log names anything it cannot use. Each video row also carries the column names of the most-used YouTube actor (`id`, `duration`, `channelName`, `channelUrl`, `viewCount`, `fromYTUrl`, `thumbnailUrl`, `numberOfSubscribers`), filled from this actor's own data and left empty where it has none, so an export or integration built for that actor keeps working.

### Related actors

- [YouTube Video Scraper](https://apify.com/herus13/youtube-video-scraper) — full details of any YouTube video.
- [YouTube Channel Video Scraper](https://apify.com/herus13/youtube-channel-video-scraper) — the videos, Shorts and streams of YouTube channels.
- [YouTube Comment Scraper](https://apify.com/herus13/youtube-comment-scraper) — comments and replies of YouTube videos.

# Actor input Schema

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

What to search YouTube for, one query per entry, for example `python tutorial`. Each query is searched on its own and its results keep YouTube's order. Leave empty and the run stops with an error, so give at least one query.

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

What kind of result to return: `videos`, `channels` or `playlists`. Default videos.

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

How YouTube orders the results: `relevance`, `upload_date` (newest first), `view_count` (most viewed first) or `rating`. Default relevance.

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

Only results uploaded within this window: `hour`, `today`, `week`, `month`, `year`, or `any`. Default any.

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

Only videos of this length: `short` (under 4 minutes), `medium` (4 to 20 minutes), `long` (over 20 minutes) or `any`. Applies to video results only. Default any. `all`, `s` and `l` mean any, short and long.

## `max_results_per_query` (type: `integer`):

How many results to return for each query. Default 50, minimum 0. Set 0 to return none.

## `max_results_total` (type: `integer`):

Stop after this many results across all queries. Default 1000, minimum -1. Set 0 for no results. Set -1 for no limit.

## `proxyUrls` (type: `array`):

Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run.

## Actor input object example

```json
{
  "queries": [
    "python tutorial"
  ],
  "result_type": "videos",
  "sort_by": "relevance",
  "upload_date": "any",
  "duration": "any",
  "max_results_per_query": 50,
  "max_results_total": 1000
}
```

# Actor output Schema

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

One row per search result: a video, channel or playlist.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("herus13/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 = { "queries": ["python tutorial"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,herus13/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/lDaOqzK4f1gAcrCs4/builds/g4smIWvpXo3wfq0D5/openapi.json
