# YouTube Search Scraper | Videos, Shorts, Channels & Views (`genial_candlestand/youtube-search-scraper`) Actor

Get YouTube search results by keyword in website order: result type (video, Short, live, channel, playlist, movie), title, channel, view count, duration and position. Many keywords per run, YouTube filters incl. Last hour, country, optional exact likes and dates. No login.

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

## Pricing

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

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, Shorts, Channels & Views

![YouTube Search Scraper | Videos, Shorts, Channels & Views](https://api.apify.com/v2/key-value-stores/Ll7RrWtDkZYOrBvfE/records/youtube-com-post-content-search-by-keyword-banner-36e5b16d.png)

Search YouTube by keyword and get the results in the same order as the website: the result type (video, Short, live stream, channel, playlist or movie), title, channel name and handle, view count, duration, relative upload time and the rank of each result for its keyword. Turn on details to add the exact view count, like count and publish date, and the channel of every Short. Many keywords per run, one flat table, no login or API key.

### What does YouTube Search Scraper do?

You give it a list of keywords; it runs each one through YouTube's own web search and returns one row per search result. It supports the website's filters (type, upload date including the hidden "Last hour", duration, features such as 4K or Live, Relevance or Popularity sort) and the YouTube location (country). It is built for marketers and SEO people tracking rankings, creators researching a niche, agencies looking for channels to sponsor, and data teams or AI agents feeding YouTube results into pipelines.

### How to scrape YouTube search results

![YouTube Search Scraper output example: #, Keyword, Type, Thumbnail, Title, Channel](https://api.apify.com/v2/key-value-stores/Ll7RrWtDkZYOrBvfE/records/youtube-com-post-content-search-by-keyword-output-ceab3979.png)

![How YouTube Search Scraper works: Sends each keyword to YouTube's web search API with your filters and country; Follows the next-page tokens until your limit or YouTube's last page; Optionally fetches](https://api.apify.com/v2/key-value-stores/Ll7RrWtDkZYOrBvfE/records/youtube-com-post-content-search-by-keyword-how-db5324e1.png)

1. Open the actor in Apify Console and enter one or more keywords in **Search keywords**, one per line.
2. Set **Max results per keyword** (default 50).
3. Optionally choose a **Result type**, **Sort by**, **Upload date**, **Duration**, **Features** and **Country**.
4. Turn on **Exact stats and dates (details)** if you need exact views, likes and publish dates.
5. Click **Start** and download the results as JSON, CSV or Excel, or read them through the API.

### How much does it cost to scrape YouTube search results?

Price per event by Apify plan:

| Event | Free | Bronze | Silver | Gold and above |
|---|---|---|---|---|
| Search result | $1.20 per 1,000 | $1.08 per 1,000 | $0.96 per 1,000 | $0.84 per 1,000 |
| Actor start | $0.00005 | $0.00005 | $0.00005 | $0.00005 |

A test run with the API example input below returned 100 rows in 11 s.

You pay per search result saved to the dataset: one event `search-result` per row. Videos, Shorts, live streams, channels, playlists and movies all cost the same, and the details (exact views, likes, dates) are included at no extra cost. Duplicates — the same result repeated within one keyword — are skipped and not charged. Every run also has a small start fee.

| Scenario | Results (events) | Cost on the Free plan |
|---|---|---|
| 2 keywords × 50 results (default) | 100 | about $0.12 |
| 1 keyword, all results YouTube shows (type Videos) | about 460 | about $0.55 |
| 20 keywords × 50 results with details | 1,000 | about $1.20 |
| 100 keywords × 100 results | 10,000 | about $12.00 |

Costs include the start fee of $0.00005. Higher Apify plans get a lower price per result.

### Input

![YouTube Search Scraper input example: Search keywords, Max results per keyword, Result type, Sort by, Upload date, Duration, Features](https://api.apify.com/v2/key-value-stores/Ll7RrWtDkZYOrBvfE/records/youtube-com-post-content-search-by-keyword-input-0ae399d9.png)

| Field | What it does |
|---|---|
| `queries` (required) | Keywords to search, one per line; each is searched separately. |
| `maxResultsPerQuery` | Max results per keyword, 1–1000, default 50. |
| `type` | `all` (website mix), `video`, `shorts`, `channel`, `playlist` or `movie`. |
| `sortBy` | `relevance` (default) or `popularity` (most viewed first). |
| `uploadDate` | `any`, `hour`, `today`, `week`, `month` or `year`. |
| `duration` | `any`, `under3`, `3to20` or `over20` minutes. |
| `features` | Any of `live`, `4k`, `hd`, `subtitles`, `creativeCommons`, `hdr`, `360`, `vr180`, `3d` (all must match). |
| `country` | Two-letter YouTube location, default `US`; changes the ranking. |
| `disableAutocorrect` | Search exactly what you typed instead of YouTube's correction. |
| `fetchDetails` | Adds exact view count, like count, publish date and the channel of Shorts. |
| `maxItems` | Optional cap on all results of the run. |
| `proxyConfiguration` | Apify datacenter proxy by default. |

Example — this month's most viewed videos for a keyword, with exact stats:

```json
{
  "queries": ["iphone 17 review"],
  "type": "video",
  "sortBy": "popularity",
  "uploadDate": "month",
  "fetchDetails": true,
  "maxResultsPerQuery": 100
}
```

### What data can you extract from YouTube search?

Every row has the same keys; a field that does not apply to the result type is `null`.

| Field | Description |
|---|---|
| `type` | `video`, `short`, `live`, `movie`, `channel` or `playlist` |
| `id`, `url` | Video, channel or playlist id and its YouTube URL |
| `query`, `position` | The keyword and the 1-based rank of the result for it |
| `title`, `description`, `imageUrl` | Title, description snippet and thumbnail |
| `author`, `authorUrl`, `channelId`, `channelHandle`, `channelVerified` | The channel behind the result |
| `viewCount`, `viewCountText` | Views as a number and as shown on YouTube |
| `watchingCount` | Current viewers of a live stream, when YouTube shows them |
| `likeCount`, `publishedAt` | Like count and publish date (`YYYY-MM-DD`) — with details only |
| `publishedText` | Relative upload time, e.g. "2 months ago" |
| `duration`, `durationSeconds` | Length as shown and in seconds |
| `badges` | Badges such as "4K" or "Earns commission" |
| `subscriberCount`, `subscriberCountText` | Subscribers of a channel result |
| `videoCount` | Number of videos in a playlist result |
| `scrapedAt` | When the row was scraped |

A real video row (search for "sourdough bread", without details; thumbnail URL shortened):

```json
{
  "type": "video",
  "id": "McqmnU1vVe4",
  "url": "https://www.youtube.com/watch?v=McqmnU1vVe4",
  "title": "The Best Sourdough Bread Recipe",
  "query": "sourdough bread",
  "position": 11,
  "description": "To make sourdough bread, you only need four ingredients with no kneading required. It's quite simple. What makes sourdough ...",
  "imageUrl": "https://i.ytimg.com/vi/McqmnU1vVe4/hq720.jpg?...",
  "author": "Preppy Kitchen",
  "authorUrl": "https://www.youtube.com/@PreppyKitchen",
  "channelId": "UCTvYEid8tmg0jqGPDkehc_Q",
  "channelHandle": "@PreppyKitchen",
  "channelVerified": true,
  "viewCount": 251615,
  "viewCountText": "251,615 views",
  "watchingCount": null,
  "likeCount": null,
  "publishedAt": null,
  "publishedText": "2 months ago",
  "duration": "12:48",
  "durationSeconds": 768,
  "badges": ["5 products", "Earns commission"],
  "subscriberCount": null,
  "subscriberCountText": null,
  "videoCount": null,
  "scrapedAt": "2026-11-04T23:26:48.821Z"
}
```

### Use cases

- **Keyword ranking** — track which videos and Shorts rank for your keywords in a given country, with their position.
- **Niche research** — find what is most viewed this month for a topic and how long the top videos are.
- **Channel discovery** — search with type Channels to get handles, subscriber counts, verified badges and descriptions of channels to sponsor or partner with.
- **Shorts research** — collect Shorts for a keyword with exact views, likes, dates and the channel behind each Short.
- **Localized and exact-term search** — compare rankings across countries, or search brand names and slang without autocorrect.

### Limitations

- YouTube shows at most about 450–500 results per keyword and filter set, even when it estimates millions. The log tells you when a keyword ran out before your limit.
- `likeCount` and `publishedAt` are filled only with details on, and only for videos, Shorts and live streams. `publishedAt` is `null` when YouTube gives only a relative time such as "5 hours ago".
- Without details, Shorts have a rounded view count (from "3.8M views") and no channel name or handle.
- Subscriber counts of channels are rounded as YouTube shows them; hidden counts are `null`.
- Sorting by upload date or rating, and the "Purchased" and "Location" features, are not offered: YouTube no longer applies them.
- The interface language is English, so counts and relative dates are parsed reliably; titles and descriptions stay in their original language.
- Comments, tags and channel totals are not part of search results.

### Tips and troubleshooting

- **Get more rows per request:** with type All, Popularity sort returns only a few results per page; choose type Videos for large popular lists.
- **Only new uploads:** use Upload date = Last hour or Today and schedule the run.
- **Filters that do not combine** are rejected before any request, with a message naming the fields: Channels and Playlists cannot use Upload date, Duration or Features; Shorts cannot use Duration or Live; Live cannot be combined with other features or Upload date; Movies cannot use Popularity sort.
- **0 rows for a keyword:** YouTube found nothing for that keyword and filter set (common with Shorts or Movies and short periods); the log has a warning per keyword. Widen the upload date or remove a feature.
- **Country error:** use one of the 111 YouTube locations (e.g. US, GB, DE, JP); CN, IR and KP are not YouTube locations.
- **Details make runs slower** (one extra request per video, two per Short), but the price per result stays the same.

### API, MCP and integrations

Run the actor from your code with the same JSON input as in Console. Your API token is in [Console → Settings → API & Integrations](https://console.apify.com/settings/integrations).

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("genial_candlestand/youtube-search-scraper").call(run_input={
    "queries": ["sourdough bread", "iphone 17 review"],
    "maxResultsPerQuery": 50,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

**Node.js** (`npm install apify-client`):

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('genial_candlestand/youtube-search-scraper').call({
    "queries": ["sourdough bread", "iphone 17 review"],
    "maxResultsPerQuery": 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**HTTP** — one request runs the actor and returns the results (runs up to 5 minutes; longer ones: [run asynchronously](https://docs.apify.com/api/v2/act-runs-post)):

```bash
curl -X POST "https://api.apify.com/v2/acts/genial_candlestand~youtube-search-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries":["sourdough bread","iphone 17 review"],"maxResultsPerQuery":50}'
```

**AI agents (MCP).** Add the actor as a tool of the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Claude Code:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=genial_candlestand/youtube-search-scraper"
```

Claude Desktop, Cursor or VS Code: `{"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=genial_candlestand/youtube-search-scraper"}}}`. Then ask, for example:

- "Find the 100 most viewed YouTube videos about iphone 17 review uploaded this month, with likes and dates"
- "List YouTube channels for sourdough bread with handles and subscriber counts"
- "Get the top 50 YouTube results for ラーメン 作り方 as ranked in Japan"

**Integrations.** Run it on a schedule with [Apify Schedules](https://docs.apify.com/platform/schedules) and send the results to Google Sheets, Slack, Zapier, Make, n8n or your webhook — see [Apify integrations](https://docs.apify.com/platform/integrations).

### FAQ

**Is it legal to scrape YouTube search results?**<br>
The actor collects only public data that YouTube shows to any logged-out visitor in its search. You are responsible for how you use the data, including copyright and privacy rules that apply to you.

**Do I need a YouTube API key or a login?**<br>
No. The actor uses YouTube's web search, not the YouTube Data API, so there is no key, quota or login.

**Why did I get fewer results than Max results per keyword?**<br>
YouTube stops at about 450–500 results per keyword and filter set. The log reports, per keyword, how many results were reached and how many YouTube estimated.

**How is it different from other YouTube search actors?**<br>
It takes many keywords per run with `query` and `position` on every row, returns all six result types in one flat table in the website order, adds exact views, likes and dates (also for Shorts) at no extra cost, and has a no-autocorrect switch. The price is $1.20 per 1,000 results on the Free plan; the most used YouTube search actor in the Store charges $1.00 per 1,000 but takes one keyword per run and returns videos only.

**Does the same video appear twice?**<br>
Not within one keyword: repeats are skipped and not charged. The same video found by two keywords appears once for each keyword, with its own position.

### Also useful

- [YouTube Channel Scraper](https://apify.com/genial_candlestand/youtube-channel-details-videos-scraper) — get full details of channels you found: subscribers, exact views, country, links and their videos
- [YouTube Comments Scraper](https://apify.com/genial_candlestand/youtube-comments-and-replies-scraper) — collect comments and replies of the videos you found, with likes and dates
- [Google Trends Scraper](https://apify.com/genial_candlestand/google-trends-scraper) — check search interest over time and by region for the same keywords
- [Google News Scraper](https://apify.com/genial_candlestand/google-news-articles-search-scraper) — find news articles for the same keywords, with source and publish time

# Actor input Schema

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

Keywords or phrases to search on YouTube, one per line, as you would type them in the search box. Each is searched separately; every row carries its keyword in query and its rank in position.

## `maxResultsPerQuery` (type: `integer`):

Stop each keyword after this many results. YouTube shows at most about 450–500 results per keyword and filter set; the log tells you when a keyword ran out earlier.

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

Which kind of results to return, like the Type filter on YouTube. "All" returns the website's mix (videos, live streams, Shorts, sometimes channels and playlists). Channels and Playlists cannot be combined with Upload date, Duration or Features; Shorts cannot be combined with Duration or Live.

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

Relevance (the website default) or Popularity (most viewed first). YouTube no longer offers sorting by upload date or rating; use Upload date to get recent results. Popularity does not work with Movies. With "All" types Popularity returns only a few results per page, so use Videos for large popular lists.

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

Only results uploaded within this period, like the Upload date filter on YouTube ("Last hour" is hidden on the website but works). Not for Channels or Playlists, and not together with the Live feature. With Shorts or Movies short periods often return nothing.

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

Only videos of this length, like the Duration filter on YouTube. Works with All, Videos and Movies; not for Shorts, Channels or Playlists. With "All", Under 3 minutes returns mostly Shorts.

## `features` (type: `array`):

Only results with all selected features, like the Features filter on YouTube. Not for Channels or Playlists. Live cannot be combined with other features, Upload date, Shorts or Movies. Movies do not support Subtitles/CC, Creative Commons or 3D.

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

Two-letter country code of the YouTube location the search runs from (e.g. US, GB, DE, JP). It changes the ranking, like switching Location on the website. Must be one of the 111 locations YouTube supports (CN, IR or KP are not); lower case is accepted.

## `disableAutocorrect` (type: `boolean`):

YouTube silently replaces misspelled keywords with its correction ("sourdugh bred" → "sourdough bread"). Turn this on to get results for exactly what you typed — useful for brand names, slang and new terms.

## `fetchDetails` (type: `boolean`):

Adds the exact view count, like count and publish date for videos, Shorts and live streams, and the channel name and handle of Shorts. Slower (one extra request per video, two per Short); same price per result.

## `maxItems` (type: `integer`):

Optional cap on all results of the run across all keywords. Leave empty to be limited only by Max results per keyword.

## `proxyConfiguration` (type: `object`):

Proxy for the requests to YouTube. The default Apify datacenter proxy works; residential proxy is not needed.

## Actor input object example

```json
{
  "queries": [
    "sourdough bread",
    "iphone 17 review"
  ],
  "maxResultsPerQuery": 50,
  "type": "all",
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "features": [],
  "country": "US",
  "disableAutocorrect": false,
  "fetchDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All search results (overview view)

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

All search results with every field

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

Counters of the run (items, requests, fill rate)

# 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": [
        "sourdough bread",
        "iphone 17 review"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("genial_candlestand/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": [
        "sourdough bread",
        "iphone 17 review",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("genial_candlestand/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": [
    "sourdough bread",
    "iphone 17 review"
  ]
}' |
apify call genial_candlestand/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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