# YouTube Search Scraper: Videos, Shorts, Filters (`arcadium/youtube-search`) Actor

YouTube search results for any keyword (title, channel, views, duration, date, rank) at $0.90 per 1,000. YouTube's own filters (upload date, length, HD, 4K, live, CC, Shorts), any country, full details optional. Free error rows.

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

## Pricing

from $0.36 / 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, Filters

Give it search terms and it returns YouTube's search results as one JSON row per video: rank, title, channel, views, duration, date, live and Shorts flags. YouTube's own filters work (upload date, length, HD, 4K, live, subtitles, Creative Commons, Shorts only) in any country. $0.90 per 1,000 results; full video details (exact date, likes, category, description) are optional.

**Why this actor**

- Input names of the popular YouTube search actors are accepted (`query`, `q`, `keywords`, `order`, `videoDuration`, `uploadDate`, `regionCode`, `gl`), so an existing input runs unchanged.
- Fast by default: about 20 results per request, a few hundred results in seconds.
- Searches that find nothing or links that are not searches come back as free error rows that say why.

Built by Arcadium Data: public data, dated and agent-ready, never personal data.

### Use with AI agents

The actor takes plain JSON and returns one flat row per video, so an AI agent or MCP client (for example through [mcp.apify.com](https://mcp.apify.com)) can call `arcadium/youtube-search` directly. Results cost $0.90 per 1,000 on the Free plan.

Input example for "the top 20 YouTube results for a keyword this month":

```json
{ "searchQueries": ["web scraping tutorial"], "maxResults": 20, "dateFilter": "month" }
```

"Most viewed long videos in Germany, with likes and exact dates":

```json
{ "searchQueries": ["e-auto test"], "maxResults": 30, "sortingOrder": "views", "lengthFilter": "plus20", "searchCountry": "DE", "videoDetails": true }
```

### What you get

| Field | What it holds |
| --- | --- |
| `position` | Rank in YouTube's results for that search (1 = first). |
| `videoId`, `url` | Video id and watch link. |
| `title` | Video title. |
| `channelName`, `channelId`, `channelHandle`, `channelUrl` | The channel that published the video. |
| `viewCount` | Views (rounded in fast mode, exact with `videoDetails`). |
| `durationSeconds` | Length in seconds. |
| `publishDate`, `publishDateIsApprox` | Date; approximate in fast mode ("3 weeks ago"), exact with `videoDetails`. |
| `isShort`, `isLive`, `isUpcoming` | Shorts, live now, scheduled premiere. |
| `likeCount`, `category`, `description`, `keywords`, `captionLanguages` | With `videoDetails` only. |
| `source`, `sourceType` | The search term (sourceType `search`). |

Output example:

```json
{
  "rowType": "video",
  "platform": "youtube",
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "publishDate": "2009-10-25",
  "publishDateIsApprox": true,
  "publishedText": "16 years ago",
  "durationSeconds": 213,
  "viewCount": 1700000000,
  "isShort": false,
  "isLive": false,
  "detailLevel": "listing",
  "source": "never gonna give you up",
  "sourceType": "search",
  "position": 1,
  "scrapedAt": "2026-10-31T04:00:00.000Z"
}
```

### Input

| Field | What it does |
| --- | --- |
| `searchQueries` | Search terms, one search each. |
| `urls` | Optional youtube.com/results search URLs. |
| `maxResults` | Results per search (default 50, up to 10,000). |
| `maxItems` | Cap for the whole run. |
| `contentType` | `videos` (default) or `shorts`. |
| `sortingOrder` | `relevance`, `rating`, `date`, `views`. |
| `dateFilter` | `hour`, `today`, `week`, `month`, `year`. |
| `lengthFilter` | `under4`, `between420`, `plus20`. |
| `isHD`, `is4K`, `isLive`, `hasSubtitles`, `hasCC` | YouTube's feature filters. |
| `searchCountry` | Country the results are ranked for (default US). |
| `publishedAfter`, `publishedBefore` | Exact date range on top of YouTube's loose filter. |
| `videoDetails` | Full video details at the video price. |

### Use it from code

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('arcadium/youtube-search').call({ searchQueries: ['lofi hip hop'], maxResults: 50 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((i) => i.rowType === 'video').length, 'results');
```

### Pricing

You pay per result delivered, at the price of your Apify plan. Error rows, repeats and results outside your date range are free.

| Apify plan | Per 1,000 results | Per 1,000 results with full details | Per 1,000 Shorts with full details |
| --- | --- | --- | --- |
| Free | $0.90 | $3.60 | $3.60 |
| Starter (Bronze) | $0.54 | $2.70 | $2.70 |
| Scale (Silver) | $0.45 | $2.34 | $2.34 |
| Business (Gold) | $0.36 | $2.16 | $2.16 |
| Platinum | $0.36 | $1.35 | $1.35 |
| Diamond | $0.36 | $0.90 | $0.72 |

Plus a one-off $0.001 per GB of memory when a run starts. Set a maximum cost per run in the Apify run options and the actor stops before it goes over.

### Related actors and data

- [YouTube Scraper: Videos, Shorts, Channels, Search](https://apify.com/arcadium/youtube-videos)
- [YouTube Channel Scraper: About, Stats, Videos](https://apify.com/arcadium/youtube-channels)
- [YouTube Transcript & Subtitles Scraper: Text, SRT, VTT](https://apify.com/arcadium/youtube-transcripts)

### Use cases

- Keyword tracking: who ranks for your terms on YouTube, and how `position` changes week by week.
- Content research: what length, format and channels win a topic, per country.
- Lead lists of channels: the channels that show up for a niche (then read them with our YouTube Channel Scraper).
- Agents: "find videos about X" before reading their transcripts or comments.

### Limitations

- YouTube's upload-date filter and date sort are loose; use `publishedAfter` for an exact range.
- Fast-mode views are rounded ("1.7M") and dates approximate ("3 years ago"); turn on `videoDetails` for exact values.
- YouTube stops a search after several hundred results; very broad terms do not go deeper than YouTube shows.
- Videos only (and Shorts with `contentType`); channel and playlist results are left out.

### Privacy

Public data only, read the way an anonymous visitor's browser reads it. No login, no cookies, no account. Emails and phone numbers in descriptions are replaced with `[email]` and `[phone]`. The channel name is the publisher of the video.

### FAQ

**Why is a date marked approximate?**
Search pages only say "2 weeks ago". Turn on `videoDetails` for exact ISO dates.

**A search returned nothing. Why?**
Look at its error row: a very narrow filter combination can match no video. Error rows are free.

# Actor input Schema

## `searchQueries` (type: `array`):

YouTube search terms, e.g. \["web scraping tutorial", "iphone 17 review"]. Each term gives up to maxResults videos in YouTube's search order (position is the rank).

## `urls` (type: `array`):

Optional. YouTube search page URLs as copied from the browser, e.g. https://www.youtube.com/results?search_query=lofi (filters in the URL are kept). Channel, playlist and video links give a free error row.

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

Videos per search term or search URL, up to 10,000 (default 50). Videos outside the date range do not count.

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

Stops the run after this many videos across all inputs, 1 to 1,000,000. A cost cap; leave empty for no limit.

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

Values: videos (default), shorts. With shorts, every search returns Shorts only.

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

Values: relevance (default), rating, date (upload date), views.

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

Two-letter country code YouTube ranks search results for, e.g. DE or IN (default US). Titles and dates stay as published.

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

Values: hour, today, week, month, year. YouTube's own upload-date filter for searches; it is loose, so combine it with publishedAfter for an exact range.

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

Values: under4 (under 4 minutes), between420 (4 to 20 minutes), plus20 (over 20 minutes).

## `isHD` (type: `boolean`):

Search results in HD only (YouTube's HD feature filter).

## `hasSubtitles` (type: `boolean`):

Search results that have subtitles or closed captions only.

## `hasCC` (type: `boolean`):

Search results under a Creative Commons licence only.

## `isLive` (type: `boolean`):

Search results that are live streams only.

## `is4K` (type: `boolean`):

Search results in 4K only (YouTube's 4K feature filter).

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

Date as YYYY-MM-DD (e.g. 2026-01-01) or a relative age such as "30 days". Older videos are skipped for free. In fast mode the listing date is approximate, so videos near the edge get one details request to check.

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

Date as YYYY-MM-DD (e.g. 2026-06-30) or a relative age such as "7 days". Newer videos are skipped for free.

## `videoDetails` (type: `boolean`):

Off (default): fast mode, each result as the search page shows it (title, channel, rounded views, duration, approximate date, live/Shorts flags), charged at the video-listing price. On: one details request per video adds the exact publish date, exact views, likes, category, description, keywords and caption languages, charged at the video price.

## `includeCaptionLanguages` (type: `boolean`):

With full video details: adds captionLanguages and hasCaptions (one more small request per video). On by default.

## `includeCommentCount` (type: `boolean`):

With full video details: adds commentCount to regular videos (one more small request each). Shorts always get it. Off by default.

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

With full video details. Values: full (default), short (about 300 characters), none. Emails and phone numbers are removed.

## `includeErrorRows` (type: `boolean`):

Adds a free row (rowType error, with a code and message) for every search or URL that gave no data. On by default.

## `maxRetries` (type: `integer`):

Advanced. How often a request is retried after a temporary error, 0 to 10.

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

Advanced. Leave empty: the actor starts on datacenter proxies and moves to residential when YouTube asks to confirm you are not a bot.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "maxResults": 10,
  "contentType": "videos",
  "videoDetails": false,
  "includeCaptionLanguages": true,
  "includeCommentCount": false,
  "description": "full",
  "includeErrorRows": true,
  "maxRetries": 5
}
```

# Actor output Schema

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

All rows of this run in the default dataset.

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

No description

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

No description

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

No description

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

No description

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

Requests, data volume, retries, proxy tiers and cost per video for this run.

# 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 = {
    "searchQueries": [
        "web scraping tutorial"
    ],
    "maxResults": 10,
    "contentType": "videos"
};

// Run the Actor and wait for it to finish
const run = await client.actor("arcadium/youtube-search").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 = {
    "searchQueries": ["web scraping tutorial"],
    "maxResults": 10,
    "contentType": "videos",
}

# Run the Actor and wait for it to finish
run = client.actor("arcadium/youtube-search").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 '{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "maxResults": 10,
  "contentType": "videos"
}' |
apify call arcadium/youtube-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arcadium/youtube-search"
        }
    }
}
```

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/n2GeOkPF3LLzZ48GZ/builds/sqbv9Wqa2WNIsrzaA/openapi.json
