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

$0.5/1K 🔥 Fast YouTube search scraper! Videos by keyword — title, channel, views, duration & link. No API key, no quota. JSON, CSV, Excel or API in seconds. Pull thousands for discovery, monitoring & research ⚡

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

## Pricing

from $0.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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

Scrape **YouTube search results by keyword** — no API key, no login, no quota.
Give it a list of search queries and get back clean, structured video data:
title, channel, view count, duration, published date, thumbnail and a direct
watch URL. Built for **video discovery, keyword monitoring and trend tracking**
at scale.

This actor talks to YouTube's internal *innertube* endpoint (the same one the
website uses), so it is fast and **datacenter-proxy friendly** — you don't need
expensive residential proxies to run it.

### Features

- 🔎 **Search by keyword** — pass any number of queries, each scraped independently.
- 📄 **Deep pagination** — up to 1,000 videos per query via continuation tokens.
- 🎯 **Clean output** — one row per video with parsed integer view counts.
- 🔑 **No API key** — nothing to register, no Google quota.
- 💸 **Cheap** — datacenter proxies are enough; ~**$0.5 per 1,000 videos**.
- 🧱 **Robust** — curl\_cffi (Chrome TLS fingerprint) with a urllib fallback.

### Use cases

- **Video discovery** — surface the top videos for any topic or niche.
- **Competitor & keyword monitoring** — track who ranks for your target keywords.
- **Content research** — find high-performing formats, titles and channels.
- **Trend tracking** — watch how results shift over time for a query.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | Scraping mode. Currently `search` (keywords → videos). |
| `queries` | array | List of keyword search queries. Each is scraped up to `maxItems`. |
| `maxItems` | integer | Max videos per query (default `100`, max `1000`). |

Example:

```json
{
  "mode": "search",
  "queries": ["lofi hip hop", "python tutorial"],
  "maxItems": 100
}
```

### Output

Each dataset item is a single video:

```json
{
  "query": "lofi hip hop",
  "video_id": "n61ULEU7CO0",
  "title": "lofi hip hop radio - beats to relax/study to",
  "channel": "Lofi Girl",
  "channel_url": "https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow",
  "duration": "6:10:58",
  "views": 56023605,
  "views_text": "56,023,605 views",
  "published_time": "4 years ago",
  "thumbnail": "https://i.ytimg.com/vi/n61ULEU7CO0/hq720.jpg",
  "url": "https://www.youtube.com/watch?v=n61ULEU7CO0",
  "source": "youtube",
  "scraped_at": "2026-07-20T15:00:00+00:00"
}
```

`views` is a best-effort integer (`"1.2M views"` → `1200000`); the raw string is
always kept in `views_text`. All fields are nullable.

### Pricing

Roughly **$0.5 per 1,000 videos** on Apify's platform, depending on proxy usage.
Search runs cheaply on datacenter proxies.

### Related actors

- [YouTube Channel Scraper](https://apify.com/ninhothedev/youtube-channel-scraper)
- [YouTube Comments Scraper](https://apify.com/ninhothedev/youtube-comments-scraper)
- [YouTube Keyword Scraper](https://apify.com/ninhothedev/youtube-keyword-scraper)
- [YouTube Transcript Scraper](https://apify.com/ninhothedev/youtube-transcript-scraper)

### Keywords

youtube scraper, youtube search scraper, youtube video scraper, scrape youtube
search results, youtube keyword scraper, video discovery, youtube api alternative,
youtube data extraction, youtube monitoring, youtube trends, no api key.

### Disclaimer

Only scrapes publicly available search results. Respect YouTube's Terms of
Service and applicable laws when using scraped data.

# Actor input Schema

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

Scraping mode. 'search' takes keyword queries and returns video results, paginating up to maxItems per query.

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

List of keyword search queries. Each query is scraped independently up to maxItems videos.

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

Maximum number of videos to scrape per query. Higher values require more continuation requests.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "lofi hip hop",
    "python tutorial"
  ],
  "maxItems": 100
}
```

# 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": [
        "lofi hip hop",
        "python tutorial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/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": [
        "lofi hip hop",
        "python tutorial",
    ] }

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

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Az2ne5aKB6Py5nIR1/builds/feDlcI9WU8uuM8C4Z/openapi.json
