# YouTube Search Scraper: Videos, Views, Channels & Dates (`datadesk-io/youtube-search-scraper`) Actor

Scrape YouTube search results for any keyword: video title, URL, channel, views, duration, upload date, description snippet and rank. Sort by date or views, filter by upload date and length, many queries per run. No API key. $1 per 1,000 videos.

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

## Pricing

from $0.80 / 1,000 videos

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

Scrape **YouTube search results** for any keyword, exactly as they appear on youtube.com: **video title, URL, channel (name, ID, URL, verified badge), view count, duration, upload date, description snippet, Short/live flags, thumbnail and rank**. Run **many queries at once**, **sort by upload date or views**, filter by **upload date and length**, localize by **country and language**, and get **daily keyword alerts**. No YouTube API key, no quota, no login. **$1 per 1,000 videos.**

### Try it now (one click)

1. Click **Start**. The prefilled input searches 2 keywords (20 videos each). In our latest check (Nov 16, 2026) it returned **40 videos in about 2 seconds**. An empty input runs a small demo too.
2. Type your keywords (one per line) and choose sort order, upload date and duration filters.
3. Download the results as CSV, Excel or JSON, or get them via API, webhooks, Make or Zapier.

**Price example:** 100 videos = **$0.105**, 1,000 videos = **$1.005** ($1.00 per 1,000 videos + $0.005 per run). Silver and Gold plan users pay 10% and 20% less per video. Apify's free plan includes $5 of usage every month, enough for about 4,995 videos. Runs that find nothing are not charged.

#### Sample of real results

*Real rows from a local test run on Nov 16, 2026 (some columns). Each video also includes the other fields listed below.*

