# YouTube Search Scraper – Bulk Keywords, Videos & Shorts (`maged120/youtube-search`) Actor

YouTube Search Scraper: scrape YouTube search results for up to 100 keywords in one run. Video titles, URLs, views, channels, upload dates, durations and thumbnails. Sort by views, filter by upload date, length or Shorts. No YouTube API key needed. Export to CSV, JSON, Excel or API.

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

## Pricing

from $5.00 / 1,000 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

### What does YouTube Search Scraper do?

**YouTube Search Scraper** gives you YouTube's search results for any keyword as clean rows: title, URL, views, channel, upload date, length, thumbnail and a Shorts flag. Put in one keyword or a hundred, and every row tells you which keyword it came from.

No YouTube API key, no Google Cloud project and no 10,000-units-a-day quota. It runs on [Apify](https://apify.com), so you can schedule it, call it from the API, or send the results straight to Google Sheets, Make, Zapier or n8n.

### What people use it for

- **Keyword and SEO research:** see which videos and channels own a search term before you make a video about it.
- **Rank tracking:** run the same keywords every day or week and watch who moves up.
- **Competitor research:** find out who keeps showing up for your niche's keywords, and how many views they pull.
- **Finding creators:** build a list of channels to sponsor or reach out to, sorted by views.
- **Feeding other tools and AI pipelines:** get video URLs in bulk, then pull transcripts, comments or full details with the related tools below.
- **Shorts research:** keep only Shorts, or drop them, depending on what you're studying.

### Why use this one?

- **Bulk keywords in one run:** up to 100 queries per run, each searched separately, with a `query` field on every row.
- **Filters that run before you pay:** Shorts only or no Shorts, min/max length, upload date (24 h, week, month, year), and sort by relevance or views. Videos filtered out never become rows.
- **Clean, flat rows:** the same fields every time, ready for CSV or Excel without cleanup.
- **Fast:** a normal search comes back in seconds.

### How to use it

1. Click **Try for free**.
2. Type one or more keywords in **Search queries**.
3. Set **Max Results** per keyword (1 to 100, default 10).
4. Optionally add filters: Shorts, length, upload date, sort order.
5. Click **Start**, then download the results as JSON, CSV or Excel from the **Output** tab.

### Input

```json
{
  "queries": ["python tutorial for beginners", "ai news this week"],
  "max_results": 20,
  "upload_date_filter": "last_month",
  "exclude_shorts": true
}
```

| Field | Type | Description | Default |
|---|---|---|---|
| `queries` | array | Keywords or phrases, each searched separately (up to 100) | required |
| `query` | string | Single query (older field, still works; merged with `queries`) | — |
| `max_results` | integer | Max videos per query, 1 to 100 | `10` |
| `shorts_only` / `exclude_shorts` | boolean | Keep only Shorts, or drop them (not both) | `false` |
| `min_duration` / `max_duration` | integer | Length limits in seconds | — |
| `upload_date_filter` | string | `last_24h`, `last_week`, `last_month` or `last_year` | any |
| `sort_by` | string | `relevance` or `view_count`. YouTube removed sorting by date and rating in 2025, so those two give relevance order; use the upload date filter for recent videos | `relevance` |

### Output

One row per video. Download as JSON, CSV, Excel or HTML, or read it from the API.

```json
{
  "query": "python tutorial for beginners",
  "title": "Python Tutorial for Beginners - Full Course",
  "video_id": "example",
  "url": "https://www.youtube.com/watch?v=example",
  "uploader": "Programming with Mosh",
  "uploader_id": "@programmingwithmosh",
  "upload_date": "20250115",
  "duration": 22440,
  "view_count": 4200000,
  "thumbnail": "https://i.ytimg.com/vi/example/hqdefault.jpg",
  "short": false
}
```

| Field | Type | Description |
|---|---|---|
| `query` | string | The search query this row came from |
| `title` | string | Video title |
| `video_id` | string | YouTube video ID |
| `url` | string | Full YouTube URL |
| `uploader` / `uploader_id` | string | Channel name and handle |
| `upload_date` | string | Upload date (`YYYYMMDD`), worked out from YouTube's "3 days ago" text, so older videos are approximate (to the month or year) |
| `duration` | number | Length in seconds |
| `view_count` | number | View count |
| `thumbnail` | string | Thumbnail image URL |
| `short` | boolean | `true` for Shorts |

**Shorts rows:** YouTube lists Shorts as cards with only the title, views and thumbnail, so `uploader`, `upload_date` and `duration` are empty on those rows.

### How many results will I get?

You pay per result, so the bill follows the number of rows. Your plan's rates are on the **Pricing** tab.

| Input | Results |
|---|---|
| 1 query, max results 50 | Up to 50 rows |
| 3 queries, max results 50 | Up to 150 rows |
| 100 queries, max results 100 | Up to 10,000 rows |

You can get fewer than the max when YouTube has fewer results for a keyword, or when your filters drop some. Filtered-out videos aren't charged.

### Tips

- Keep **Max Results** small (10–20) for rank tracking. The top results are what matter, and it keeps scheduled runs cheap.
- For "what's new on this topic", use the **upload date** filter. YouTube no longer sorts by date.
- To find big channels in a niche, sort by **View Count** and set a **minimum length** to skip Shorts and clips.
- Got the URLs? Send them to **YouTube Video Details, Transcript & Comments Scraper** for likes, tags, chapters, transcripts and comments.

### FAQ

**Do I need a YouTube account or API key?**
No. It reads YouTube's public search results, the same ones you see in a browser.

**How many results can I get per keyword?**
Up to 100 per query. For more coverage, add variations of the keyword as extra queries ("python tutorial", "learn python", "python course").

**Can I search a specific country or language?**
Not yet. Results come from YouTube's English (US) interface, but videos in any language show up when your keyword is in that language.

**Does it get channels or playlists?**
No, videos and Shorts only.

**Is it maintained?**
Yes, I use it and fix it. If something breaks, open an issue in the **Issues** tab and I'll look at it.

**Need a custom feature?**
Open an issue or message me on Discord: **maged03211**

***

⭐ **Found it useful?** A short review on the Store helps other people find it, and it tells me what to improve next.

### Related tools

- [YouTube Video Details, Transcript & Comments Scraper – likes, tags, chapters, captions and comments for any video](https://apify.com/maged120/youtube-video-details)
- [YouTube Transcript Scraper – subtitles and captions with timestamps](https://apify.com/maged120/youtube-transcript)
- [YouTube Transcript Search – find clips where any phrase is spoken](https://apify.com/maged120/youtube-transcript-search)

# Actor input Schema

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

One or more YouTube search terms, each searched separately (up to 100 per run). Every result row includes the query it came from.

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

One search query. Kept for existing integrations; use "Search queries" for one or many.

## `max_results` (type: `integer`):

Maximum number of videos to scrape

## `shorts_only` (type: `boolean`):

Only include Shorts in results

## `exclude_shorts` (type: `boolean`):

Exclude Shorts from results

## `min_duration` (type: `integer`):

Minimum video duration in seconds

## `max_duration` (type: `integer`):

Maximum video duration in seconds

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

Filter videos by upload date

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

Result order. YouTube itself removed sorting by upload date and rating in 2025, so those two now return relevance order; use the upload date filter to get recent videos.

## Actor input object example

```json
{
  "queries": [
    "Python tutorial",
    "AI news"
  ],
  "max_results": 10,
  "shorts_only": false,
  "exclude_shorts": false,
  "upload_date_filter": "",
  "sort_by": "relevance"
}
```

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

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

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

```

## MCP server setup

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