# YouTube Search Scraper (`logiover/youtube-search-scraper`) Actor

Search YouTube by keyword and export all matching videos or channels with title, views, duration, date, channel and URL. Filter by upload date, duration, type and sort order. No login, no API key. Bulk multi-query to JSON/CSV/Excel.

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

## Pricing

from $3.50 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## YouTube Search Scraper 🔍 — Bulk Keyword Video & Channel Results (No Login, No API Key)

**Scrape YouTube search results by keyword** and export **all matching videos, channels and playlists** with full metadata — **title, view count, duration, publish date, channel, description snippet and URL**. This **YouTube search scraper** supports YouTube's real filters (**upload date, duration, type, sort order**), runs **many queries at once**, and exports to **JSON, CSV or Excel**.

No login, no cookies, no Google API key, no quota. It paginates deep into the results — hundreds to thousands of results per query.

> ✅ No login · No API key · Real YouTube filters · Bulk multi-keyword · Videos, channels & playlists

---

### Why use this YouTube search scraper?

- **Deep results, not page one.** Paginates far beyond the first 20 hits.
- **Real YouTube filters.** Sort by relevance / date / views / rating, and filter by **upload date**, **duration** and **type** — encoded exactly like YouTube's own filter chips.
- **Exact view counts.** Search returns precise numbers (e.g. `54,877,621`), normalized to an integer.
- **Bulk keywords.** Pass a whole list; every result is tagged with its `query`.
- **Videos, channels & playlists.** Scrape one type or everything.
- **No API quota.** The official YouTube Data API caps at ~100 searches/day — this has no such limit.

---

### How to scrape YouTube search results (step by step)

No code needed. Here's how to **extract YouTube search results in bulk**:

1. **Open the actor** on Apify and click **Try for free**.
2. **Enter your keywords** in `searchQueries` (e.g. `["lofi hip hop", "react tutorial"]`).
3. *(Optional)* Set `type` (video/channel/playlist), `sortBy`, `uploadDate`, `duration`, and `maxResultsPerQuery`.
4. Click **Start**.
5. **Export** results to CSV, Excel or JSON — or pull them via the Apify API.

**Automating it?** Schedule the actor to track the freshest videos for your keywords (with `uploadDate: "week"`) and feed the IDs straight into your pipeline.

---

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

| Data point | Field | Example |
|------------|-------|---------|
| Result type | `resultType` | `"video"` |
| Title | `title` | `"Best of lofi hip hop 2021"` |
| Views (exact) | `viewCount` | `54877621` |
| Duration | `duration` / `durationSeconds` | `"6:10:58"` / `22258` |
| Published | `publishedTime` | `"4 years ago"` |
| Channel | `channelTitle` / `channelId` | `"Lofi Girl"` |
| Description snippet | `descriptionSnippet` | `"the best lofi beats…"` |
| Watch URL | `url` | `https://youtube.com/watch?v=…` |
| Search query | `query` | `"lofi hip hop"` |

---

### Use cases

- **Trend & market research** — pull the top videos for a topic by view count to see what wins.
- **Content strategy & video SEO** — analyze titles, durations and recency for a keyword you want to rank for.
- **Creator / influencer discovery** — search `type: channel` to surface creators in a niche.
- **Competitive monitoring** — track the freshest uploads for a keyword with the `uploadDate` filter.
- **Dataset building** — assemble keyword-based video sets for analytics or AI pipelines.
- **Feed downstream tools** — pass result `videoId`s into the Comments or Video Details scrapers.

---

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `searchQueries` | `string[]` | — | Keywords to search. Each is scraped separately and tagged. |
| `type` | `string` | `video` | `video`, `channel`, `playlist`, `movie`, `any`. |
| `sortBy` | `string` | `relevance` | `relevance`, `date`, `views`, `rating`. |
| `uploadDate` | `string` | `any` | `any`, `hour`, `today`, `week`, `month`, `year`. |
| `duration` | `string` | `any` | `any`, `short` (<4m), `medium` (4–20m), `long` (>20m). |
| `maxResultsPerQuery` | `integer` | `100` | Cap per query. `0` = unlimited. |
| `maxResults` | `integer` | `0` | Global cap. |

#### Example input