| Rank | Title | Channel | Views | Duration | Published |
|---|---|---|---|---|---|
| 1 | Learn Web Scraping in 5 Minutes (NO PRIOR KNOW… | CodeHead | 190,828 | 4:53 | 8 months ago |
| 2 | Beginners Guide To Web Scraping with Python - … | Tinkernut | 491,259 | 7:36 | 4 years ago |
| 3 | Web Scraping with Python - Beautiful Soup Cras… | freeCodeCamp.org | 1,832,334 | 1:08:23 | 5 years ago |
| 4 | Web Scraping Tutorial / Data Scraping from Web… | Azharul Rafy | 909,130 | 16:27 | 5 years ago |

### What you get

| Field group | Fields |
|---|---|
| Video | video ID, URL, title, description snippet, thumbnail |
| Stats | view count, duration (text and seconds), live and Short flags |
| Date | published time as shown + approximate ISO date |
| Channel | name, channel ID, channel URL, verified badge |
| Context | search query and rank in the results |

### Why this Actor

- **No API key or quota:** the official YouTube Data API allows ~100 searches per day; this Actor has no quota.
- **Cheaper:** $1 per 1,000 videos vs $4+ per 1,000 for popular YouTube scrapers.
- **Real YouTube filters:** sort by date/views/rating, upload date (hour → year), duration, Shorts on/off.
- **Rank tracking:** every row keeps the query and its position, ready for YouTube SEO.

### How to use it

1. Click **Try for free** (or **Start**): the prefilled input runs a quick test.
2. Type your keywords (one per line) and choose sort order, upload date and duration filters.
3. Click **Start** and wait a few seconds.
4. Open the **Output** tab and export as **JSON, CSV, Excel, XML or HTML**, or read the dataset via API.

### Input examples

**Two keywords, 20 videos each:**

```json
{"searchQueries": ["web scraping tutorial", "python for beginners"], "maxResultsPerQuery": 20}
```

**Newest videos this week, no Shorts:**

```json
{"searchQueries": ["iphone 17 review"], "sortBy": "date", "uploadDate": "week", "excludeShorts": true, "maxResultsPerQuery": 100}
```

**Long videos in Mexico, Spanish texts:**

```json
{"searchQueries": ["curso de excel"], "duration": "long", "country": "MX", "language": "es", "maxResultsPerQuery": 200}
```

**Daily keyword alert (only new uploads):**

```json
{"searchQueries": ["my brand name"], "sortBy": "date", "onlyNewVideos": true, "alertsKey": "brand-alert"}
```

#### Input fields

| Field | Type | Description |
|---|---|---|
| `searchQueries` | array | Keywords to search on YouTube, one per line, exactly as you would type them in the YouTube search box. Leave empty to run a demo search ("web scraping tutorial"). |
| `maxResultsPerQuery` | integer | How many videos to save for each search query (YouTube usually returns up to ~500 per query). |
| `maxResults` | integer | Hard cap on videos saved in this run across all queries (hard cap on cost). |
| `sortBy` | string | Order of the results, same as the YouTube search filter. |
| `uploadDate` | string | Only videos uploaded in this period. |
| `duration` | string | Only videos of this length. |
| `excludeShorts` | boolean | Skip YouTube Shorts in the results. |
| `country` | string | Two-letter country code that YouTube uses to localize results, e.g. US, GB, MX, BR. |
| `language` | string | Language code for texts such as "3 days ago", e.g. en, es, pt. Dates are always converted to ISO. |
| `onlyNewVideos` | boolean | Return only videos not seen in previous runs with the same alerts key. Schedule daily with Sort by = Upload date for keyword alerts. |
| `alertsKey` | string | Name for this alert memory (use a different key per saved search). |

### Output example

*Example record from a local test run (long lists shortened).*

```json
{
  "videoId": "hHQlcnubuFI",
  "url": "https://www.youtube.com/watch?v=hHQlcnubuFI",
  "title": "Learn Web Scraping in 5 Minutes (NO PRIOR KNOWLEDGE)",
  "channelName": "CodeHead",
  "channelId": "UCFVteOob_YXJHPaGTqlDV2Q",
  "channelUrl": "https://www.youtube.com/@codehead01",
  "channelVerified": true,
  "viewCount": 190828,
  "duration": "4:53",
  "durationSeconds": 293,
  "publishedTimeText": "8 months ago",
  "publishedAtApprox": "2026-03-18T11:22:18+00:00",
  "descriptionSnippet": "Get Rid of IP Blocking for just $1 with DataImpulse: ...",
  "isLive": false,
  "isShort": false,
  "thumbnailUrl": "https://i.ytimg.com/vi/hHQlcnubuFI/hq720.jpg",
  "searchQuery": "web scraping tutorial",
  "rank": 1,
  "source": "youtube.com search",
  "scrapedAt": "2026-11-16T23:22:18.769185+00:00",
  "isNew": false
}
```

#### Output fields

| Field | Description |
|---|---|
| `searchQuery` | The query that returned this video |
| `rank` | Position of the video in the search results for that query (1 = top) |
| `videoId` | YouTube video ID (11 characters) |
| `url` | Link to the video |
| `title` | Video title |
| `channelName` | Channel name |
| `channelId` | YouTube channel ID (UC...) |
| `channelUrl` | Link to the channel |
| `channelVerified` | True if the channel has the verified badge |
| `viewCount` | View count shown in search results |
| `duration` | Video length as shown, e.g. 12:34 |
| `durationSeconds` | Video length in seconds |
| `publishedTimeText` | Upload time as YouTube shows it, e.g. 3 days ago |
| `publishedAtApprox` | Approximate upload date (UTC) computed from the relative time |
| `descriptionSnippet` | Short description excerpt shown in search results |
| `isLive` | True if the video is a live stream right now |
| `isShort` | True if the result is a YouTube Short |
| `thumbnailUrl` | Thumbnail image URL |
| `source` | Data source |
| `isNew` | True if not seen in earlier runs with the same alerts key (alerts mode) |
| `scrapedAt` | When this record was collected (UTC) |

### Pricing

Pay-per-event: **$0.005** once per run that saves results + **$0.001 per video** ($1.00 / 1,000). Runs that save nothing are not charged.

| Videos saved | Approx. cost |
|---|---|
| 20 | $0.025 |
| 100 | $0.105 |
| 1,000 | $1.005 |
| 10,000 | $10.005 |

### Use cases

- YouTube SEO: track where your videos rank for target keywords
- Find creators and channels for influencer outreach
- Competitor and topic research: what gets views in a niche
- Brand and keyword monitoring with daily alerts
- Build video datasets for AI and analytics

### Integrations / API

Works with the Apify API, Schedules, webhooks, Make, Zapier, n8n and MCP. Example:

```bash
curl "https://api.apify.com/v2/acts/datadesk-io~youtube-search-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"searchQueries": ["web scraping tutorial", "python for beginners"], "maxResultsPerQuery": 20}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("datadesk-io/youtube-search-scraper").call(run_input={"searchQueries": ["web scraping tutorial", "python for beginners"], "maxResultsPerQuery": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### MCP

Use this Actor from an MCP client (Cursor, Claude Desktop, etc.) through the Apify MCP server (`datadesk-io/youtube-search-scraper`).

### Alerts mode

Turn on **Only new videos**, set **Sort by = Upload date** and schedule the Actor daily: each run returns only videos not seen in earlier runs with the same alerts key (nothing is charged when there is nothing new).

### FAQ

**Do I need a YouTube API key?** No. The Actor reads the public YouTube search results directly.

**How many results per keyword?** YouTube usually serves a few hundred results per query; set Max videos per query up to 1,000 and the Actor pages until YouTube stops.

**Are view counts exact?** Search results show full view counts (e.g. 8,167,208). Upload dates are relative ("3 days ago"), so we also give an approximate ISO date.

**Can I get comments, transcripts or channel videos?** Use our YouTube Comments Scraper and YouTube Channel Scraper (datadesk-io) for those.

### Limitations

- Likes, comments count and full descriptions are not shown in search results (only a snippet).
- Upload dates are relative in search results; publishedAtApprox is computed from them.
- YouTube decides how many results a query returns and may mix in some older videos when sorting by date.
- Playlists, channels and courses in the results are skipped (videos only).

### Start now

Click **Start** to run the prefilled example, then adjust the input. Missing a field or filter? Open an issue on the **Issues** tab and tell us what you need.

### Support

Questions, bugs or a missing field? Email **datadesk.io@proton.me** or open an issue on the Actor page.

***

**ES:** Extrae resultados de búsqueda de YouTube: título, URL, canal, vistas, duración, fecha y posición. Filtros y alertas, sin API key. **$1 / 1.000 videos.**
**PT:** Extraia resultados de busca do YouTube: título, URL, canal, visualizações, duração, data e posição. Filtros e alertas, sem API key. **$1 / 1.000 vídeos.**

# Actor input Schema

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

Keywords to search on YouTube, one per line, exactly as you would type them in the YouTube search box. Leave empty to run a demo search ("web scraping tutorial").

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

How many videos to save for each search query (YouTube usually returns up to ~500 per query).

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

Hard cap on videos saved in this run across all queries (hard cap on cost).

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

Order of the results, same as the YouTube search filter.

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

Only videos uploaded in this period.

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

Only videos of this length.

## `excludeShorts` (type: `boolean`):

Skip YouTube Shorts in the results.

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

Two-letter country code that YouTube uses to localize results, e.g. US, GB, MX, BR.

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

Language code for texts such as "3 days ago", e.g. en, es, pt. Dates are always converted to ISO.

## `onlyNewVideos` (type: `boolean`):

Return only videos not seen in previous runs with the same alerts key. Schedule daily with Sort by = Upload date for keyword alerts.

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

Name for this alert memory (use a different key per saved search).

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorial",
    "best budget phone 2026"
  ],
  "maxResultsPerQuery": 100,
  "maxResults": 1000,
  "sortBy": "date",
  "uploadDate": "week",
  "duration": "long",
  "excludeShorts": false,
  "country": "US",
  "language": "en",
  "onlyNewVideos": false
}
```

# 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 = {
    "searchQueries": [
        "web scraping tutorial",
        "python for beginners"
    ],
    "maxResultsPerQuery": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("datadesk-io/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 = {
    "searchQueries": [
        "web scraping tutorial",
        "python for beginners",
    ],
    "maxResultsPerQuery": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("datadesk-io/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 '{
  "searchQueries": [
    "web scraping tutorial",
    "python for beginners"
  ],
  "maxResultsPerQuery": 20
}' |
apify call datadesk-io/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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