```json
{
  "searchQueries": ["iphone 17 review", "pixel 10 review"],
  "type": "video",
  "sortBy": "date",
  "uploadDate": "month",
  "maxResultsPerQuery": 200
}
````

#### Example output

```json
{
  "resultType": "video",
  "query": "lofi hip hop",
  "videoId": "n61ULEU7CO0",
  "title": "Best of lofi hip hop 2021 ✨",
  "viewCount": 54877621,
  "duration": "6:10:58",
  "publishedTime": "4 years ago",
  "channelTitle": "Lofi Girl",
  "url": "https://www.youtube.com/watch?v=n61ULEU7CO0"
}
```

***

### How it works

This **YouTube keyword scraper** calls YouTube's internal search (the same the website uses) and paginates with continuation tokens. Your `sortBy`, `uploadDate`, `duration` and `type` choices are encoded into YouTube's real `params` filter — so results match exactly what you'd get clicking the filter chips on youtube.com. A fresh access key is fetched per run, with retries.

***

### Frequently asked questions

**Do I need a YouTube API key to scrape search results?**
No — no key, no login, and no Google API quota (the official API caps at ~100 searches/day).

**Can I get more than the first page of results?**
Yes — it paginates automatically up to YouTube's result ceiling or your `maxResultsPerQuery`.

**Can I scrape YouTube channels or playlists by keyword?**
Yes — set `type` to `channel` or `playlist`.

**Can I filter by upload date or video length?**
Yes — `uploadDate` (hour/today/week/month/year) and `duration` (short/medium/long) work just like YouTube's filters.

**Can I scrape YouTube search without coding?**
Yes — enter keywords, click Start, download CSV/Excel/JSON.

**Is scraping YouTube search legal?**
The actor collects only **public** search results. Use the data in line with YouTube's Terms and applicable laws.

***

### Limits & notes

- YouTube caps total results per query (typically a few hundred), like the website does.
- Live streams may lack view/duration values until they end.
- Relative dates (`"4 years ago"`) are what search exposes; use `scrapedAt` as the reference.

***

### The complete YouTube scraping toolkit

- **[YouTube Channel Scraper](https://apify.com/logiover/youtube-channel-scraper)** — a channel's full video catalog
- **[YouTube Video Details Scraper](https://apify.com/logiover/youtube-video-details-scraper)** — exact views, likes & tags
- **[YouTube Comments Scraper](https://apify.com/logiover/youtube-comments-scraper)** — all comments for a video
- **[YouTube Influencer Discovery](https://apify.com/logiover/youtube-influencer-discovery-scraper)** — creators, engagement & emails

***

### 💰 Pricing

Pay-per-result — you only pay for the results you actually get. No proxy or YouTube API costs.

### 🆘 Support

Need search within a specific channel, region/language targeting, or live-only results? Open an issue on the actor's page.

# Actor input Schema

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

Keywords / phrases to search YouTube for. Each query is scraped separately and tagged in the output. Examples: \['lofi hip hop', 'product review', 'react tutorial'].

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

What to return: 'video' (default), 'channel', 'playlist', 'movie', or 'any' (mixed).

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

Result ordering: relevance (default), upload date, view count, or rating.

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

Filter by how recently the video was uploaded (videos only).

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

Filter by video length (videos only): short (<4 min), medium (4–20 min), long (>20 min).

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

Hard cap on results saved per query. Set 0 for unlimited (paginates until YouTube stops returning results).

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

Global cap across all queries. 0 = unlimited.

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop"
  ],
  "type": "video",
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "maxResultsPerQuery": 100,
  "maxResults": 0
}
```

# Actor output Schema

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

video/channel/playlist

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

Result title

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

Channel name

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

View count

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

Relative publish

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

Video duration

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

Result URL

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

Search query

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

Scrape timestamp

# 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": [
        "lofi hip hop"
    ],
    "type": "video",
    "sortBy": "relevance",
    "uploadDate": "any",
    "duration": "any"
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/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": ["lofi hip hop"],
    "type": "video",
    "sortBy": "relevance",
    "uploadDate": "any",
    "duration": "any",
}

# Run the Actor and wait for it to finish
run = client.actor("logiover/youtube-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "lofi hip hop"
  ],
  "type": "video",
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any"
}' |
apify call logiover/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=logiover/youtube-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Search Scraper",
        "description": "Search YouTube by keyword and export all matching videos or channels with title, views, duration, date, channel and URL. Filter by upload date, duration, type and sort order. No login, no API key. Bulk multi-query to JSON/CSV/Excel.",
        "version": "1.0",
        "x-build-id": "HH3uc2uWBAWIWYl5l"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/logiover~youtube-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-logiover-youtube-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/logiover~youtube-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-logiover-youtube-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/logiover~youtube-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-logiover-youtube-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchQueries"
                ],
                "properties": {
                    "searchQueries": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "Keywords / phrases to search YouTube for. Each query is scraped separately and tagged in the output. Examples: ['lofi hip hop', 'product review', 'react tutorial'].",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "title": "Result type",
                        "enum": [
                            "video",
                            "channel",
                            "playlist",
                            "movie",
                            "any"
                        ],
                        "type": "string",
                        "description": "What to return: 'video' (default), 'channel', 'playlist', 'movie', or 'any' (mixed).",
                        "default": "video"
                    },
                    "sortBy": {
                        "title": "Sort by",
                        "enum": [
                            "relevance",
                            "date",
                            "views",
                            "rating"
                        ],
                        "type": "string",
                        "description": "Result ordering: relevance (default), upload date, view count, or rating.",
                        "default": "relevance"
                    },
                    "uploadDate": {
                        "title": "Upload date",
                        "enum": [
                            "any",
                            "hour",
                            "today",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Filter by how recently the video was uploaded (videos only).",
                        "default": "any"
                    },
                    "duration": {
                        "title": "Duration",
                        "enum": [
                            "any",
                            "short",
                            "medium",
                            "long"
                        ],
                        "type": "string",
                        "description": "Filter by video length (videos only): short (<4 min), medium (4–20 min), long (>20 min).",
                        "default": "any"
                    },
                    "maxResultsPerQuery": {
                        "title": "Max results per query",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Hard cap on results saved per query. Set 0 for unlimited (paginates until YouTube stops returning results).",
                        "default": 100
                    },
                    "maxResults": {
                        "title": "Max results (all queries)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Global cap across all queries. 0 = unlimited.",
                        "default": 0
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
